Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Sat Apr 20, 2024 7:27 am
All times are UTC + 0
How to destroy an object when an object is created
Moderators: Global Moderators
Post new topic   Reply to topic Page 1 of 1 [12 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Tetra Xiphos
Soldier


Joined: 05 Mar 2008

PostPosted: Mon Nov 02, 2009 10:59 am    Post subject:  How to destroy an object when an object is created Reply with quote  Mark this post and the followings unread

Is there a precedent in the game (schemas, xml, etc.) for destroying an object when another object is spawned/created (like at a factory)?

I have created a new super unit using the NOD's Avatar as a template. All was well until I decided that I didn't want it to spawn a husk. I was spawning the normal Avatar's husk but that seemed silly so I excluded the logic for that and found that when the avatar dies it just disappears. This is aesthetically unacceptable for obvious reasons.

First, I created a new unit for the husk, then following the trail from OCL, found out that when the avatar dies, it spawns the husk, which, when captured, in turn spawns the new avatar. I figured I could have my unit's husk go ahead and spawn, then somehow shorten the lifetime of the husk to 2 or 3 seconds (the amount of time it takes the die animation to complete). Unfortunately, I have been, thus far, unable to locate a way to adjust this parameter without affecting husks globally (husk lifetime is determined by an xml file in GlobalData). Maybe there are more individual husk parameters elsewhere that I've missed?

Of all the modules and tags for all the different events that happen or are possible in the game, I figure it is likely that a module exists that deals with the destruction of an object on the map when another object is created/present/spawned. Have any of you come across or remember from playing through the game of any such device?

Thanks in advance for any help!

_________________
"Whenever you find yourself on the side of the majority, its time to pause and reflect."

Back to top
View user's profile Send private message
Ju-Jin
Cyborg Firebomber


Joined: 23 Mar 2009
Location: Germany

PostPosted: Mon Nov 02, 2009 11:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Instead of setting the lifetime via the global define you can just enter a value like each other value.

_________________

Back to top
View user's profile Send private message Skype Account
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Mon Nov 02, 2009 11:52 am    Post subject: Reply with quote  Mark this post and the followings unread

or you could use the a normal slowdeath for your mech, so it would die and then slowly sink into the ground and disappear, like every other unit.

_________________

Back to top
View user's profile Send private message Skype Account
Tetra Xiphos
Soldier


Joined: 05 Mar 2008

PostPosted: Wed Nov 04, 2009 2:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

@ Ju-Jin
Entering a value to replace a global bit of data has been how I got this far!! lolzz. Seriously though, there is no parameter in the husk's xml to change. Its only a reference to ''GenericHuskLifetimes.xml''. Upon entering that xml, we find that there is still no module with data in it to change that could govern an individual unit's husk but it instead governs the lifetime of husks for ALL units that create them upon their death.

@Stygs
Slowdeath would entail that damage has been taken, right? Then I'd need a mechanism to somehow deal damage to a specific unit but only in the moments just after creation.... Am I making this more complicated than it should be? Smile

_________________
"Whenever you find yourself on the side of the majority, its time to pause and reflect."

Back to top
View user's profile Send private message
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Wed Nov 04, 2009 4:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Uh, only Juggernaut, Avatar und Tripod usw husk's, all other units just switch into the RUMBLE conditionstate and a removed using the slowdeath module, so you just could remove the husk for your mech and have him die like an normal unit. Of course, if a engineer should be albe to repair the husk, this solution would be useless :/


About the husk lifetime:

<xi:include
href="DATA:Includes/GenericHuskLifetimeUpdate.xml" />

refers to Includes\GenericHuskLifetimeUpdate.xml where you can find:

<LifetimeUpdate xmlns="uri:ea.com:eala:asset"
id="ModuleTag_HuskLifetime"
MinLifetime="300s"
MaxLifetime="300s"
/>

you could simple copy that code into your own husk and remove the xi:include part from it and it would be indepedant from the other husks lifetime.

_________________

Back to top
View user's profile Send private message Skype Account
Tetra Xiphos
Soldier


Joined: 05 Mar 2008

PostPosted: Wed Nov 04, 2009 7:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yea, I meant the three from each faction from 'ALL'. Smile

I tried copying the code into my unit's xml first. It was the most logical. I had no effect. I suppose I'll try again. Maybe I had some typos since I wasn't just copy/pasting.

Also, removing the unit's husk logic makes it simply disappear from the mapupon death. I was looking for something more pleasing to the eye... The death animation for the mech apparently begins with the creation of the husk. The animation logic in the husk (and so the husk) takes over after the mech is destroyed. The death animation (the husk falling to the ground) is played only once.

I think you're right, though. I should just have to copy it to my unit's xml and update the lifetime. I don't get it.

_________________
"Whenever you find yourself on the side of the majority, its time to pause and reflect."

Back to top
View user's profile Send private message
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Thu Nov 05, 2009 12:16 am    Post subject: Reply with quote  Mark this post and the followings unread

All mech have also a death animation in their code - ist just that they are removed from the world and raplaced with a husk as soon as they die, hence you only see the "husk" animation.

Heres a example how you would make the Nod Avatar die normal, without a husk:

Remove the CreateObjectDie and DestroyDie moduletags (ModuleTag_CreateObjectDie & ModuleTag_DestroyDie) from the Avatar to prevent it from disapearing and spawning a husk when dead.
Now simply add:

<SlowDeath
id="ModuleTag_Death"
SinkDelay="3s"
SinkRate="2.4"
DestructionDelay="16s">
<OCL
Type="INITIAL">
<OCL>NODAvatarDeathOCL</OCL>
</OCL>
<DieMuxData
DeathTypes="ALL" />
<Sound
Type="INITIAL"
List="NOD_Avatar_VoiceDie" />
</SlowDeath>

_________________

Back to top
View user's profile Send private message Skype Account
Tetra Xiphos
Soldier


Joined: 05 Mar 2008

PostPosted: Thu Nov 05, 2009 4:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

@ Stygs

I've figured it. I updated the husk's lifetime with a define modifier referenced from another xml. As far as the die animation, as I said the Avatar has no proper animation for death because it is removed from the map upon death and is replaced immediately with the husk and then, subsequently, the husk's opening animation which is the husk falling from the standing position to the ground. The same setup is found with the tripod and the juggernaught.

The OCL references the husk's animation and not the selectable avatar unit. Thanks for the help man...

_________________
"Whenever you find yourself on the side of the majority, its time to pause and reflect."

Back to top
View user's profile Send private message
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Thu Nov 05, 2009 7:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

I still dont understand what you want. Why have a husk if you want to kill it after some seconds anyway....

_________________

Back to top
View user's profile Send private message Skype Account
Tetra Xiphos
Soldier


Joined: 05 Mar 2008

PostPosted: Tue Nov 10, 2009 3:25 am    Post subject: Reply with quote  Mark this post and the followings unread

I simply wanted the Avatar to die without leaving a husk that can be captured by an engineer. Removing the husk code has the effect of causing the avatar to vansih after it is killed. Adding any death animation references is useless as the avatar unit has none, the husk does.

Anyways, I've figured it out, so thanks again.

_________________
"Whenever you find yourself on the side of the majority, its time to pause and reflect."

Back to top
View user's profile Send private message
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Tue Nov 10, 2009 9:20 am    Post subject: Reply with quote  Mark this post and the followings unread

The Avatar allready has a death anim build in (its basicly the same as the husk has), its just that its not triggered since the Avatar is replaced by the husk. You could simply remove the husk and a a slow death module to the avatar and he would play his death anim.

_________________

Back to top
View user's profile Send private message Skype Account
Tetra Xiphos
Soldier


Joined: 05 Mar 2008

PostPosted: Tue Nov 10, 2009 8:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

Its always possible I coded it wrong. Smile

I've found an alternative though, that iis preferable to the death animation I think. The husk sits there for fifteen seconds or so making it impossible to build another super unit until the husk dies.

I'm gonna give the death animation route another go just for curiosity sake.

You da man Stygs.

_________________
"Whenever you find yourself on the side of the majority, its time to pause and reflect."

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [12 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1710s ][ Queries: 11 (0.0083s) ][ Debug on ]