Aller au contenu

Photo

How can I make a creature speak some lines during combat?


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

#1
andysks

andysks
  • Members
  • 1 652 messages

As the title says. How can a creature go in blubbering mode while fighting? Stuff like "Now you'll see" and "Take this" :). I think a heartbeat can't do this right? Can a heartbeat of an ipoint do it maybe somehow?



#2
andysks

andysks
  • Members
  • 1 652 messages

Lilacs did it for me :). Case closed.



#3
Morbane

Morbane
  • Members
  • 1 883 messages

Lilacs did it for me :). Case closed.

 

...not very enlightening...

 

glad its sorted :)



#4
andysks

andysks
  • Members
  • 1 652 messages

It was a straightforward switch case script which had SpeakString on each case and went on the OnDamaged. I should have tried it before coming to ask for it. Thing is, every time I am not sure of how to do something I open lilacs but somehow I missed the When the PC performs a hostile action option :). Then I saw it and it worked.



#5
PJ156

PJ156
  • Members
  • 2 986 messages
Did you leave some blank nodes or is that one very verbose bad guy :D

PJ

#6
andysks

andysks
  • Members
  • 1 652 messages

Blank nodes :)? Don't need. Except if you meant blank cases, in which case... also not :D. The script worked with strings and the creature doesn't even have a dialogue. It is quite verbose I could say :D. He likes to talk more than he fights... which is why he dies I guess :D.



#7
kevL

kevL
  • Members
  • 4 070 messages

andy,
here's a simple way to achieve much-needed random intervals:

// ...
if (!Random(10))
{
    // ...
}


that gives a 10% chance per call
( Random(10) returns 0..9, and !NOT means only on a 0 )

#8
Vekin101

Vekin101
  • Members
  • 36 messages

I found this while browsing the vault the other night, might do what you want.

 

http://nwvault.ign.c...s.Detail&id=382



#9
Dann-J

Dann-J
  • Members
  • 3 161 messages

A non-random sequence of OnDamage barks could be interesting:

 

1. "You hit me! Now you'll get it..."

2. "You hit me AGAIN? How dare you!"

3. "I can't believe you keep doing that..."

 

And so forth.

 

It's a pity you can't determine from an OnPhysicallyAttacked or OnSpellCastAt event whether the attack caused damage or not. Otherwise you could have comments like "Ha! You missed me", "Try again loser", "Was that supposed to do something?", etc.



#10
kamal_

kamal_
  • Members
  • 5 258 messages

It's a pity you can't determine from an OnPhysicallyAttacked or OnSpellCastAt event whether the attack caused damage or not. Otherwise you could have comments like "Ha! You missed me", "Try again loser", "Was that supposed to do something?", etc.

You could do that.

If IsInCombat &DamageThisRound ==0



#11
PJ156

PJ156
  • Members
  • 2 986 messages

A non-random sequence of OnDamage barks could be interesting:
 
1. "You hit me! Now you'll get it..."
2. "You hit me AGAIN? How dare you!"
3. "I can't believe you keep doing that..."


You could do that by calling the npcs conversation when hit. If each is a bark and once only the npc would work their way through?

PJ

#12
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi,
 
I have this following excerpt of script in the creatures OnAttacked script, which I use to help determine if a creature suffered any damage from an attack (or not). Obviously, you need to "reset" any vars that may come as a result of healing, etc, but hopefully it's usage is apparent.

 

Lance.
 

Excerpt from script:-

int iDAMAGETODATE = GetLocalInt(OBJECT_SELF, "DAMAGETAKENTODATE");
	int iTOTALDAMAGE = GetTotalDamageDealt();
	int iTHISDAMAGE = iTOTALDAMAGE - iDAMAGETODATE;
	SetLocalInt(OBJECT_SELF, "DAMAGETAKENTODATE", iTOTALDAMAGE);
	int iMAXHPS = GetMaxHitPoints();