Adding/removing objects - any caveats?
by D B · in Torque Game Engine · 04/05/2006 (4:27 pm) · 2 replies
Hi, I was wondering what to keep in mind when adding or removing of objects fairly often.
To give some examples of what I'm getting at, I am making an RPG (along the lines of most console RPGs), and I have a few things in mind:
1. Adding in special effects that play once: For example, if I add in an explosion effect for a battle (which will be called by script), and then remove it, is there anything else I should do for cleanup purposes?
I have looked through the forums at the MissionCleanup, but I am still somewhat confused about it, and I'm not sure if it would be used for this or not.
2. When it comes to crossing pits, I was thinking of having invisible barriers over pits (as the RPG does not have jumping as an available action), but when a scripted event allows the player to jump it by facing it and clicking on it, I wanted to remove the barrier, have the character jump, and then add it in again when the player finishes their jump. Since the player can access this jump event as much as they want by repeatedly going over and clicking on the pit, I was wondering if there would be any problems with this constant adding and removing of objects?
The two examples above would need a lot of adding and removing, and I am concerned as to whether or not I should watch out for any stray data that might pile up, and cause slowdown, or worse, freezing and crashing. Is there anything else I should watch out for?
Thank you.
To give some examples of what I'm getting at, I am making an RPG (along the lines of most console RPGs), and I have a few things in mind:
1. Adding in special effects that play once: For example, if I add in an explosion effect for a battle (which will be called by script), and then remove it, is there anything else I should do for cleanup purposes?
I have looked through the forums at the MissionCleanup, but I am still somewhat confused about it, and I'm not sure if it would be used for this or not.
2. When it comes to crossing pits, I was thinking of having invisible barriers over pits (as the RPG does not have jumping as an available action), but when a scripted event allows the player to jump it by facing it and clicking on it, I wanted to remove the barrier, have the character jump, and then add it in again when the player finishes their jump. Since the player can access this jump event as much as they want by repeatedly going over and clicking on the pit, I was wondering if there would be any problems with this constant adding and removing of objects?
The two examples above would need a lot of adding and removing, and I am concerned as to whether or not I should watch out for any stray data that might pile up, and cause slowdown, or worse, freezing and crashing. Is there anything else I should watch out for?
Thank you.
About the author
#2
As far as particles.. the particle handler is pretty simple.. it can handle your effects without difficulty.. just by turning them off and on as needed.
As far as your barriers.. a clickable trigger box might work.. you might even consider using a teleport style movement and maybe animate a jump... or imply increase the player classes jump distance.. or even better... activate a force area to launch to player over the pit when certain conditions are met (ie. clicked the trigger).
None of this should cause TGE any problems.
06/15/2006 (3:44 am)
Danny,As far as particles.. the particle handler is pretty simple.. it can handle your effects without difficulty.. just by turning them off and on as needed.
As far as your barriers.. a clickable trigger box might work.. you might even consider using a teleport style movement and maybe animate a jump... or imply increase the player classes jump distance.. or even better... activate a force area to launch to player over the pit when certain conditions are met (ie. clicked the trigger).
None of this should cause TGE any problems.
Torque Owner D B