It is currently Sat May 18, 2013 10:53 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Re: Trigger animation on destruction of object?
PostPosted: Thu Jan 03, 2008 6:46 pm 
Offline
Jedi Admin
Jedi Admin
User avatar

Joined: Mon Aug 21, 2006 11:03 pm
Posts: 6894
Code:
animateobja = OnObjectKill(
   function(object, killer)
      if GetEntityName(object) == "objectBnameinZeroEditor" then
         PlayAnimation("whateveranimationgroup")
      end
   end
)


Edit: And here's that part about giving points when you kill an object:

Code:
killobjc = OnObjectKill(
   function(object, killer)
      if killer and IsCharacterHuman(killer) and GetEntityName(object) == "objectbeingkillednameinZeroEditor" then
         AddAssaultDestroyPoints(killer)
      end
   end
)


That first part ("killobjc") is the variable name assigned to this event. It can be whatever (unrelated) name you want, so long as you don't use the same name for another event or variable. The line "if...etc." is the conditional statement for giving points. "if killer" is checking to see whether the killer exists. Always add this before you add the line IsCharacterHuman(killer), to prevent crashes if a human kills themselves. "IsCharacterHuman(killer)" checks to see whether the killer was human. This way only humans will recieve points for killing the object. Remove this if you want. The last part of the if statement checks to make sure that the object-being-killed's "name" matches the name you assigned in ZE. This is not the name of the .odf, but the name you assigned in ZE. Sometimes they are the same but not always.


Top
 Profile  
 
 Post subject: Re: Trigger animation on destruction of object? (FAQ)
PostPosted: Wed Sep 15, 2010 6:40 pm 
Offline
Master Sergeant
User avatar

Joined: Wed Jun 23, 2010 8:25 pm
Posts: 172
Location: Staring at a screen 10 hours a day
sorry for the bumb but how would you rewind a animation when you fix an object


Top
 Profile  
 
 Post subject: Re: Trigger animation on destruction of object? (FAQ)
PostPosted: Thu Sep 16, 2010 1:51 pm 
Offline
Master of the Force
Master of the Force
User avatar

Joined: Wed Sep 27, 2006 11:05 am
Posts: 6022
Location: Duckburg, Germany
Projects :: RAS Prosecutor
my guess:
Code:
repairobja = OnObjectRepair(
   function(object, repairer/characterId?!)
      if GetEntityName(object) == "objectBnameinZeroEditor" then
         RespawnObject("reappearingobject")
         RewindAnimation("whateveranimationgroup")
      end
   end
)


Last edited by DarthD.U.C.K. on Sun Sep 19, 2010 5:40 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Trigger animation on destruction of object? (FAQ)
PostPosted: Sat Sep 18, 2010 11:28 pm 
Offline
Master Sergeant
User avatar

Joined: Wed Jun 23, 2010 8:25 pm
Posts: 172
Location: Staring at a screen 10 hours a day
wouldn't it be
repairobja = OnObjectRepair(
function(object, repairer/characterId?!)
if GetEntityName(object) == "objectBnameinZeroEditor" then
RespawnObject("reappearingobject")
RewindAnimation("whateveranimationgroup")
end
end
)


Top
 Profile  
 
 Post subject: Re: Trigger animation on destruction of object? (FAQ)
PostPosted: Sun Sep 19, 2010 5:39 am 
Offline
Master of the Force
Master of the Force
User avatar

Joined: Wed Sep 27, 2006 11:05 am
Posts: 6022
Location: Duckburg, Germany
Projects :: RAS Prosecutor
yeah, you are right. i changed the code, thanks


Top
 Profile  
 
 Post subject: Re: Trigger animation on destruction of object? (FAQ)
PostPosted: Wed Oct 13, 2010 4:46 pm 
Offline
Master Sergeant
User avatar

Joined: Wed Jun 23, 2010 8:25 pm
Posts: 172
Location: Staring at a screen 10 hours a day
just to check is objectBnameinZeroEditor the object you repair and is
reappearingobject the object with the animation?


Top
 Profile  
 
 Post subject: Re: Trigger animation on destruction of object? (FAQ)
PostPosted: Wed Oct 13, 2010 4:47 pm 
Offline
Master of the Force
Master of the Force
User avatar

Joined: Wed Sep 27, 2006 11:05 am
Posts: 6022
Location: Duckburg, Germany
Projects :: RAS Prosecutor
its the object you repair


Top
 Profile  
 
 Post subject: Re: Trigger animation on destruction of object? (FAQ)
PostPosted: Tue Mar 01, 2011 6:41 pm 
Offline
Master Sergeant
User avatar

Joined: Wed Jun 23, 2010 8:25 pm
Posts: 172
Location: Staring at a screen 10 hours a day
Sorry for the bump, but where and what file do I put this in.
(I got it working once, but I deleted that map, so I can't look through source files)


Top
 Profile  
 
 Post subject: Re: Trigger animation on destruction of object? (FAQ)
PostPosted: Wed Mar 02, 2011 3:47 am 
Offline
Gametoast Staff
Gametoast Staff
User avatar

Joined: Sat Nov 03, 2007 4:55 pm
Posts: 4157
Location: SoCal, USA
In the game mode LUA file after
Code:
function ScriptPostLoad()

but before
Code:
function ScriptInit()


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Guitarpat94 and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


StarWars Gametoast Forum Style by Penguin, © 2011