Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collide Callback multiple times problem
Author Message
pawsUp1703 Offline
Junior Member

Posts: 37
Joined: Jan 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Khyrpa Offline
Senior Member

Posts: 615
Joined: Apr 2011
Reputation: 24
Post: #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 all posts by this user Quote this message in a reply
pawsUp1703 Offline
Junior Member

Posts: 37
Joined: Jan 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Khyrpa Offline
Senior Member

Posts: 615
Joined: Apr 2011
Reputation: 24
Post: #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 all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,268
Joined: Jul 2011
Reputation: 223
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,186
Joined: Mar 2011
Reputation: 56
Post: #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 all posts by this user Quote this message in a reply
pawsUp1703 Offline
Junior Member

Posts: 37
Joined: Jan 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
pawsUp1703 Offline
Junior Member

Posts: 37
Joined: Jan 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,268
Joined: Jul 2011
Reputation: 223
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)