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
Collide Callback multiple times problem
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#1
Collide Callback multiple times problem

So I have a problem with all my entitycollide callbacks
When you don't change the map you can only activate it once as I want it to be, the callback is deleted afterwards.
But when you change maps and the get into the old map again the callback is resetted somehow..
is there a way to change that?

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
12-26-2011, 08:18 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Collide Callback multiple times problem

Put it to OnStart instead of OnEnter so it only triggers the first time the map is loaded

12-26-2011, 08:33 PM
Find
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#3
RE: Collide Callback multiple times problem

(12-26-2011, 08:33 PM)Khyrpa Wrote: Put it to OnStart instead of OnEnter so it only triggers the first time the map is loaded
Thats not possible since some of these maps are maps where you can enter another map before the event is triggered

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
12-26-2011, 08:54 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#4
RE: Collide Callback multiple times problem

(12-26-2011, 08:54 PM)pawsUp1703 Wrote: Thats not possible since some of these maps are maps where you can enter another map before the event is triggered
I dont know if I actually got what you meant, but if thats not what you want then use variable and if cases inside OnEnter

12-26-2011, 09:03 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: Collide Callback multiple times problem

(12-26-2011, 08:54 PM)pawsUp1703 Wrote: Thats not possible since some of these maps are maps where you can enter another map before the event is triggered

Why isn't it possible? Are you uncertain of how AddEntityCollideCallback works?

Tutorials: From Noob to Pro
12-26-2011, 11:14 PM
Website Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#6
RE: Collide Callback multiple times problem

The collision callbacks you declare in OnStart shouldn't be removed if you leave the map before triggering them. If you find otherwise, try using a local variable to track whether the collision has happened, and in OnEnter, only add the callback if it hasn't been triggered earlier.

12-26-2011, 11:24 PM
Find
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#7
RE: Collide Callback multiple times problem

(12-26-2011, 11:24 PM)palistov Wrote: The collision callbacks you declare in OnStart shouldn't be removed if you leave the map before triggering them. If you find otherwise, try using a local variable to track whether the collision has happened, and in OnEnter, only add the callback if it hasn't been triggered earlier.
So basically if I set them in OnStart they will be triggered only once and it doesn't matter how often I changed maps before activating them?

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
12-27-2011, 06:04 PM
Find
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#8
RE: Collide Callback multiple times problem

(12-27-2011, 06:04 PM)pawsUp1703 Wrote:
(12-26-2011, 11:24 PM)palistov Wrote: The collision callbacks you declare in OnStart shouldn't be removed if you leave the map before triggering them. If you find otherwise, try using a local variable to track whether the collision has happened, and in OnEnter, only add the callback if it hasn't been triggered earlier.
So basically if I set them in OnStart they will be triggered only once and it doesn't matter how often I changed maps before activating them?
anyone?

I desperately need the info as I want to gift the full conversion to my boyfriend as christmas present on friday and the only thing that doesn't work are the collide callbacks..

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
12-28-2011, 03:45 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#9
RE: Collide Callback multiple times problem

(12-28-2011, 03:45 PM)pawsUp1703 Wrote: anyone?

I desperately need the info as I want to gift the full conversion to my boyfriend as christmas present on friday and the only thing that doesn't work are the collide callbacks..

Why wait for a response? Part of creating a story is trying and testing things out. The game will save certain script mechanisms during the game session and afterwards when the player decides to save and exit: this if the script didn't request for removal upon being triggered. Unless you want things to repeat, setting collide callbacks (and other kinds of interactions) in OnStart is the practical method.

If you want other people to test your work, you can request for testers.

Tutorials: From Noob to Pro
12-28-2011, 04:39 PM
Website Find




Users browsing this thread: 2 Guest(s)