Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

General Script Questions #1


WillieSea
 Share

Recommended Posts

Still got problems with it not saving even after changing it to GETDead.

Got a problem with line 9

Syntax error Invalid referance "aadiaFarwillREF" ( Only object references and reference variables are allowed in this context )

aadiaFarwillREF.Enable - this line, it's my duplicate farwill's persistant reference, I don't exactly understand much more than I might need to make a x marker ref perhaps but I am lost how to make the x marker suddenly enable my farwill and his horse.

Help please, and yes, I asked about this ages back at the forums, I put it aside for a fair while, not taking another look and see if I can make it work, if not, I suppose I'll be putting aside for another few months and come back to it asking again and trying to learn.

Link to comment
Share on other sites

That is for a missing Object Reference, when you place you NPC in the render window, you will have the ability to double-click on it and give it a reference in the top bar of the box. Make sure you click the persistent reference check box down at the bottom to make the scripts and the game recognize it.

CS_Reference_01.jpg

Link to comment
Share on other sites

aadiaFarwillREF is my farwill's persistant reference and the persistant reference box is ticked.

He is initially Disabled because it would break immersion to have two exact same Farwill Indarys's in the game.

Yes it would be weird. I only asked because enable works best on disabled refs...:shrug:

Anyway, I copied your script and tried saving and got the same warning. Neither one of our CSs recognizes your ref. That might be stating the obvious, I know.

I can check your mod for you if you want to upload it somewhere. Post or PM the link. I have to go out soon but I'll be back in a couple hours. I know I can fix it but I don't know what to ask you. I'm more of a hands-on guy. :rofl:

Or you can sit on your hands and see if IS has an idea. Or Rider if/when he comes on.

Link to comment
Share on other sites

Scriptname DianneFarwillQuest
begin GameMode
;check if the player meets the requirements

If ( GetStageDone MS13 100 == 1 ) || ( GetStageDone MS13 105 == 1 )
aaFarwillREF.Enable; ref ID
else
If FarwilRef.getDead == 1 ;Ref ID
aaFarwillREF.Disable; here his REF ID is used
MidnightREF.Disable: again ref ID

StopQuest aadiaFarwillQuest
endif
endif

end[/code]

Saved! When you use a reference in a script you must use the REF ID, the name at the top of the box that opens when you click on your reference in the render window. So your NPC, the horse, and Farwill the 1st all need to be handled in scripts by their ref ids.

I was going to ask you that - but I didn't. :shrug:

Also, think of Eyja. If Farwill 1 lives, he'll need to go away. Forever. So try a script that moves him somewhere after his quest is finished, and put him to sleep. Permanently. That's how madmole did it. unworthy.gif

Link to comment
Share on other sites

Scriptname DianneFarwillQuest

    begin GameMode

    ;check if the player meets the requirements


    If ( GetStageDone MS13 100 == 1 ) || ( GetStageDone MS13 105 == 1 )

        aaFarwillREF.Enable; ref ID

    else

        If FarwilRef.getDead == 1 ;Ref ID

            aaFarwillREF.Disable; here his REF ID is used

            MidnightREF.Disable: again ref ID


            StopQuest aadiaFarwillQuest

        endif

    endif


    end
Saved! When you use a reference in a script you must use the REF ID, the name at the top of the box that opens when you click on your reference in the render window. So your NPC, the horse, and Farwill the 1st all need to be handled in scripts by their ref ids. I was going to ask you that - but I didn't. :lmao: Also, think of Eyja. If Farwill 1 lives, he'll need to go away. Forever. So try a script that moves him somewhere after his quest is finished, and put him to sleep. Permanently. That's how madmole did it. unworthy.gif
What about:
Scriptname DianneFarwillQuest

    begin GameMode

    ;check if the player meets the requirements


    If ( GetStageDone MS13 100 == 1 ) || ( GetStageDone MS13 105 == 1 )

        aaFarwillREF.Enable; ref ID

        FarwilREF.Disable ; original farwill ref id

    else

        If FarwilRef.getDead == 1 ;Ref ID

            aaFarwillREF.Disable; here his REF ID is used

            MidnightREF.Disable: again ref ID


            StopQuest aadiaFarwillQuest

        endif

    endif


    end

Add the original Farwill Reference id and disable him ?

Edit: It Saved fine, now to test ingame...

Link to comment
Share on other sites

Add the original Farwill Reference id and disable him ?

Edit: It Saved fine, now to test ingame...

I didn't test it...saved that part for you! You could disable Farwill for your personal mod. Matter of fact, I'm not sure why madmole didn't disable Eyja. Probably for safety's sake.

Link to comment
Share on other sites

Thanks for your help, very much apreciated.

Would this magic effect spell work? It triggers a err animation for 60 secounds, or at least, it is supposed to.

