Jump to content

Need help with scripting


Archer1

Recommended Posts

To all you modders out there, I'm in dire need of your help. I've been working on a mod for months now, and there are still a couple of scripts that I just can't seem to get to work.

So if there's anyone out there who knows their way around these things and is willing to lend a hand, please contact me through PM. I'd rather not reveal story plot points in a public topic.

 

Thank you.

Link to comment
Share on other sites

I can see I won't get anywhere this way, so I'll just post it here after all. There are actually four script I need help with, but these two are of paramount importance.

 

Firstly, I want to make a script for a character where if you kill her by disintegrating or decapitating her, you get one message, saying that a certain thing she was carrying is destroyed. If you kill her in any different way, you get the message saying the item remained intact and it gets transferred into your inventory. Plus some markers that set up following conversations, irrelevant. But I can't get any of it to work. Here's how I did it:

Begin OnDeath

SetEnemy PlayerFaction ArcherRobotsFaction

        if [player.GetItemCount ArcherDataModule == 0]
        if IsLimbGone 1
             ArcherModuleDestroyedMarker.enable
               showmessage ArcherModuleMessage
        elseif (IsInCriticalStage GooEnd) || (IsInCriticalStage DisintegrateEnd)
               ArcherModuleDestroyedMarker.enable
               showmessage ArcherModuleMessage      
        else
               showmessage ArcherModuleMessage2
            player.additem ArcherDataModule 1
               ArcherAvaFreeMarker.disable
        endif
     endif

End

The second one is a lot more complex. When you start Dead Money DLC, you get gassed in that bunker, you pass out, the slideshow starts and you wake up in the Villa. I want to make it like this: you get gassed, you pass out, the screen goes black for a couple of seconds, and you wake up in the same spot (no teleportation), as soon as you get up you get a message saying an item is missing from your inventory. Now I tried adapting the DM script, but I completely improvised with this one because I have absolutely no idea how these timers work. This one could easily be entirely wrong, I have no idea. The only part of this script that works for me is disabling player controls, so I just get stuck in the place. Here it is:

 

 

short StartUp ;1= Player has tripped the trigger zone
short EndStartUp
float TimerA
float TimerB
float TimerC
float TimerD
float TimerE
float TimerZ ;Added for first timer to trigger player teleportation

short bTimerZDone

BEGIN OnTrigger player

if player.GetItemCount ArcherDataModule == 1

DisablePlayerControls 1 1 1 1 1 1 1
Set TimerA to 1
Set TimerA to .2
Set StartUp to 1

endif

END


BEGIN GameMode

; Player gets gassed.

if ( StartUp == 1 )
if ( TimerA > 0 )
Set TimerA to ( TimerA - GetSecondsPassed )
else
player.AddScriptPackage ArcherPlayerBlackout
Set TimerB to 2
Set StartUp to 2
endif
endif

; Player hits the ground, dazed.

if ( StartUp == 2 )
if ( TimerB > 0 )
Set TimerB to ( TimerB - GetSecondsPassed )
;BeginFX
ArcherPoisonSprayREF.enable
;EndFX
else
Set TimerC to 8
Set StartUp to 3
endif
endif

; Player slowly passes out.

if ( StartUp == 3 )
if ( TimerC > 0 )
Set TimerC to ( TimerC - GetSecondsPassed )
else
imod FadeToBlackISFX
Set TimerC to 5
Set StartUp to 4
endif
endif

; Player wakes up.
if ( StartUp == 4 )
if ( TimerC > 0 )
Set TimerC to ( TimerC - GetSecondsPassed )

else
Player.AddScriptPackage NVDLC01PlayerWakesUp
RIMOD FadeToBlackISFX;
IMOD FadeInFromBlack10sISFX;
Set TimerE to 5
Set StartUp to 5
endif
endif

