Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

K1 script - kneeling spawn

Page: 1 of 1
 Doctor-Hal
01-17-2011, 3:40 PM
#1
Hello my fine modding friends, I have a quick question for those of you who have mastered the difficulties of the ScriptingVerse.

I am attempting to spawn two creatures with one script. One of them has a conversation option that will always end in combat (to the death) and the other needs to spawn kneeling.

The kneeling creature should kneel through the battle and only stand once the enemy is defeated at which point the normal dialogue options should open up.

Any ideas?
 TimBob12
01-17-2011, 4:15 PM
#2
You would probably have to define an animation for it (don't ask me I have no idea) but have a look in animations.2da see whats there. Ill take a look as well.
 Marius Fett
01-17-2011, 4:43 PM
#3
void main() {
AssignCommand(GetObjectByTag("my_npc_tag"), ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, -1.0));
}


Try that. Attatch it to the NPC's OnSpawn event, :)

Also, bear in mind that I suck at scripting, so you may have to tinker with it a bit.
 Qui-Gon Glenn
01-18-2011, 11:07 AM
#4
^^^ that will work, i think, more or less... Depending on how you are spawning in the creature, you may just want to put it in the area OnEnter... depends on how much module editing you want to do.

What will need to be attached is something that is checking for the death event of the fighting NPC. When that NPC dies, your kneeling creature needs to know, so you would alter the OnDeath of NPC1 to send a message to NPC2, or just set a boolean var that you can check in the kneeling NPC's OnSpawn.

The conditional would be... "if NPC1 is dead then the kneeler needs to get up and initiate convo."

If you need help working that out, I'll be around today off and on
 Doctor-Hal
01-21-2011, 1:37 AM
#5
Sorry I'm going to be away for long stretches the next few weeks....

I could probably attach the script that has the kneeling character stand on the "on death" setting of the enemy character.... So far I've been spawning via a .dlg file, though I could use the onEnter for the module instead without much trouble.

@Marius Fett: Much thanks! I'll try that now...
Page: 1 of 1