Hey guys!
Just for fun I was playing around with my HQ mode a little and encountered a problem.
...But let's start from the beginning:
In HQ mode you have a couple of objects which need to be destroyed in order to make the HQ vulnerable. Once you kill the HQ you win the game.
Now, I want players to give the opportunity to repair these vital objects in case they were destroyed by the enemy. That's working so far.
But: I don't want the player to repair this object as soon as it gets destroyed and therefore I'd like the object to disappear for about a minute. How can I achieve this?
(KillObject doesn't work as it only sets the objects energy to zero.)
Thanks in advance.
~Locutus
Making object disappear?
Moderator: Moderators
- Locutus
- 1st Lieutenant

- Posts: 420
- Joined: Fri Jun 04, 2010 10:08 am
- Projects :: Stargate Battlefront Pegasus
- Location: Germany
- Contact:
- yuke5
- Field Commander

- Posts: 945
- Joined: Wed Jun 29, 2011 10:42 pm
- xbox live or psn: My steam is yuke5.
- Location: Vermont
Re: Making object disappear?
You can kill the object, and then set the total object health to a ridiculously high number, so if the player tries to repair the object, it's useless because it would take hours to repair completely. You can find an example of this in the Geonosis Campaign Script, where the health and ammo droids are destroyed, but the player shouldn't be able to repair them until it becomes an objective.
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Making object disappear?
Infinite MaxHealth is represented by the value 1e+37, by the way. Also, in addition to what Yuke suggested, after the object is destroyed use SetProperty on the object to set AINoRepair to 1. At the same time create your one minute timer, and after it is up reset AINoRepair to 0. This will keep the AI from even attempting to fix the infinitely unhealthy object.
- Locutus
- 1st Lieutenant

- Posts: 420
- Joined: Fri Jun 04, 2010 10:08 am
- Projects :: Stargate Battlefront Pegasus
- Location: Germany
- Contact:
Re: Making object disappear?
Thanks for your quick replies.
Yeh, I'm using the infinite health thingy to make the HQs invulnerable unless all of the objects (in fact, these objects are cps) are destroyed.
Problem with this method is that you cannot be sure when the timer has elapsed, ie when you can start to repair the object. Is there any method to make that visible like swapping the meshes or sth.?
Yeh, I'm using the infinite health thingy to make the HQs invulnerable unless all of the objects (in fact, these objects are cps) are destroyed.
Problem with this method is that you cannot be sure when the timer has elapsed, ie when you can start to repair the object. Is there any method to make that visible like swapping the meshes or sth.?
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Making object disappear?
Ah, I see. Well, you can use SetProperty with IsVisible set to 0 after the object is destroyed, and then once the timer is up reset it to 1. To swap the models, one method is to place two models in the same position and make one visible and the other invisible and vice versa.
- Locutus
- 1st Lieutenant

- Posts: 420
- Joined: Fri Jun 04, 2010 10:08 am
- Projects :: Stargate Battlefront Pegasus
- Location: Germany
- Contact:
Re: Making object disappear?
It works, thank you AQT! 
Mhh, is there any way to remove collision from the object while being invisible?
Another thing that bothers me are the timers mentioned before.
Is there a possibility to move the position of the timer on screen when using ShowTimer()?
I'd really like to have one for each team.
Mhh, is there any way to remove collision from the object while being invisible?
Another thing that bothers me are the timers mentioned before.
Is there a possibility to move the position of the timer on screen when using ShowTimer()?
I'd really like to have one for each team.
