Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Switch case issue
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Switch case issue

First off, I see this is a timer function. How are you calling it? Can you post the initial call to this function as well? Could it be calling the timer double at times?

The fEventSpeed variable should be set using floats instead of ints. When you set a float to a non-decimal number, it's actually set to an int and implicitly cast to a float. So fMyFloat = 5; is discouraged. Use fMyFloat = 5.0f; instead. This can help you avoid unexpected precision results.

The first time this function is called, DreamStep is set to 1, then it runs case 1 and breaks. After that, it adds a new timer which is meant to be 12 seconds, but due to the above, this might not be the case. Try printing out fEventSpeed before you call the timer.

PHP Code: (Select All)
if(GetLocalVarInt("DreamStep") < 5)
{
    AddDebugMessage("fEventSpeed = " fEventSpeedfalse);
    AddTimer("Dream1"fEventSpeed"Dream");


(This post was last modified: 01-15-2019, 01:59 PM by Mudbill.)
01-15-2019, 01:59 PM
Find


Messages In This Thread
Switch case issue - by Claymix - 01-15-2019, 05:05 AM
RE: Switch case issue - by Mudbill - 01-15-2019, 01:59 PM
RE: Switch case issue - by Claymix - 01-15-2019, 09:44 PM
RE: Switch case issue - by Mudbill - 01-16-2019, 09:45 PM
RE: Switch case issue - by Claymix - 01-16-2019, 09:58 PM
RE: Switch case issue - by Mudbill - 01-17-2019, 06:20 PM
RE: Switch case issue - by Claymix - 01-17-2019, 06:26 PM



Users browsing this thread: 1 Guest(s)