antstubell Posted October 14, 2020 Share Posted October 14, 2020 (edited) In a previous thread I asked how to get a NPC to drop a torch - got that sorted out. Now I need the dropped torch to ignite the oil pools he is standing in. I've considered traps but don't want the visual of a trap being set off. Player has no access to magic, neither do NPCs in my mod, so no spells allowed. Ideally the dropped torch would be the ignition source.Help and advice appreciated. Edited October 14, 2020 by antstubell Link to comment Share on other sites More sharing options...
maxarturo Posted October 14, 2020 Share Posted October 14, 2020 (edited) - Create a trigger box with 'Trigger' type layer, to cover all the space you need to have the torch triggering the fire, the trigger box should be low in height, i think this is obvious... - In the trigger box add a simple script. Example: Light Property MyTorch Auto ObjectReference Property MyOilPool Auto EVENT OnTrigger(ObjectReference akActionRef) If ( akActionRef == MyTorch as ObjectReference ) GoToState("AllDone") MyOilPool.Activate(Self) ; Or whatever else you intend on doing to start the fire EndIf ENDEVENT STATE AllDone ; ENDSTATE The 'State AllDone' must be called immediately because the "OnTrigger" event will fire multiple times once the object is inside the trigger box. Good night. Edited October 15, 2020 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted October 15, 2020 Author Share Posted October 15, 2020 The final line EndEvent should be EndState or script errors. When changing final line to EndState get error -cannot compare a objectreference to a light (cast missing or types unrelated) Link to comment Share on other sites More sharing options...
maxarturo Posted October 15, 2020 Share Posted October 15, 2020 Yeah, stupid typo... it was just an example script which i wrote just before hitting the bed... Link to comment Share on other sites More sharing options...
antstubell Posted October 15, 2020 Author Share Posted October 15, 2020 As said, script still won't compile.cannot compare a objectreference to a light (cast missing or types unrelated) Link to comment Share on other sites More sharing options...
maxarturo Posted October 15, 2020 Share Posted October 15, 2020 Try it now. Link to comment Share on other sites More sharing options...
antstubell Posted October 16, 2020 Author Share Posted October 16, 2020 Nope. cannot cast a light to a objectreference, types are incompatible Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 16, 2020 Share Posted October 16, 2020 I got this to compile but I have no idea if it will actually work... Scriptname AAA_SomeScript Extends ObjectReference Light Property MyTorch Auto ObjectReference Property MyOilPool Auto EVENT OnTrigger(ObjectReference akActionRef) If ( akActionRef as Form == MyTorch as Form ) GoToState("AllDone") MyOilPool.Activate(Self) ; Or whatever else you intend on doing to start the fire EndIf ENDEVENT STATE AllDone ; ENDSTATE Link to comment Share on other sites More sharing options...
antstubell Posted October 16, 2020 Author Share Posted October 16, 2020 Ishara - Yes compiles but unfortunately nothing happens. Light Property MyTorch AutoObjectReference Property MyOilPool AutoEVENT OnTrigger(ObjectReference akActionRef)If ( akActionRef as Form == MyTorch as Form )GoToState("AllDone")MyOilPool.Activate(Self)debug.notification("Whoosh!"); Or whatever else you intend on doing to start the fireEndIfENDEVENTSTATE AllDone;ENDSTATE I've tried every type of Collision Layer for the primitive but no success. Link to comment Share on other sites More sharing options...
dylbill Posted October 16, 2020 Share Posted October 16, 2020 Try this instead: Light Property MyTorch Auto ObjectReference Property MyOilPool Auto EVENT OnTrigger(ObjectReference akActionRef) Form Base = akActionRef.GetBaseObject() If Base as Light If Base == MyTorch GoToState("AllDone") MyOilPool.Activate(Self) debug.notification("Whoosh!") ; Or whatever else you intend on doing to start the fire Endif EndIf ENDEVENT STATE AllDone ; ENDSTATE Link to comment Share on other sites More sharing options...
Recommended Posts