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
Help on entity activation
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#7
RE: Help on entity activation

I don't think a collide callback would be very reliable for this type of check. You could just check it every time you actually pick up a note.

I think the issue here is that it's in the PlayerInteractCallback. It probably slipped Rom's mind that the basic CallbackFunc is ran duing OnPickup. Try calling the code Rom provided within the CallbackFunc at the top of each note.

Edit: Actually, let's tweak it a bit. If you have the check to use == 3 before the script that adds the value, then value #3 is actually not recognized until the 4th time this is called. It goes from top to bottom, so even if the value is 3 by the end of it, it won't trigger the if-statement unless it is 3 when it reaches it.

PHP Code: (Select All)
void OnStart()
{
    
SetLocalVarInt("monster_appear"0); //This is not exactly necessary, because an AddLocalVarInt script will create a var that is non-existant, but you might as well have it here.
}

void CheckNote(string &in asEntityint Type//If you move the code to CallbackFunc, you need to add the second parameter.
{
    if(
GetLocalVarInt("monster_appear") < 3AddLocalVarInt("monster_appear"1); 
    else {
        
//Do an action here.
    
}


This script is slightly more compact and it works the other way around. First it checks if the value has not yet reached 3 (the heart <3 means "less than three" :3). If it has not reached it, it adds another value. If it has reached 3 (or more), it will run the script in the else-block instead.

(This post was last modified: 07-13-2014, 07:46 AM by Mudbill.)
07-13-2014, 07:38 AM
Find


Messages In This Thread
Help on entity activation - by TShapeShifter - 07-12-2014, 10:26 PM
RE: Help on entity activation - by TShapeShifter - 07-12-2014, 10:54 PM
RE: Help on entity activation - by Romulator - 07-13-2014, 01:56 AM
RE: Help on entity activation - by TShapeShifter - 07-13-2014, 03:07 AM
RE: Help on entity activation - by Mudbill - 07-13-2014, 07:38 AM
RE: Help on entity activation - by Romulator - 07-13-2014, 08:42 AM
RE: Help on entity activation - by TShapeShifter - 07-13-2014, 10:03 PM
RE: Help on entity activation - by Mudbill - 07-13-2014, 10:15 PM
RE: Help on entity activation - by TShapeShifter - 07-13-2014, 10:45 PM
RE: Help on entity activation - by Mudbill - 07-14-2014, 12:12 AM



Users browsing this thread: 1 Guest(s)