antstubell Posted May 28, 2019 Share Posted May 28, 2019 Hi all,Can somebody help me with the properties of a fire trap? First thing I want to do is have the fire trap cause such an explosion that no matter what lvl player is - it means you're dead. The explosion will be caused by oil barrels so I need the barrels to disapear as soon as the explosion occurs. Finally, I think for now, the player will have nothing in his/her inventory but a torch (no spells), so I want the explosion to only happen if the player has a torch equipped - not if the player unequips the torch, walks over the trap and then when at a safe distance player can equip torch again.Thanks for any help. Link to comment Share on other sites More sharing options...
maxarturo Posted May 28, 2019 Share Posted May 28, 2019 (edited) What you are trying to do here can only be achieved with a custom made script that will handle everything "OnTriggerEnter". I don't think that there is a default vanilla script that can do what you ask. Right now i can't provide more assistance (i'm using my tablet), if no one else reply to you post before i get home (if i go home today...), i'll post you such a script. //...............................*...............................// Just for clarification. Where do you want the explosion to appear. - In the player, actorRef. - In the oil barrels. - In the center of the triggerbox. * You need to create a "triggerbox" that will act as an area of influence and add the script to it, that will fire only when the player is inside - enters it. A box surrounding the place that this event will occur. Do you want the explosion to kill the player even if he is using TGM ? or not ? (god mode). Will there be a delay before the explosion occurs (delay in seconds), or it will explode immediately as soon as the player enters the "triggerbox" ?. Will a "fireFX" be placed in the oil barrels position after the explosion ? or not ? just explosion. Adding a fireFX will only make sense if you allow the player to use TGM, otherwise he won't be able to see it, cause he'll be dead. After the explosion will - can this event happen again in this exact place - position, or will be a "fire only once" even ?. Edited May 28, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted May 28, 2019 Author Share Posted May 28, 2019 Wow, you sound knowledgable on this topic. This is the scene I have set up for now, probably won't change. The idea of this area of the mod is that torches are real important, still need to figure out a relight torch thing but anyway. Player approaches 'corridoored' way, through an arch to be exact. There are 3 oil barrels. 1 is closed (static), 1 is open - this will need to be used (activated (it is an activator)) later because player needs oil to continue on their journey/solve a puzzle and 1 has tipped and spilt its contents, oil can be seen on the floor this is where the fire trap is. If the player has a torch equipped (not important if one is in inventory) and walks over the fire trap there will be, as you asked about the delay, a WHOOSH of fire around the player (courtesy of fire traps) then BANG an explosion that occurs on the barrel(s), the full or open one and blinds the player and... dead. Player is teleported back to cell beginning (it's not that far). As for TGM - I don't know - I'd like to hear your opinion. Fire once? Would this be a learnt not what to do action or 'shoot glad that's over'. I prefer the learnt what not to do so trap will be reset. Link to comment Share on other sites More sharing options...
maxarturo Posted May 29, 2019 Share Posted May 29, 2019 (edited) I didn't compile it or tested it, i'm still nowhere near my PC and i might need to stay here for a few more days, but it's a simple script that should be working just fine.(i made this script during my lunch break in my tablet, if any other scripter near a PC can take a quick look at it...) import sound Actor Property PlayerREF Auto {Assign Actor - Player Ref} explosion property MyOilExplosion auto {The explosion visual FX that will play} ObjectReference property OilPoolRef auto {Link Ref the Oil Pool} ObjectReference property xMarkerExplosion auto {The xMarker where the explosion will be placed - explosion position} ObjectReference Property xMarkerBarrels01 Auto {The xMarker that will be handling the disable state of the barrels} Sound Property OilExplosionSoundFX01 Auto {The explosion sound FX that will play when the explosion occurs} int instanceID ;used to store sound ref auto state waiting Event OnTriggerEnter(ObjectReference akActionRef) if akActionRef == PlayerRef if (PlayerRef.GetEquippedItemType(0) == 11) if (PlayerRef.GetEquippedItemType(1) == 11) OilPoolRef.setActorCause(akActionRef as actor) Utility.wait(2.0) xMarkerExplosion.placeAtMe(MyOilExplosion) instanceID = OilExplosionSoundFX01. Play(PlayerRef) xMarkerBarrels01.disable() Utility.wait(1.5) PlayerREF.Kill() GoToState("Done") else ; Do nothing endif endif endif ENDEVENT ENDSTATE EVENT onTriggerLeave(ObjectReference akActionRef) if akActionRef == PlayerRef ; Do nothing endif ENDEVENT What this script is supposed to do is:1) Uppon entering the trigger box will check if the Player is holding a torch, will check "Right and Left" hand.2) If he is holding a torch will activate the oil pool.3) Then there will be a 2 sec delay before the explosin occurs.4) Will disable the static oil barrels while the explosion is happening. All at once.5) 1.5sec delay, 3.5sec in total from Player entering the trigger box until the script...6) Kills the Player.7) Then goes to a state that does nothing, will not longer fire, if the explosion happens, otherwise it will keep been active and waiting for the torch. Your idea needs a little more thinking, what i mean is, for example:- What if the Player shoots from a distance a fire arrow or a fireball ? the oil pool will ignite. (similar things like this is the majority of mods CTDs, script fires and the action - function can not be executed).To avoid this you will need to script the oil pool to react only to the trigger box's script, or make a static oil pool and let the trigger box's script handle the oil pool's FX. - Teleport the Player to the entrance when he dies ?. That's a completly different scripting proccess, you're dealing here with player's death mechanic.Puzzles and scenes like yours needs careful thinking and good pre-design, you need to think through all the possibilities and outcomes. What i'm trying to say is, keep it simple at least until you get the hang of it. Edited May 30, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted May 29, 2019 Author Share Posted May 29, 2019 Thanks. I'll give it a try shortly. As for the details...Player will not have or have access to gain any spells at this point in the mod. It's possible that later in the mod the player may have access to a simple flame spell but would he/she return here... haven't thought that far ahead. As for the teleporting, I just thought wouldn't the player automatically be sent to the last save point anyway and therefore makes teleporting redundant?Anyway, I'll let you know how it goes and thanks again. Not working. Screenshot of properties link: https://onedrive.live.com/?cid=B60C11D037429D8E&id=B60C11D037429D8E%2134154&parId=B60C11D037429D8E%21191&o=OneUp Link to comment Share on other sites More sharing options...
maxarturo Posted May 30, 2019 Share Posted May 30, 2019 (edited) Scripts always need to be tested to make them work correctly, even the most experienced scriptures don't always get them right from first try (not that i'm the most experienced one, but with a little testing and effort i manage to script what i have in mind). I had completely forgotten that you can only equip a torch in your left hand, so checking for the right hand torch wouldn't fire, plus the ignite oil pool was wrong, now the script is working perfectly !.There is also the option to not kill the player but upon explosion to do a substantial amount of health damage, let me no if you'll like something like that. * You will need to make your trigger box a little bigger, the 3.5sec that takes for the script to start and finnish the scene is enough for the player to enter and exit your current placed trigger box. With some testing you'll get it right. * You are gonna have to play a little bit with the script's properties to find the right combination of Visual & Sound FX, but that is up to you. Scriptname aXMDtochIgnitesOilSCRIP01 extends ObjectReference {Auto detects if player has equiped a torch then fires the scene - OnTriggerEnter} import sound Actor Property PlayerREF Auto {Assign Actor - Player Ref} explosion property OilExplosion auto {Explosion to ignite Oil Pool - 1st Explosion that plays on the Oil's pool location} ObjectReference property OilPoolRef auto {Link Ref the Oil Pool} explosion property MyOilExplosion auto {The explosion visual FX that will play at the xMarkerExplosion - 2nd Explosion} ObjectReference property xMarkerExplosion auto {The xMarker where the explosion will be placed - 2nd explosion position - Kills the Player} ObjectReference Property xMarkerBarrels01 Auto {The xMarker that will be handleing the disable state of the barrels} Sound Property OilExplosionSoundFX01 Auto {The explosion sound FX that will play when the 2nd explosion occurs} int instanceID ;used to store sound ref auto state waiting Event OnTriggerEnter(ObjectReference akActionRef) if akActionRef == PlayerRef if (PlayerRef.GetEquippedItemType(0) == 11) OilPoolRef.placeAtMe(OilExplosion) Utility.wait(2.0) xMarkerExplosion.placeAtMe(MyOilExplosion) instanceID = OilExplosionSoundFX01. Play(PlayerRef) xMarkerBarrels01.disable() Utility.wait(1.5) PlayerREF.Kill() GoToState("Done") else ; Do nothing endif endif ENDEVENT ENDSTATE EVENT onTriggerLeave(ObjectReference akActionRef) if akActionRef == PlayerRef ; Do nothing endif ENDEVENT Have a happy modding..... Edited May 30, 2019 by maxarturo Link to comment Share on other sites More sharing options...
ReDragon2013 Posted May 30, 2019 Share Posted May 30, 2019 (edited) maxarturo you are really good to explain things and give advise here.I hope you'll accept my changes to your trigger script: ;Actor Property PlayerREF Auto ; UnUSED ;============================== auto state waiting ;================= EVENT OnTriggerEnter(ObjectReference triggerRef) IF (triggerRef == Game.GetPlayer() as ObjectReference) ELSE RETURN ; - STOP - not the player ENDIF ;--------------------- IF (triggerRef as Actor).GetEquippedItemType(0) == 11) ; Is Torch equipped? gotoState("Done") ; ### STATE ### OilPoolRef.SetActorCause(triggerRef as Actor) Utility.Wait(2.0) ; wait for 2 seconds xMarkerExplosion.PlaceAtMe(MyOilExplosion) ; show explosion on placed xMarker OilExplosionSoundFX01.Play(triggerRef) ; player sound, we do not need to store the return value xMarkerBarrels01.Disable() Utility.Wait(1.5) (triggerRef as Actor).Kill() ; kill the player after 3.5 seconds ENDIF ENDEVENT EVENT OnTriggerLeave(ObjectReference triggerRef) ENDEVENT ;======= endState ;============================== state Done ; nothing here ;========= endState Edited May 30, 2019 by ReDragon2013 Link to comment Share on other sites More sharing options...
maxarturo Posted May 30, 2019 Share Posted May 30, 2019 maxarturo you are really good to explain things and give advise here.I hope you'll accept my changes to your trigger script: ;Actor Property PlayerREF Auto ; UnUSED ;============================== auto state waiting ;================= EVENT OnTriggerEnter(ObjectReference triggerRef) IF (triggerRef == Game.GetPlayer() as ObjectReference) ELSE RETURN ; - STOP - not the player ENDIF ;--------------------- IF (triggerRef as Actor).GetEquippedItemType(0) == 11) ; Is Torch equipped? gotoState("Done") ; ### STATE ### OilPoolRef.SetActorCause(triggerRef as Actor) Utility.Wait(2.0) ; wait for 2 seconds xMarkerExplosion.PlaceAtMe(MyOilExplosion) ; show explosion on placed xMarker OilExplosionSoundFX01.Play(triggerRef) ; player sound, we do not need to store the return value xMarkerBarrels01.Disable() Utility.Wait(1.5) (triggerRef as Actor).Kill() ; kill the player after 3.5 seconds ENDIF ENDEVENT EVENT OnTriggerLeave(ObjectReference triggerRef) ENDEVENT ;======= endState ;============================== state Done ; nothing here ;========= endState Please do, all scripting styles are more than welcome for me, especially if their coming from someone such as you. Link to comment Share on other sites More sharing options...
antstubell Posted May 30, 2019 Author Share Posted May 30, 2019 Thanks to you both. Script works perfectly. Just needed a few tweaks with timing. Wish I could find a decent explosion sound though. They are all pretty tame. Another thing I'd like to do is change or turn off a specific sound when a player enters a specific area. Player walks/runs from an underground/sewer type of area which has openings and can hear thunder and rain outside, 2 different sound markers - to an indoor cellar. In the cellar I want the rain sound to turn off but the distant thunder will persist. If the player returns to the sewer area then the rain can be heard again. A simple OnTriggerEnter script on a trigger box placed in the cellar will abruptly turn off the rain plus as said I want it to come back n if player goes back that way. I remember from way back that there is OnEnter 'method' of achieving this, that while inside the trigger box (which would be the whole cellar area) then the sound marker would be disabled and I think an OnLeave 'method'as well. But this defeats the purpose as I only want the sound turned on/off when player passes through the cellar/sewer door. So, again if I remember correctly there is a OnOpen and OnClose or OnDoorOpen and OnDoorClose 'way' of doing this so that when the door is fully closed then the rain can't be heard but when the door is opened it can. Another way would be to fade out the rain sound when entering the cellar, but only from the sewer entrance and vice versa but that is way too complicated for me to understand.Thanks for your time. Link to comment Share on other sites More sharing options...
maxarturo Posted May 30, 2019 Share Posted May 30, 2019 (edited) You'll need to make - add your own sound FX file to the game - mod, if from what i can understand you want a "CABOOM !!!!" sound FX, if i'm not wrong there isn't such a vanilla sound file (but i could be wrong, haven't check all of them and their combinations). - To disable/enable Link Ref OnTriggerEnter - Leave use the default "defaultDisableExitEnableEnter", works only with trigger boxes. - To disable/enable Link Ref OnOpen use the vanilla "defaultEnableDisableLinkOnOpenClose", this script works only with openable/closable objects, such as doors or containers or pin walls or trap doors... - To "fade out the rain sound when entering the cellar, but only from the sewer entrance and vice versa", unfortunately for this you need a custom made script that will work with pre defined areas as area of influence and also tweak the vanilla sound files. * There isn't a game - script option to change the volume or to tweak with detail the environment, so something like this needs some extra hard work and scripting. I'm currently working on a global script that handles all aspects of the environment (something like this doesn't exists in the game's scripts or i have ever seen in a mod), and except that it's becoming kind of a big script, is been a pain in the A** to get it to work correctly till this point, and as i keep working my mod the script keeps evolving and growing more and more. Edited May 30, 2019 by maxarturo Link to comment Share on other sites More sharing options...
Recommended Posts