if ( StartUp == 5 )
if ( TimerC > 0 )
Set TimerC to ( TimerC - GetSecondsPassed )
else
Player.RemoveScriptPackage
Set StartUp to 6
EnablePlayerControls
ArcherPoisonSprayREF.disable
endif
endif


END


I'd really appreciate the help. I've been working on this mod for months, and I'd hate to have to change the story because of this.

 

 

 

 

 

Link to comment
Share on other sites

For the first script, I do something similar in my Brisa/Wendy mods, so it looks like it should work. Though In the last section I would put the "ShowMessage ArcherModuleMessage2" function after the other two functions in case the transition to menumode is causing them to be skipped.


In the second script, the 'On trigger player' section is going to run every frame. You probably don't want that. I would assume you want it to run once when the player enters the trigger. TimerA is being set to 1 and then to .2 every frame so the rest of the script is going nowhere.


Use "On triggerEnter Player" for that section.




BEGIN ONTriggerEnter Player
if (StartUp == 0)
if player.GetItemCount ArcherDataModule == 1
DisablePlayerControls 1 1 1 1 1 1 1
Set TimerA to 1
Set TimerA to .2 <--- pick one of these
Set StartUp to 1
endif
endif
END

Link to comment
Share on other sites

The second script now works perfectly. I really can't thank you enough, that was the most important one. Kudos.

 

Still can't figure out why the first one doesn't work, though. Did you convert your mods to master files, or did you leave them as plugins?

Link to comment
Share on other sites

I make the plugin an esm. I would not expect that to make a difference for this issue.

I'm not sure of your square brackets in your "if [Player" line - I've never used them and no script in the Geck is using them that I can see (except in a comment)


I'm doing the NPC script a bit differently, though.



In the gamemode block I detect the critical stage:




BEGIN GAMEMODE

<snip other stuff>

if (gethealthpercentage < .01)
if ((IsInCriticalStage GooStart) || (IsInCriticalStage GooEnd))
set RHKBrisaMN.iGooFlag to 1
endif
if ((IsInCriticalStage DisintegrateStart) || (IsInCriticalStage DisintegrateEnd))
set RHKBrisaMN.iGooFlag to 1
endif
endif

<snip other stuff>

END





BEGIN ONDEATH

<snip>

if ((IsLimbGone 0) || (IsLimbGone 1) || (IsLimbGone 2) || (IsLimbGone 3) || (IsLimbGone 4) || (IsLimbGone 5) || (IsLimbGone 6).. etc)
set iDismembered to 1
endif

<snip>

if ((RHKBrisaMN.iGooFlag) || (iDismembered))
;do something
endif

END



Link to comment
Share on other sites

Tried adapting that:

 

 

BEGIN GAMEMODE

if (gethealthpercentage < .01)
if ((IsInCriticalStage GooStart) || (IsInCriticalStage GooEnd))
set ArcherAvaREF.iGooFlag to 1
endif
if ((IsInCriticalStage DisintegrateStart) || (IsInCriticalStage DisintegrateEnd))
set ArcherAvaREF.iGooFlag to 1
endif
endif

END


BEGIN ONDEATH

SetEnemy PlayerFaction ArcherRobotsFaction

if IsLimbGone 1
set iDismembered to 1
endif

if player.GetItemCount ArcherDataModule == 0
if ((ArcherAvaREF.iGooFlag) || (iDismembered))
ArcherModuleDestroyedMarker.enable
showmessage ArcherModuleMessage
else
player.additem ArcherDataModule 1
ArcherAvaFreeMarker.disable
showmessage ArcherModuleMessage2
endif
endif

END

 

GECK won't even save it.

Link to comment
Share on other sites

I did, "ArcherAvaREF" was the problem. I removed that and everything worked fine.

 

Thanks again for all your help. There are still one or two "less important" scripts left, but I'm too busy with the exams at the moment to go experimenting with the GECK again (since I also need to set up other things before getting to the scripting part). Would you mind if I contacted you in a week or two, regarding the remaining scripts? If I don't manage to get them to work on my own, that is.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...