Aller au contenu

Photo

Killin a particular creature with scripting.


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
JR_ANGELO_BR

JR_ANGELO_BR
  • Members
  • 35 messages
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!

#2
Challseus

Challseus
  • Members
  • 1 032 messages
Are the areas linked together in the same area list? If not, you may not be able to reference those creatures in the other area.

Modifié par Challseus, 23 septembre 2010 - 06:39 .


#3
0x30A88

0x30A88
  • Members
  • 1 081 messages
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
TimelordDC

TimelordDC
  • Members
  • 923 messages
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
0x30A88

0x30A88
  • Members
  • 1 081 messages
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
TimelordDC

TimelordDC
  • Members
  • 923 messages
The player doesn't see what is happening in the PRELOAD_EXIT event. Those things happen when the Loading screen is still up.

#7
JR_ANGELO_BR

JR_ANGELO_BR
  • Members
  • 35 messages
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
JR_ANGELO_BR

JR_ANGELO_BR
  • Members
  • 35 messages
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.