LarryG on 7/6/2013 at 00:34
I would be interested in your explanation. I did something with NVScripts for my Fireshadows in Finals at the Academy, and would like to learn about how to accomplish this with just the gen scripts.
sNeaksieGarrett on 7/6/2013 at 16:35
I'll take a look at your demo and get back to you, thanks.
Yeah, the multiplayer patch is based on v1.18. No worries though, I have both NewDark and 1.18 installed on my machine.;)
Update:
It's great! That will work just fine R Soul. Yeah, I guess for the benefit of both Larry and I you can go ahead and explain it here if you don't mind.
R Soul on 7/6/2013 at 22:08
This is from scratch, i.e. none of DarkArrow's instructions have been implemented:
Create a new stim called RespawnStim
When an AI is knocked out or killed, it gets the metaproperty* ARSources > NoPingBack. Edit this and add a source:
RespawnStim
Propagator: Radius
Edit shape: deselect 'Line of sight' (it may not matter but but I did it anyway).
Intensity: 1
Now, any death/KO will make the AI generate a RespawnStim over the default radius of 1 foot.That's the generic bit. The next steps have to be done for each AI that is to respawn.
Create a new quest variable:
quest_create_mis CountGuard1, 0
(the name is just an example)Give a button a CD link to a marker.
Give the marker the script TrapTimedRelay (hopefully T2 MP is compatible with the fixed gen.osm). Script > Timing:
6000Select the AI's archetype and create a child archetype. Use the Does Patrol property if the AI should patrol.
Add the property Tweq > Delete. Set the rate to
5000For the AnimC flags, select Sim.
The 'rate' is the time after which the body is deleted. The TrapTimedRelay creates the replacement AI, so this value should be larger, otherwise the replacement might see his predecessor's body.Add a receptron for RespawnStim:
No Min, No Max
Effect: StimulateObject
TargetObject: the button you created (name or ID is acceptable in this field)
Agent Object: Me (this probably doesn't matter but I don't like using the None (0) value)
Edit Effect:
Stim: RespawnStim
Multiply by 1
Add 0
Edit the button:
Give it 3 RespawnStim receptrons. Intensities: No Min, No Max:
1) Frob Object( Target: Me
2) Tweq Control (Target: Source, Edit effect: Type: TweqDelete, Action: DoActivate)
3) Set Quest Variable (Edit effect: quest var: CountGuard1, Operation: Add, Operand: 1)
So, the AI dies, and it's NoPingBack metaproperty generates a RespawnStim. The AI responds by stimming the button. The button responds by frobbing itself (which activates the TrapTimedRelay marker, activating the AI's Tweq > Delete state, and adding 1 to the qvar that counts the number of respawns.Create an EmitterTrap. Add the Tweq > Emit property and change broadhead to the name of the new AI archetype.
Add the script ReloadTweqEmit in the top field, and leave Don't inherit unchecked.
I often have to look up the (http://www.thiefmissions.com/telliamed/scripts.html#reloadtweqemit) explanation of that script because I tend to forget exactly what it does.Give the timer marker a CD link to the EmitterTrap.
Now the button will create the AI's replacement.The last thing is to stop everything after X respawns. I'll limit them to 5 for this tutorial.
Create a QuestVarTrigger. Quest Var property: =5:CountGuard1
Give it a CD link to a DestroyTrap
Give the DestoryTrap a CD link to the button.
As well as preventing any new AI being created, destroying the button also prevents the final AI's body being deleted.*Firefox's spellchecker suggested 'impropriety'
LarryG on 7/6/2013 at 22:57
So this will respawn KO'd AIs as well as killed AI's? Is there any way to limit to killed?
R Soul on 7/6/2013 at 23:47
Possibly. I set game_mode_backup to 0 to see what was common to both death and KOs, which turned out to be NoPingBack.
A dead AI has no other metaprops, but a KO'd one also has M-KnockedOut and M-WasKnockedOut. The latter is empty. You could give it a purpose by adding a Receptron for RespawnStim that uses the Abort effect.
Timing will be the issue. From the order of the metaprops, it looks like NoPingBack is added last, so the Abort effect should be in place before the stim is generated.
sNeaksieGarrett on 8/6/2013 at 00:12
Thank you R Soul, I got it set up. Now I just need to test this in multiplayer. I hope it works.
UPDATE:
YES! I got it to work in MP. Wahoo! \o/ I was going to abandon this mission, but then I had thought about trying a spawn setup without NVScript and finally got around to it so it means I can finally finish the mission. Thanks again R Soul.
sNeaksieGarrett on 8/6/2013 at 15:22
I have a new problem. I set it up for the zombie archetype, but they don't have NoPingBack by default.
I added it to the RSZombie, but upon testing the mission the zombie disappears almost immediately and then reappears at the spawn point. In other words, I don't even have to kill him, it just automatically removes the zombie before I even have a chance!:eek:
LarryG on 8/6/2013 at 17:30
If you don't mind making your AIs immune to heat, you could use the DoFlameSource script and reverse the way the stims work. That is, make it a DontRespawnStim, and when the stimming stops, do the respawning.
Another approach might be to have a TrigSlain script (Sends TurnOn to ControlDevice linked objects when the object receives Slain.) on each AI type Archetype with a CD link to the appropriate AI emitter. I think that CD links are created along with emitted objects, so that should work. Or ... maybe a pseudoscript on the AI archetype to send a TurnOn to the emitter ... ?
sNeaksieGarrett on 8/6/2013 at 19:24
Hmm, TrigSlain may work. I'll have to try that. I've actually used that already for a different AI who doesn't respawn and when he dies he triggers a door to open.
Edit: I managed to get TrigSlain to work, but only after I created a fresh zombie and adding the CD link manually. I tried putting a CD link to the emittertrap from the zombie archetype but that didn't work. (Also, I'm not sure I follow you on your last sentence about pseudoscript...)
R Soul on 8/6/2013 at 20:27
When a zombie is knocked down, it gets the M-ZombiePossum meteprop, so you could put the source in there. For death, you could add the source to the ZomTorso archetype. All body parts will need a delete tweq, but I think some parts already have it (originally so that undead missions didn't exceed the in-game object count).