Jump to content

Home

Stunning an NPC via Script


Fallen Guardian

Recommended Posts

It would look something like this:

 

ApplyEffectToObject(2, EffectStunned(), oTarget, 0.0);

 

To unstun them:

 

AssignCommand(oTarget, ClearAllEffects());

 

I don't know if this would work in cutscenes; there appears to be another function in the code, but there is a lot of stuff that either doesn't work or is redundant in the code, so that might not mean anything.

Link to comment
Share on other sites

Hmm... I think the easiest thing would be to set a local boolean at the same time you trigger the stun. It would go something like:

 

SetLocalBoolean(oTarget, 21, TRUE);

 

21 is the boolean number - anything between 20 and 63 should be safe.

 

And then for the script to check whether all of of the NPCs have been stunned, something like:

 

if(
GetLocalBoolean(oTarget1, 21) &&
GetLocalBoolean(oTarget2, 21) &&
GetLocalBoolean(oTarget3, 21) &&
GetLocalBoolean(oTarget4, 21) &&
GetLocalBoolean(oTarget5, 21)	) {
return TRUE;
}

else	return FALSE;

 

There's probably a more elegant way to do it, but that should get the job done. And of course if you wanted to be able to do this more than once, you'd have to set all the booleans back to false afterwards.

Link to comment
Share on other sites

I'm afraid I don't know much about scripting, but I've been curious about this. Does anybody know where to find the stun scripts used when you are in combat? So the on-hit properties?

 

Mainly, is there a way to modify or make new on-hit effects?

 

Thanks,

Ӄhrizby

Link to comment
Share on other sites

I'm not sure... I think that stuff is hard coded. But it might be possible to do what you want with a heartbeat script; the only catch is it would only affect whatever NPCs you apply it to - unless you modify the generic heartbeat script, but of course that's risky. Not saying it's impossible... but the engine is very sensitive.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...