Jump to content

angelwraith

Members
  • Posts

    246
  • Joined

  • Last visited

Posts posted by angelwraith

  1. it affects all actors in cell or however many cells you specify with the getfirstref and getnextref commands. and yes that is including dead ones.

     

    if you need the script to ignore them use

     

    ActorREF.GetDead != 1

     

    i actually have a pretty awesome example script thatll distinguish between actors and their current states, i tried to make it as legible as possible as i pass this script on to help people often: this should have everything you need to deduce how to use ref-walking on actors.

     

    this is not a cut and paste script thatll have you up an running, just a guideline so you can read it and try things based on the methods there.

     

     

     

    SCN SUBdetect
    
    ref creatureREF
    int creatureREFcount
    float rTimer
    
    BEGIN GAMEMODE
    if player.getitemcount SUBaedACT == 0
    	stopquest SUBdetectquest
    endif
    if player.getitemcount AmmoMicroFusionCell < ( SUBskillcostREF.skillcost )
    	stopquest SUBdetectquest
    	showmessage SUBmfcellsneededMSG
    endif
    
    set rTimer to rTimer - GetSecondsPassed
    if rTimer <= 0
    	set SUBskillcostREF.indicatorREF to 0
    	listclear SUBkilllist
    ENDIF
    
    set creatureREFcount to GetNumRefs 200 2
    set creatureREF to GetFirstRef 200 2
    if (creatureREF.GetDistance player < 10000)
    
    	creatureREF.sms NightkinCloakFXShader
    
    	if ( creatureREF.getdead )	 ;dead -> BLACK
    	creatureREF.PMS SUBDeadSpotterShader 1 ; DEAD
    
    	elseif ( creatureREF.IsInList SUBkillList )	
    	creatureREF.PMS	SUBIndicatedforshotSHADER 1 ;  indicated for shot
    
    	elseif(creatureREF.Getdistance SUBflagREF <= 250 ) ; indicated for shot
    	creatureREF.PMS	SUBIndicatedforshotSHADER 1 ;  indicated for shot
    	set SUBskillcostREF.indicatorREF to creatureREF
    	creatureREF.listaddreference SUBkillList 0
    	set rTimer to 3
    
    	elseif(creatureREF.GetCurrentAIProcedure == 8) ;sleeping -> blue
    	creatureREF.PMS	SUBsleepSpotterShader 1 ; sleep
    
    	elseif(creatureREF.GetCurrentAIProcedure == 16) ;fleeing -> pink
    	creatureREF.PMS SUBfleeSpotterShader 1 ; flee
    
    	elseif (creatureREF.GetCombatTarget == player)	 ;attacks player -> red fast blink
    	creatureREF.PMS	SUBSpotterShader 1 ; ATTACKING
    
    	elseif ( creatureREF.GetFactionRelation player == 2)	 ;ally -> green
    	creatureREF.PMS SUBFriendSpotterShader 1 ; ally
    
    	elseif (creatureREF.GetFactionRelation player == 1)	 ;enemy with player-> orange fast blink
    	creatureREF.PMS SUBEnemySpotterShader 1 ; hostile
    
    	elseif (creatureREF.GetFactionRelation player == 0 && creatureREF.GetAV Aggression >= 2)	 ;neutral but verry aggressive -> orange fast blink
    	creatureREF.PMS SUBEnemySpotterShader 1 ; hostile
    
    	else	 ;any actor alife -> grey
    	creatureREF.PMS SUBNeutral 1     ; neutral
    	endif
    
    endif
    
    label 5
    if creatureREFcount > 0
    	set creatureREF to GetNextRef
    	if (creatureREF.GetDistance player < 10000)
    
    		creatureREF.sms NightkinCloakFXShader
    
    		if ( creatureREF.getdead )	 ;dead -> BLACK
    		creatureREF.PMS SUBDeadSpotterShader 1 ; DEAD
    
    		elseif ( creatureREF.IsInList SUBkillList )	
    		creatureREF.PMS	SUBIndicatedforshotSHADER 1 ; indicated for shot
    
    		elseif(creatureREF.Getdistance SUBflagREF <= 250 ) ; indicated for shot
    		creatureREF.PMS	SUBIndicatedforshotSHADER 1 ; indicated for shot
    		set SUBskillcostREF.indicatorREF to creatureREF
    		creatureREF.listaddreference SUBkillList 0
    		set rTimer to 3
    
    		elseif(creatureREF.GetCurrentAIProcedure == 8) ;sleeping -> blue
    		creatureREF.PMS	SUBsleepSpotterShader 1 ; sleep
    
    		elseif(creatureREF.GetCurrentAIProcedure == 16) ;fleeing -> pink
    		creatureREF.PMS SUBfleeSpotterShader 1 ; flee
    
    		elseif (creatureREF.GetCombatTarget == player)	 ;attacks player -> red fast blink
    		creatureREF.PMS	SUBSpotterShader 1 ; ATTACKING
    
    		elseif ( creatureREF.GetFactionRelation player == 2)	 ;ally -> green
    		creatureREF.PMS SUBFriendSpotterShader 1 ; ALLY
    
    		elseif (creatureREF.GetFactionRelation player == 1)	 ;enemy with player-> orange fast blink
    		creatureREF.PMS SUBEnemySpotterShader 1 ; hostile
    
    		elseif (creatureREF.GetFactionRelation player == 0 && creatureREF.GetAV Aggression >= 2)	 ;neutral but verry aggressive -> orange fast blink
    		creatureREF.PMS SUBEnemySpotterShader 1 ; hostile
    
    		else	 ;any actor alife -> grey
    		creatureREF.PMS SUBNeutral 1     ; neutral
    		endif
    
    	endif
    	set creatureREFcount to creatureREFcount - 1
    	goto 5
    endif
    
    set creatureREFcount to GetNumRefs 201 1
    set creatureREF to GetFirstRef 201 1
    if (creatureREF.GetDistance player < 5000)
    	creatureREF.PMS SUBItemSpotterShader 1
    endif
    label 6
    if creatureREFcount > 0
    	set creatureREF to GetNextRef
    	if (creatureREF.GetDistance player < 5000)
    		creatureREF.PMS SUBItemSpotterShader 1
    	endif
    	set creatureREFcount to creatureREFcount - 1
    	goto 6
    endif
    if SUBskillcostREF.indicatorREF
    	showmessage SUBtestmessageMSG
    endif
    END
    

     

  2. when your activating things the activation button also causes the player to get up.

     

    go sit in a chair and hit activate...

     

    ok, so how to get around it.

     

    im working from theory here as i have not tested this but i have similar functions that i know work so in practice it shouldnt be a big deal.

     

    id skype it all out to you but its bed time.

     

    you should attach a script that uses getcrosshairref to check if the player is currently looking at one of the activators or references and if so fires a 'return' in the onactivate block which will prevent the chairs activation from firing and keep you seated.

     

    attach the script to a custom chair.

     

    this requires NVSE

     

    but honestly if your not already scripting with NVSE your missing out big time.. and so are your fans.

    there are tons of things possible that go way beyond what the game was originally intended for.. mostly possible through the amazing functions added through NVSE.

    check it out.

     

    and good luck. tomorrow evening i may be able to lend a hand after work but its le bed time for me now.

  3. does leveled npc go on npc reference list or is there another list for leveled npc(same for creature) . i ask bacause on NVSE function list there is :

    42: NPC

    43: Creature

    44: LeveledCreature

    45: LeveledCharacter

    and i do mod that check all references on the list , but i travel through many locations( like mcnamara camp where there are many soldier who seems to be leveled, mojawe wastelend and many more) and 44 and 45 list are empty . is it ok and 44 and 45 are used for something else ?

     

    i assume your refwalking

     

    are you suing the commands getfirstref or getnextref with loops?

    thats refwalking, if so use 200 instead.

    it deals with all actors.

     

    also if you need item refs through refwalking 201 is the best way to go.

  4. these are all DUH! type problems that got me stuck at some point or another:

     

    dont divide by 0

    sounds simple enough but ive found on multiple occasions broken scripts because a variable was being used as a divisor and it somehow get set to 0

    for instance i had a script that was dividing by the players xangle.. but when moveto was called on the player xangle shows as 0 for a split second. crashy crashy.

     

    if you move something with script you have to give the game a second to update its 3d before attempting any further script having to do with its new location.

    that one had me stuck for a week and a half in FO3

     

    if you need multiple unique references that are all copies of 1; its is MUCH easier setting multiple objects to persistant and named if you set the first one to persistant, make your copies off of that one and do the name work in the cell object window rather than the render window. select the object, use F2 paste your name edit the number and hit enterpress down to do the next reference you need in that sequence and repeat.

     

    if variables reach astronomical numbers the game starts to have problems this is especially the case of location variables.. if a location variable is huge it can actually cause player lockup in game.

     

    onequip block does not work when equip caused by script (hate that one, lead to MANY headaches)

     

    ill try to think of more...

  5. i did this script to check hostility but it also checks for allies

     

     

    SCN SUBdetect
    
    ref creatureREF
    int creatureREFcount
    float rTimer
    
    BEGIN GAMEMODE
    if player.getitemcount SUBaedACT == 0
    	stopquest SUBdetectquest
    endif
    if player.getitemcount AmmoMicroFusionCell < ( SUBskillcostREF.skillcost )
    	stopquest SUBdetectquest
    	showmessage SUBmfcellsneededMSG
    endif
    
    set rTimer to rTimer - GetSecondsPassed
    if rTimer <= 0
    	set SUBskillcostREF.indicatorREF to 0
    	listclear SUBkilllist
    ENDIF
    
    set creatureREFcount to GetNumRefs 200 2
    set creatureREF to GetFirstRef 200 2
    if (creatureREF.GetDistance player < 10000)
    
    	creatureREF.sms NightkinCloakFXShader
    
    	if ( creatureREF.getdead )	 ;dead -> BLACK
    	creatureREF.PMS SUBDeadSpotterShader 1 ; DEAD
    
    	elseif ( creatureREF.IsInList SUBkillList )	
    	creatureREF.PMS	SUBIndicatedforshotSHADER 1 ;  indicated for shot
    
    	elseif(creatureREF.Getdistance SUBflagREF <= 250 ) ; indicated for shot
    	creatureREF.PMS	SUBIndicatedforshotSHADER 1 ;  indicated for shot
    	set SUBskillcostREF.indicatorREF to creatureREF
    	creatureREF.listaddreference SUBkillList 0
    	set rTimer to 3
    
    	elseif(creatureREF.GetCurrentAIProcedure == 8) ;sleeping -> blue
    	creatureREF.PMS	SUBsleepSpotterShader 1 ; sleep
    
    	elseif(creatureREF.GetCurrentAIProcedure == 16) ;fleeing -> pink
    	creatureREF.PMS SUBfleeSpotterShader 1 ; flee
    
    	elseif (creatureREF.GetCombatTarget == player)	 ;attacks player -> red fast blink
    	creatureREF.PMS	SUBSpotterShader 1 ; ATTACKING
    
    	elseif ( creatureREF.GetFactionRelation player == 2)	 ;ally -> green
    	creatureREF.PMS SUBFriendSpotterShader 1 ; ally
    
    	elseif (creatureREF.GetFactionRelation player == 1)	 ;enemy with player-> orange fast blink
    	creatureREF.PMS SUBEnemySpotterShader 1 ; hostile
    
    	elseif (creatureREF.GetFactionRelation player == 0 && creatureREF.GetAV Aggression >= 2)	 ;neutral but verry aggressive -> orange fast blink
    	creatureREF.PMS SUBEnemySpotterShader 1 ; hostile
    
    	else	 ;any actor alife -> grey
    	creatureREF.PMS SUBNeutral 1     ; neutral
    	endif
    
    endif
    
    label 5
    if creatureREFcount > 0
    	set creatureREF to GetNextRef
    	if (creatureREF.GetDistance player < 10000)
    
    		creatureREF.sms NightkinCloakFXShader
    
    		if ( creatureREF.getdead )	 ;dead -> BLACK
    		creatureREF.PMS SUBDeadSpotterShader 1 ; DEAD
    
    		elseif ( creatureREF.IsInList SUBkillList )	
    		creatureREF.PMS	SUBIndicatedforshotSHADER 1 ; indicated for shot
    
    		elseif(creatureREF.Getdistance SUBflagREF <= 250 ) ; indicated for shot
    		creatureREF.PMS	SUBIndicatedforshotSHADER 1 ; indicated for shot
    		set SUBskillcostREF.indicatorREF to creatureREF
    		creatureREF.listaddreference SUBkillList 0
    		set rTimer to 3
    
    		elseif(creatureREF.GetCurrentAIProcedure == 8) ;sleeping -> blue
    		creatureREF.PMS	SUBsleepSpotterShader 1 ; sleep
    
    		elseif(creatureREF.GetCurrentAIProcedure == 16) ;fleeing -> pink
    		creatureREF.PMS SUBfleeSpotterShader 1 ; flee
    
    		elseif (creatureREF.GetCombatTarget == player)	 ;attacks player -> red fast blink
    		creatureREF.PMS	SUBSpotterShader 1 ; ATTACKING
    
    		elseif ( creatureREF.GetFactionRelation player == 2)	 ;ally -> green
    		creatureREF.PMS SUBFriendSpotterShader 1 ; ALLY
    
    		elseif (creatureREF.GetFactionRelation player == 1)	 ;enemy with player-> orange fast blink
    		creatureREF.PMS SUBEnemySpotterShader 1 ; hostile
    
    		elseif (creatureREF.GetFactionRelation player == 0 && creatureREF.GetAV Aggression >= 2)	 ;neutral but verry aggressive -> orange fast blink
    		creatureREF.PMS SUBEnemySpotterShader 1 ; hostile
    
    		else	 ;any actor alife -> grey
    		creatureREF.PMS SUBNeutral 1     ; neutral
    		endif
    
    	endif
    	set creatureREFcount to creatureREFcount - 1
    	goto 5
    endif
    
    set creatureREFcount to GetNumRefs 201 1
    set creatureREF to GetFirstRef 201 1
    if (creatureREF.GetDistance player < 5000)
    	creatureREF.PMS SUBItemSpotterShader 1
    endif
    label 6
    if creatureREFcount > 0
    	set creatureREF to GetNextRef
    	if (creatureREF.GetDistance player < 5000)
    		creatureREF.PMS SUBItemSpotterShader 1
    	endif
    	set creatureREFcount to creatureREFcount - 1
    	goto 6
    endif
    if SUBskillcostREF.indicatorREF
    	showmessage SUBtestmessageMSG
    endif
    END
    

     

     

    you should be able to deduse what you need for what your doing

     

    (sounds like your trying to find a solution to the moveto problem that excludes companions that adapts to mod companions as well... only reason i think that is because i was thinking about doing it myself for my teleporter.

     

    but refwalking is awesome!! i use it all the time to find and highlight enemies (the script attached) or to lock on enemies for weapon tracking also partially the code found in this script.

     

    there are tons of uses!

     

    OOOH 1 more VERY important thing

    refwalking for me is notoriously buggy when not used in a quest script and controlled with startquest and stopquest

     

     

    oh yeah your probabbly also gonna need to use creatureREF.getcurrentAIpackage == 1 to check if they are in a follow package curently.

  6. are you using FOMM and FNVedit to make and enable a merged patch?

     

    sounds like there is some interaction NV doesnt like.. this is usually the best way to make sure it all works.

     

    also did you install them correctly?

     

    FOOK will for sure cause a CTD if its files arent in the data folder structure

    not sure if the other has custom objects but fook for sure does.

     

    when installing most modders will have you extract their archives to the data folder in NV

    however some modders have FOMOD method and i think FOOK is one of those..

    be sure to go through the readme of any new file to get it all working properly.

  7. i would love to try to help you with this, in fact i try to help wherever there is a problem i may be able to help with.

     

    but seeing how apparently you hate me and my fellow citizens without knowing anything about me, respectfully, i cant do it.. on principal.

     

    lets try again with the SN eh?

  8. hm...lots of useful thoughts here, thank you for the responses.

     

    the part I actually needed was the player.moveto function, I wasn't sure what it'd be.

    thanks for that :P

    I hadn't thought of companions though, especially non-vanilla companions.

    the method I planned to use is basically a dialog based teleporter. you talk to the Zax and when you tell it where you want to go, it runs something akin to the player.moveto command on you and moves you to the floor of your choice :P

    straightforward, but harder to combine with companions... I'll probably just use aspects of the V22 script for that, and accept that it'll only partially work with non-vanilla companions.

     

    the multiple door's method sounds much more simple, but part of the immersion may be broken by the elevator apparently not moving. that is unless I run a timer and sound-effect for that...but who wants to deal with a compulsory wait like that every time they change floors?

     

     

    Edit: just a minor update to the plan, rather than having a dedicated cell specifically for the elevator, it seems simpler to have an elevator interior at each level, and be able to open the door and go in each time. perhaps also have randomised delays on the door opening time for the elevators :P

    this removes the need for another system to decide which door to link to at any time for leaving the elevator (should you realise you didn't want to change floors after all)

     

    to distinguish which floor the player is on for limiting the options so you can't go to the floor you're currently on, I plan to simply check which cell the player is in. that will provide the necessary data much more easily.

     

    if there is a stair case that alternatively links the levels so the NPCs can route that'll work perfectly... was actually thinking of suggesting it but i figured that the levels were not connected

     

    as for them not knowing theyre moving:

     

    player.playgroup Stagger

    playsound AMBElevatorBell

     

    no wait

     

    or put the bell sound then a 1 second timer, then this code

  9. i hate when that happens..

    could be a lot of things from mod interaction, to location issues (if your position variables reach a certain number they will cause problems like this) to a fatal script error..

     

    usually i find somewhere there was a divide by 0 set through script or something stupid like that..

     

    try running the game without the mod enabled and see if that remedies the issue.

     

    also you are going to have to load a save prior to installing the mod because script variables can get saved regardless of whether the mod is still there or not and cause the issue to continue.

     

    just last night i fixed one of these annoying ass bugs in my mod..

     

    there is a script that constantly calls the x angle of the player and numbers are divided by that.

    what was happening though was when a moveto was being called on the player there was a split second where the script was still running but there was no x angle hence divide by 0 equals no beuno

     

    i hope you find your culprit soon, i wish i could have been more help.

  10. man ive typed this like 3 times now, soo to be sure i post it this time im gonna make it short.

     

    use doors

     

    elevator cell will have overlapping doors that you will disable with script with the exception of the one leading to the floor the player selects..

     

    this should fix the companion issue as its related to the inability of the companions to route through a navmesh because there are no with doors finalized into it.

     

    you can use moveto but then you will need to use a script similar to the lucky38 script above to move the listed companions..however this will not work with mods that add companions sooo best be is to go the door route.

     

    i DO have a refwalking solution to the moveto issue that works with all followers by checking the cell for followers and adding them all to a moveto list to work with other companions outside of the original vanilla companions BUT this will absolutely require NVSE and is a LOT more complicated in the way of script than anything discussed here. also it deals with several scripts working together in tandem.. so if these scripts are any bit confusing to you that most certainly is not the best route.

  11. awesome, thanks!

     

    yeah this is the very last thing i need to make my holorifle work properly.

     

    just bear in mind i really have only 3 requirements out of the model im trying to get.

     

    [*] its a sphere.

     

    [*] its mostly see-through

     

    [*] there is NO collision geometry.

     

    the color would be great if it were #CC99FF

     

     

     

    a little background on what it is for:

     

    its a reticle for a gun

    but its actually in game.

     

    as you move around the object will stay at the crosshair with its distance changing based on player angle.

    right now the object i am using as the reticle is a flagpole so to the player positions it near their enemy and then fires the weapon if their is an enemy within a certain range of the object a special scipt is run that fakes the firing of the gun and places its projectile/explosion at the enemy.

    the guns projectile speed is already near instant so to the player when these conditions are satisfied nothing looks different but the weapon now spawns the explosion at the source so I.E. the weapons projectile will lock on target. kinda like the gun in 5th element just without the neat animation of curving projectiles. also this makes 1 more thing possible that really is the entire goal to the weapon.. it shoots through walls, boulders, mountains, crowds of innocents ... theres no more in between sooo... yeah thats why.

     

    anyway i know this sounds like a lot but its all already done.

    the only thing i need is a decent reticle for the player

     

    oh yeah 1 more thing. this sphere is always hanging directly in front of your face when this weapon is out so it is very important that is has a relativity low opacity.

    also because the weapon still fires like normal if there is no target lock it is also very important there is NO collision geometry. so the projectiles dont hit the bubble/sphere and airburst.

     

    the xmarker model is perfect in those attributes, which is why i used it as an example, it has a low opacity and does not allow premature projectile impact.

     

    im trying to install skype right now.

    if you have any questions ill be available on there soon.

  12. ok well the script provided will keep the door locked unless the player enters that activator and has the key in possession.

     

    if you want however for the door to lock ONLY for the player use the following script. and make that activator box large enough around the door to where they dont have enough time to get to it before the closing animation in done.

     

    what it does:

    locks the door ONLY when the player enters the activator box without the key.

    opens the door when they leave the activator box so everyone else can get through again.

     

     

    SCN AAAautoDoorLockOnPlayerEnterSCRIPT
    
    int specialactivate
    ref MyLinkedDoor
    
    Begin OnTriggerEnter Player ; When the player enters the activator close the door and tell the gamemode block to lock it once its closed
    set MyLinkedDoor to GetLinkedRef
    if player.getitemcount THENAMEOFTHEKEYTOTHISDOOR == 0
    MyLinkedDoor.setOpenState 0
    set specialactivate to 1
    endif
    END
    
    Begin OnTriggerLeave Player ; when the player leaves the activator box the door unlocks
    MyLinkedDoor.unlock
    ;	MyLinkedDoor.setOpenState 1 ; to have the door open automatically instead remove the semicolon at the beginning of this line
    END
    
    Begin Gamemode ; if the door is closed and set to lock, lock it and stop waiting to lock it
    if ( specialactivate == 1 ) && ( MyLinkedDoor.GetOpenState == 3 )
    	MyLinkedDoor.lock 120
    	set specialactivate to 0
    endif
    END

     

    Note* in this script as well, you will need to make 1 change to get it to work, replace "THENAMEOFTHEKEYTOTHISDOOR" with the ObjectID name of the key you want to control it.

  13. why must the npc lock the door?

     

    is it acceptable to you for the door to automatically unlock when you approach it based on whether or not you have that key and then automatically lock when you walk away?

     

    if so make a cubic activator (its the cube with the "T" on the menu bar in geck) and apply the attached script to it

     

    your door must be persistent, with the activator placed in world double click the activator to edit the reference then use right arrow at the top to navigate to linked reference.

    hit the button that lets you select the reference in the window and select your door. the reticle will change colors when its over the door so you know its lined up so double click it to select it.

     

    it should now say your door is the linked ref so click ok and position the activator around the door and armory.

     

    when the player enters this activator box the door will unlock if they have your key

    when the player leaves this box the door will automatically close and once its closed itlll automatically lock to a must have key state again.

     

    so the idea with the activator positioning is to have the armory in there completely so the door stays unlocked while your in there, but to have it go beyond the door on the outside of the armory so your all the way out of the way of the door before it starts to close behind you. also by having it go a little past the door that means when you enter the edge of the activator to enter the armory the enterblock commands fire to open it up.

     

     

    SCN AAAautodoorSCRIPT
    
    int specialactivate
    ref MyLinkedDoor
    
    Begin OnTriggerEnter Player ; when the player enters the activator box the door unlocks
    set MyLinkedDoor to GetLinkedRef
    if player.getitemcount THENAMEOFTHEKEYTOTHISDOOR >= 1
    	MyLinkedDoor.unlock
    ;		MyLinkedDoor.setOpenState 1 ; to have the door open automatically instead remove the semicolon at the beginning of this line
    endif
    END
    
    Begin OnTriggerLeave Player ; When the player leaves the activator close the door and tell the gamemode block to lock it once its closed
    MyLinkedDoor.setOpenState 0
    set specialactivate to 1
    END
    
    
    Begin Gamemode ; if the door is closed and set to lock, lock it and stop waiting to lock it
    if ( specialactivate == 1 ) && ( MyLinkedDoor.GetOpenState == 3 )
    	MyLinkedDoor.lock 120
    	set specialactivate to 0
    endif
    END

     

    Note* you will need to make 1 change to this script to get it to work, replace "THENAMEOFTHEKEYTOTHISDOOR" with the ObjectID name of the key you want to control it.

  14. i need the xmarker 'x' shape replaced with a sphere, 400 radius.

     

    if you can do color, use: #CC99FF

     

    i need all other properties to be exactly the same as the xmarker model!!

     

     

    i am currently using the xmarker for what i need and it is perfect save for the changes i need made.

    a big red x isnt working for me aesthetically (the activator i am using this for actually needs to be visible ingame)

    but a seethrough sphere with these specs and the same type texture would be PERFECT.

     

    for anyone that knows there way around nifscope, they could probably get this done quicker than its taking me to type this post i just dont have time to figure out nifscope to do 1 model, so pleeease help!!

  15. begin gamemode
           if aaaSTCell4fRlSwch1Ref.aaaSTBunkerCityCell4fRelayShrt1 && aaaSTCell4fRlSwch2Ref.aaaSTBunkerCityCell4fRelayShrt2 && aaaSTCell4fRlSwch3Ref.aaaSTBunkerCityCell4fRelayShrt3 && aaaSTCell4fRlSwch4Ref.aaaSTBunkerCityCell4fRelayShrt4 && aaaSTCell4fRlSwch5Ref.aaaSTBunkerCityCell4fRelayShrt5
                   PlaySound3D OBJBuzzerBell ; see the note at the bottom about this line
           endif
    end
    

     

    well the buzzer ringing the whole time would make sense since, the gamemode block runs continuosly, unless like you said - you made an extra line of code

     

    im still confused about the script portion above^

     

    i dont understand the logic - what does ref.variable do in this condition? does it get a value from somewhere and return it because its like

     

    if ref.variable

    playsound (sound)

    endif

     

    but what does this mean logically? i want to know what im writing and understand it, so i can use it in future, rather than blindly copy pasting someones code without knowing whats what.

     

     

     

    ref.variable:

     

    this is what ive been trying to describe to you!!

     

    you MUST have the ref before the variable otherwise it will access the variable from THAT REFERENCE rather than the variable in the script attached to the reference being activated. if it were all run from 1 script this wouldnt be an issue but because were using 5 scripts this is the way its gotta be done.

     

    its like someone asking you what my favorite color is ... wouldnt know would you? now if they asked the question to me, the person it pertains to i would probabbly be able to answer the question.

     

    now heres the fun part..you should def know this. by having this script attached to all 5 references and each RUNNUNG ITS SCRIPT INDEPENDANTLY that means that when the condition is satisified the functions are actually running 5 times because each script will fire independently.

     

    now if your using enable and disable as i suggested.. this doesnt matter because you cant enable something thats already enabled or disable something thats diabled..

     

    however if you start to add new functions to the gamemode block keep in mind that it will run 5 times.

     

     

    there is a better way to do all this.. but im trying not to confuse you any more...

    when you get this working and understand what is going on ill help you fix it all the way if you like so that you dont have to worry about referencing the variables in external scripts or have to worry about things running 5 times.. and youll need just one script to do it all. (the switches involved wouldnt actually need ANY SCRIPT AT ALL.

     

     

     

    ALSO lose the setopenstate stuff if you want to hear the switch, and like i showed you add the 'ACTIVATE' at the end of the onactivate block. this will make it do everything its supposed to do normally.

  16. your script didnt fire because as i stated you are calling variables in a local script and you need to be calling variables as per reference.

     

    i did this for you.

     

    the sound issue..

    use enable and disable if you want control over how long the buzzer goes, and as suggested a timer if you want it to play for a certain amount of time.

    so if you want the player to control when its on and off through whether or not all switches are on this is really simple:

     

    use this instead after adding the sound AS A REFERENCE IN THE WORLD where you want it to play from (will automatically play 3d from wherever you put it)

     

    if aaaSTCell4fRlSwch1Ref.aaaSTBunkerCityCell4fRelayShrt1 &&  aaSTCell4fRlSwch2Ref.aaaSTBunkerCityCell4fRelayShrt2 && aaaSTCell4fRlSwch3Ref.aaaSTBunkerCityCell4fRelayShrt3 && aaaSTCell4fRlSwch4Ref.aaaSTBunkerCityCell4fRelayShrt4 && aaaSTCell4fRlSwch5Ref.aaaSTBunkerCityCell4fRelayShrt5
    OBJBuzzerBellREF.enable
    else
    OBJBuzzerBellREF.disable
    endif
    

     

    btw see the reference name in front of the variables??? thats why your isnt working. you have to call the variable from the reference your pointing to because separate scripts have separate variables!!!!

  17. this should reset the DT to the DT as it was when equipped when you unequip the armor:

    *note you can condense this a bit i just set it up the way i did for readability.

     

    int initialDTvar
    int currentDTvar
    int DTdifferenceVAR
    
    begin onequip player
    set initialDTvar to player.getAV DamageThreshold
    End
    
    begin onunequip player
    set currentDTvar to player.getAV DamageThreshold
    set DTdifferenceVAR to ( initialDTvar - currentDTvar )
    player modAV DamageThreshold DTdifferenceVAR
    End

     

    BTW

    this may not work if anything else modifies the DT while you have it equipped though because as youve realized DT changes, change DT overall as a whole.. so on unequip this will still set it all back to whaterer it was when you equipped it.

     

    the best thing to do would be tracking the overall changes to DT that your armor does in a separate variable and then always applying the negative of that number to the player upon unequipping the armor.

     

    for example

    if when you equipped the armor your dt was 12, and while you had the armor equipped modified your dt by an initial +20 then over time a -5 and -7 and -3 your overall change would be 5 leaving the character with a DT of 17 so to negate the effect caused by the armor apply the negative of the variable that tracked those changes: -5.

     

    if you track these changes in a variable, because it only applies to the changes made by your armor, other items that affect DT should be unaffected

  18. thx, xab666, that seems like it would work, ill give it a shot, but for the switches, do you think it would be "forward" and "backward" ? the vertibird example made sense, but idk if it is the same for a switch, is there any way to find out what animations an object has to choose from?

     

    the animation groups are in the preview window

    should be open and close.

     

     

    OK

    so i saw this post yesterday and replied but then saw you had your solution and removed my reply. but its been buggin me because the solution discussed here could not have made this script work.... it may have forced the animation (necessary if your script needs to know and control the exact state of the switch but not here)

     

    so now after implementing your script and testing i see my suspicions are confirmed so i am going to repost my post from yesterday now here:

     

     

     

     

     

     

    your onactivate block is lacking a "activate"

    pretty sure it still needs the command to activate because an onactivate block replaces the default onactivate function with whatever you script so it needs to be told to activate somewhere in there in order to do so. (tested this morning, it works, all you need is 'activate' to get them to animate)

     

    also by applying this script to separate references, each is going to hold its own variables so you need to point to which variable from which script you need.

     

    if you are updating an existing script ignore this next paragraph, if however you are attempting to save it for the first time this is very important:

    *note geck will not allow you to save this script until its saved... i know that sounds ridiculous but its true.. in order to save geck is going to try to make sure those variables exist in those scripts.. but seeing how your trying to save the script its checking it wont find them. what you have to do is comment out the contents of the gamemode block (which is whats causing it to check for those variables) by adding semicolons to the beginning of each line in it, save the script then open the script back up an remove the semicolons on the gamemode block and save again be sure the ref names are set up on the switches though otherwise itll still not save.

     

     

     

    try:

     

     

    scn aaaSTBunkerCityCell4fRelayScript1
    
    short aaaSTBunkerCityCell4fRelayShrt1
    short aaaSTBunkerCityCell4fRelayShrt2
    short aaaSTBunkerCityCell4fRelayShrt3
    short aaaSTBunkerCityCell4fRelayShrt4
    short aaaSTBunkerCityCell4fRelayShrt5
    int aaaSTBunkerCityCell4fRelayInt1
    
    begin gamemode
    if aaaSTCell4fRlSwch1Ref.aaaSTBunkerCityCell4fRelayShrt1 && aaaSTCell4fRlSwch2Ref.aaaSTBunkerCityCell4fRelayShrt2 && aaaSTCell4fRlSwch3Ref.aaaSTBunkerCityCell4fRelayShrt3 && aaaSTCell4fRlSwch4Ref.aaaSTBunkerCityCell4fRelayShrt4 && aaaSTCell4fRlSwch5Ref.aaaSTBunkerCityCell4fRelayShrt5
    	PlaySound3D OBJBuzzerBell ; see the note at the bottom about this line
    endif
    end
    
    begin onactivate player
    if GetIsReference aaaSTCell4fRlSwch1Ref == 1
    	set aaaSTBunkerCityCell4fRelayShrt1 to 1
    elseif GetIsReference aaaSTCell4fRlSwch2Ref == 1
    	set aaaSTBunkerCityCell4fRelayShrt2 to 1
    elseif GetIsReference aaaSTCell4fRlSwch3Ref == 1
    	set aaaSTBunkerCityCell4fRelayShrt3 to 1
    elseif GetIsReference aaaSTCell4fRlSwch4Ref == 1
    	set aaaSTBunkerCityCell4fRelayShrt4 to 1
    elseif GetIsReference aaaSTCell4fRlSwch5Ref == 1
    	set aaaSTBunkerCityCell4fRelayShrt5 to 1
    endif
    ACTIVATE
    end

     

     

    *EDIT*

    1 more thing i just saw, the playsound command will probably not work because it is not an ambient sound and therfore you must play it from a reference. so you can put playsound3d like i did up there. but this is going to play the sound from the switch.. so i would suggest adding an alarm reference and playing the sound from there by using: yourREFhere.Playsound3d OBJBuzzerBell

     

     

    i tested this ingame.. it for sure works.

    if you have problems let me know ill try to help.

     

    BTW you realize the buzzer sound is on loop? you intend for it to play forever?

    if not i have a really easy solution for you.. drag the sound itself into the world editor and assign it a reference name and set it persistent. then instead of calling playsound on that sound simply use 'yourSoundRefNameHere.enable' or 'yourSoundRefNameHere.disable' on the reference to control whether or not its playing. remember to set the reference to initially disabled when setting it up though otherwise itll be wailing when it loads.

  19. what i am trying to do is identify a weapon at a specific index in a container, then move it into the world through script a way that will retain its weapon mods and health.

     

    It's not possible with the current state of NVSE. Item's in a container are not references. They are base objects with 'extra' data. The extra data has the health of the item. This extra data is not accessable by any script function.

     

    exactly the response i was after. i mean im not happy that this means i cant do what i want, im just happy that you saved me lots of needless scripting to to figure out thre isnt a function for what i need. thank you.

×
×
  • Create New...