scn DianneFarwillSexyTouchScript


;ref aaFarwillRef


;float timer

;short doOnce



;Begin ScriptEffectStart


;begin GameMode

     ;if ( doOnce == 0 )

         ;set timer to 60; Initialize the timer variable

         ;set doOnce to 1

         ;set aaFarwillRef to GetSelf

	;If ( aaFarwillRef.GetItemCount aadiaFarwillpants == 0 )

               ; aaFarwillRef.removeAllItems aaFarwillContainerREF

		;additem aadiaFarwillpants 1



;begin ScriptEffectFinish


        ;if ( timer > 0 )                                                

        ;set timer to timer - getSecondsPassed

        ;set doOnce to 0         

        ;If ( aaFarwillRef.GetItemCount aadiaFarwillpants == 1 )

               ;addItem SteelBoots aaFarwillREF

               ;additem SteelCuirass aaFarwillREF

               ;additem SteelGreaves  aaFarwillREF           

         ;RemoveSpell aadiaFarwillsexySpell

      ;endif

   ;endif

;END


Oh if you wonder why so many ; 's it's because it wouldn't save without them. Thanks.

Link to comment
Share on other sites

scn DianneFarwillSexyTouchScript

ref aaFarwillRef

float timer
short doOnce


Begin ScriptEffectStart

;begin GameMode ; believe this is redundant
if ( doOnce == 0 )
set timer to 60; Initialize the timer variable
set doOnce to 1
set aaFarwillRef to GetSelf
endif ; every if needs an endif

;If ( aaFarwillRef.GetItemCount aadiaFarwillpants == 0 )
; aaFarwillRef.removeAllItems aaFarwillContainerREF
; additem aadiaFarwillpants 1
;endif

end ; every begin needs an end


begin ScriptEffectFinish

if ( timer > 0 )
set timer to timer - getSecondsPassed
set doOnce to 0
;If ( aaFarwillRef.GetItemCount aadiaFarwillpants == 1 )
addItem SteelBoots aaFarwillREF
additem SteelCuirass aaFarwillREF
additem SteelGreaves aaFarwillREF
;RemoveSpell aadiaFarwillsexySpell
endif
endif
END[/code]

Hi Red Dragon - This one saved, but I don't have the pants! Try taking out the rest of the semicolons and saving now. There were some simple syntax errors that are commented. Good luck and lemme know!

Link to comment
Share on other sites

Hi,

I am in need of some scripting help. I have created a spell which does ´´Damage Health´´, I also have added a script effect, a push back effect. But the damage health is touch, and the script is target. Here´s the problem, when I change them both to target, the script effect doesn´t work anymore, and when I touch an enemy it only does Damage Health and no push back effect. Also when they are both set to target, the effect is a Major Wound bolt, not the one I set it to. When the damage health is touch, then it shoots the bolt, for example my selected Frenzy effect, and the enemy gets knocked with the scripted effect, but recieves no damage at all.

Script: (this is the spell script for knock away)

scn 00TOAdesSpellScript


ref self

short index

ref caster


begin scripteffectstart

PlaySound SPLFrostHit

set self to getself

set index to GetScriptActiveEffectIndex 

set caster to GetNthActiveEffectCaster index

caster.pushactoraway self 50

end

Any idea what I am doing wrong?

Link to comment
Share on other sites

Hi,

I am in need of some scripting help. I have created a spell which does ´´Damage Health´´, I also have added a script effect, a push back effect. But the damage health is touch, and the script is target. Here´s the problem, when I change them both to target, the script effect doesn´t work anymore, and when I touch an enemy it only does Damage Health and no push back effect. Also when they are both set to target, the effect is a Major Wound bolt, not the one I set it to. When the damage health is touch, then it shoots the bolt, for example my selected Frenzy effect, and the enemy gets knocked with the scripted effect, but recieves no damage at all.

Script: (this is the spell script for knock away)

scn 00TOAdesSpellScript


ref self

short index

ref caster


begin scripteffectstart

PlaySound SPLFrostHit

set self to getself

set index to GetScriptActiveEffectIndex 

set caster to GetNthActiveEffectCaster index

caster.pushactoraway self 50

end
Any idea what I am doing wrong?
You might want to check the "script effect always applies" checkbox in the spell window. I'm not sure why the effective changes with the target type, but you could always eliminate the damage health effect and do this instead:
scn 00TOAdesSpellScript


ref self

short index

ref caster


begin scripteffectstart

PlaySound SPLFrostHit

set self to getself

set index to GetScriptActiveEffectIndex 

set caster to GetNthActiveEffectCaster index

caster.pushactoraway self 50

self.ModAV2 health -20

end

Replace -20 with the negative of what your damage health effect magnitude was. The ModAV2 works just like a spell does, and can be healed, so it pretty much is damage health without having to make an effect for it.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...