Posted Event not Resetting with Scene Reload  [FIXED]

Report bugs and issues

Posted Event not Resetting with Scene Reload

Postby Selzier » 2014-08-22 22:03

Selzier
Platinum Boarder
Platinum Boarder
 
Posts: 523
Joined: 2011-01-26 00:02
Location: Boise

Re: Posted Event not Resetting with Scene Reload

Postby dbladez » 2014-08-23 06:56

Well, wouldn't the scene object be destroyed so the object's post event would also be destroyed.

I would create a User AI say PlatformsAI instead of an Object AI to maybe setup/control/destroy Platforms and then send them events of what to do and how to initialize or end them. Then when you are going to destroy a scene, stop/destroy those platforms inside your PlatformsAI onDestroy Event or something. Or even save their variables in PlatformsAI table or hashtable of some sort. Then respond with a success, make the new scene and send that PlatformsAI a onRestart post event once its created.

Hope that helps.
dbladez
Platinum Boarder
Platinum Boarder
 
Posts: 694
Joined: 2010-11-03 22:10
Location: Ontario, Canada

Re: Posted Event not Resetting with Scene Reload

Postby Badger » 2014-08-23 11:28

________________________________
User avatar
Badger
Gold Boarder
Gold Boarder
 
Posts: 198
Joined: 2012-05-11 08:42
Location: Australia

Re: Posted Event not Resetting with Scene Reload

Postby broozar » 2014-08-23 14:33

2 ideas:

- 1. you say in the video that the range of motion is determined by time. depending on your algorithm, the problem might lie there. if loading takes longer than expected and time "stops"/"jumps" and your algorithm does not compensate for that (i.e. set a new base time onInit), that might be the problem.

- 2. might be a problem in JP's packs, but since they are closed source, nobody knows except for julien.
User avatar
broozar
Administrator
Administrator
 
Posts: 4172
Joined: 2007-09-16 10:22
Location: Berlin - Germany

Re: Posted Event not Resetting with Scene Reload

Postby killingfields » 2014-08-23 18:11

Before you load the scene call application.flushAIEvents ( )

This will "execute alle event calls that have lined up in the cue so far." After this the event pipe should be empty and you can load your scene.

I hope this helps!
killingfields
Fresh Boarder
Fresh Boarder
 
Posts: 10
Joined: 2014-07-05 23:20

Re: Posted Event not Resetting with Scene Reload

Postby Selzier » 2014-08-23 18:13

Thanks for the input here guys!

broozar, this is not a problem with JPPacks, because I experienced this problem before any JPpacks, and I only implemented JPEvent to try to fix this bug. Also (see attachment) this is reproducible in the simplest of Shiva games.

I don't think it's an issue of delayed time, as my scenes are only about 10KB, and in the youtube video you can see the scene reloading instantly. It reloads 3 or 4 times perfectly, then on the 5th time it loads the event fires from there previously loaded scene to move the platform back down.


Badger was helping yesterday and created this simple STE that duplicates the problem.
If you start the game, and watch the log, and then reset the game, you will see the posted events firing after the scene has been reloaded.

Download STE:


As far as I can tell this is a bug with shiva posted events when a scene is reloaded.

*Edit: killingfields, I have tested the application.flushAIEvents ( ) in multiple places (before the reload, after the reload, etc) and the error persists. Good thinking though!
Selzier
Platinum Boarder
Platinum Boarder
 
Posts: 523
Joined: 2011-01-26 00:02
Location: Boise

Re: Posted Event not Resetting with Scene Reload

Postby Selzier » 2014-08-24 19:49

Selzier
Platinum Boarder
Platinum Boarder
 
Posts: 523
Joined: 2011-01-26 00:02
Location: Boise

Re: Posted Event not Resetting with Scene Reload  [FIXED]

Postby NiCoX » 2014-08-27 11:47

Hi Selzier,

Just to tell we just fixed this at engine level.
User avatar
NiCoX
Administrator
Administrator
 
Posts: 5654
Joined: 2007-04-19 18:06
Location: France

Re: Posted Event not Resetting with Scene Reload

Postby Selzier » 2014-08-27 20:21

Great news NiCoX, Thanks everyone for the help on this! And now the moving platforms in my game are working correctly after reloading the level :)
Selzier
Platinum Boarder
Platinum Boarder
 
Posts: 523
Joined: 2011-01-26 00:02
Location: Boise


Return to Bugs

Who is online

Users browsing this forum: No registered users and 2 guests

cron