nicked on 11/7/2014 at 07:03
OK, bit of a strange one. I want an AI to trigger an objective when killed. But, the AI only appears when another AI is killed:
* AI 1 --Corpse--> AI 2
* AI 2 --ControlDevice--> QVarTrap
* AI2 has TrigSlain.
This setup doesn't work because corpse links make a new instance of the AI rather than using the concrete object. TrigSlain doesn't seem to work on archetypes. Using a standard Kill objective also seems to not work on archetypes.
I can get it to work, sort of, using a TeleportTrap:
* AI 1 --ControlDevice--> TeleportTrap
* AI 1 has TrigSlain
* TeleportTrap --ControlDevice--> AI 2
* AI 2 --ControlDevice --> QVarTrap
* AI2 has TrigSlain.
That works a treat, except that the second AI appears at the stationary TeleportTrap, rather than at the corpse point of the first AI.
So... can I either a) do something to the first setup to make TrigSlain work on a corpsed AI?
or b) Find some way to teleport the second AI to wherever the first AI died?
R Soul on 11/7/2014 at 15:09
Quote Posted by nicked
This setup doesn't work because corpse links make a new instance of the AI rather than using the
concrete object.
"Abstract" object, though I prefer the word archetype. A concrete object and an instance are the same thing.
Try creating a corpse link from AI 1 to the instance of AI 2. If that doesn't work, you can go back to corpse linking to the archetype and using NVRelayTrap. Design note: NVRelayTrapOn="Slain"; NVRelayTrapDest="Name-of-new-goal-qvar"
edit after a few replies: That should be NVRelayTrap
TDest
Yandros on 11/7/2014 at 16:04
Yeah, you should be able to create the AI2 and Corpse link to it, with the TrigSlain script already intact on him.
nicked on 11/7/2014 at 17:52
Sorry, I may have worded that strangely, but I did mean the concrete AI 2 placed in the world - the corpse link doesn't use that specific AI object, it creates a new one from the archetype.
I will try NVRelayTrap, thanks! :)
Edit: Hmm, NVRelayTrap didn't work, because I still need a ControlDevice link from the second AI to the QuestVarTrap, and that only works if it's a concrete object.
Yandros on 11/7/2014 at 19:19
Are you sure? I thought if you Corpse-link to a concrete AI, it will use that exact one. If not, what you could do is use S&R to teleport the concrete AI2 to AI1 when AI1 dies, and Corpse-link AI1 to the Marker archetype so it vanishes.
Edit: Also, you don't need a CD link for NVRelayTrap, you can specify NVRelayTrapTDest in the design note and set it to the name of the QVTrap. That should also work.
nicked on 11/7/2014 at 20:38
Ah, spotted it - copy paste error. I had NVRelayTrapDest instead of NVRelayTrapTDest. Added the T, and it works now. Corpse-linking to a concrete object just seemed to make a new one. Not sure if I did it wrong.
Anyway, the working setup, pretty much as R Soul said, for anyone else's future reference, is as follows:
AI1 (concrete) --Corpse--> AI2 (Archetype)
AI2 (archetype):
* S>Scripts: NVRelayTrap
* Editor>Design Note: NVRelayTrapOn="Slain"; NVRelayTrapTDest="MyQuestVarTrap"
QuestVarTrap:
Name: MyQuestVarTrap
Trap > Quest Var: =1:goal_state_x (where x is the goal number)
And obviously make sure NVScript is loaded...
R Soul on 11/7/2014 at 21:00
Quote Posted by nicked
Ah, spotted it - copy paste error. I had NVRelayTrapDest instead of NVRelayTrap
TDest.
That wasn't a copy paste error. I missed out the important T. Luckily for me you're not the Nick... who does the spell checking around here otherwise I'd be in big trouble.
john9818a on 14/7/2014 at 04:34
Quote Posted by nicked
I can get it to work, sort of, using a TeleportTrap:
* AI 1 --ControlDevice--> TeleportTrap
* AI 1 has TrigSlain
* TeleportTrap --ControlDevice--> AI 2
* AI 2 --ControlDevice --> QVarTrap
* AI2 has TrigSlain.
That works a treat, except that the second AI appears at the stationary TeleportTrap, rather than at the corpse point of the first AI.
So... can I either a) do something to the first setup to make TrigSlain work on a corpsed AI?
or b) Find some way to teleport the second AI to wherever the first AI died?
I have used the teleport method but I had to CreatureAttach the Teleport Trap to the AI 1 using the Butt as the location. This ensure that the Teleport Trap stayed with AI 1 no matter where it died.