Hi, friends. I have two areas and my hero is located at area "A". When the hero is still in this area, I want to use a script to kill one of two different creatures located at area "B. I tried to use KillCreature("selected_creature "), but when the hero enters area B, the "selected creature is still alive. I should say that the creature properties, status, types, variables, etc are not important. The script should be able to kill the selected creature anyway. Any ideas? Tks a lot!
Killin a particular creature with scripting.
Débuté par
JR_ANGELO_BR
, sept. 23 2010 12:18
#1
Posté 23 septembre 2010 - 12:18
#3
Posté 23 septembre 2010 - 09:00
Perhaps create a plot flag that when set, kills all the creatures. Then you have to find a way to make them dead without all the dying animations and stuff, because it will look wierd if everyone fell when you arrived...your hero is not that badass.....or is he?
#4
Posté 23 septembre 2010 - 01:19
You obviously must be using something to decide which one to kill. Set that as a plot flag. In your area load script for area B, kill the creature corresponding to the plot flag that is set in the EVENT_TYPE_AREA_PRELOAD_EXIT event.
#5
Posté 23 septembre 2010 - 03:07
Isn't there a way to set the creature's state to dead, wouldn't a "kill" cause a death animations, which would look just wierd, seeing as the player character is arriving.
#6
Posté 23 septembre 2010 - 03:37
The player doesn't see what is happening in the PRELOAD_EXIT event. Those things happen when the Loading screen is still up.
#7
Posté 23 septembre 2010 - 09:21
I know it may sound strange, but you guys are right: my Hero is not this good. But belive me, this killing at another area list does fit the story well. I´ll try the plot idea and EVENT_TYPE_AREA_PRELOAD_EXIT. A friend of mine aldo told me to use the variable CREATURE_SPAW_DEAD. It is not important how the creature dies. The creature even does not have to die, but it has to be created as a PC Creature Group, but for some reaosns, they shold be unable to fight or help the Hero when some issues are not solved. Thanks again for your quick support.
#8
Posté 23 septembre 2010 - 10:38
Hi again. I thought about what you guys said about how weird it would be to enter an area and find a dead creature. So I decided to change the story. If the hero does his job right, he will enter an area with an enemy and will also find some creature that will help him to fight the enemy. If he does not, both creature will be hostile and the hero will have to deal with both of them. I create the creature as a PC Creature and I used the following script to change the creature hostility:
object oCreature = GetObjectByTag("hostile_nonhostile_creature");
object oHero = GetHero();
SetGroupId(oCreature,101);
UT_CombatStart(oCreature, oHero);
Thanks again.
object oCreature = GetObjectByTag("hostile_nonhostile_creature");
object oHero = GetHero();
SetGroupId(oCreature,101);
UT_CombatStart(oCreature, oHero);
Thanks again.





Retour en haut







