Jump to content

Scripting Help With a Nighttime Only Armor


BigCatZam

Recommended Posts

Hi, I'm new to scripting within GECK, and I'm having trouble getting GECK to accept a certain script. The basic premise of this script is that after a perk is applied, two things happen. Firstly, a certain piece or two of armor is removed from your inventory at dawn, and are only able to equip again after dark. The second thing would be a consumable item that makes it so on use, it adds and equips the removed armor, preferably only during dark. I guess you could think of it similarly to a werewolf transformation in Skyrim, except limited to the nighttime. I was considering making it so the consumable item is also removed at dawn in the event that it wasn't used, to prevent cheating.

 

The basic script is here. It might be shoddily written, I have no idea, again, I'm a beginner to scripting. ^^;

 

 

ScriptName GhostRTFScript

ref GhostRFire

ref GhostRSkull

set GhostRFire to PlayerREF.GetEquippedObject 13

set GhostRSkull to PlayerREF.GetEquippedObject 2

if GetCurrentTime >= 5.75 || Get Current Time <= 20.25

player.removeitem GhostRFire 1

endif

if GetCurrentTime >= 5.75 || GetCurrent Time <= 20.25

player.removeitem GhostRSkull 1

endif

An obvious issue with how I set it up, at least to my personal yet limited knowledge, is that it doesn't distinguish if it's the correct headpieces or not, and it might just remove whatever is in the scripted slots.

Any help would be appreciated!

Link to comment
Share on other sites

Hi, I'm not sure I understood exactly what you expect.

But that script is close I think. Adapte it. It's not the best script of the Nexus but it should work.

You'll notice I cut the day in 3 parts: It s because the game seems to not understand that when a day ends... an other starts ^^

 

 

scn MyScript

 

Begin Gamemode

 

If (Player.HasPerk MyPerk)

If (GameHour > 5.75 && GameHour < 20.25)

If Player.GetItemCount MyArmorA >= 1

Player.RemoveItem MyArmorA 1

endif

If Player.GetItemCount MyArmorB >= 1

Player.RemoveItem MyArmorB 1

endif

endif

Elseif (GameHour >= 20.25 && GameHour <= 24)

If Player.GetItemCount MyArmorA < 1

Player.AddItem MyArmorA 1

player.EquipItem MyArmorA

endif

If Player.GetItemCount MyArmorB < 1

Player.AddItem MyArmorB 1

player.EquipItem MyArmorB

endif

endif

Elseif (GameHour > 0 && GameHour <= 5.75)

If Player.GetItemCount MyArmorA < 1

Player.AddItem MyArmorA 1

Player.EquipItem MyArmorA

endif

If player.GetItemCount MyArmorB < 1

Player.AddItem MyArmorB 1

Player.EquipItem MyArmorB

endif

Endif

Endif

 

End

 

 

 

Edit you also can test, but I'm not sure:

 

If (Player.HasPerk MyPerk)

If (GameHour > 5.75 && GameHour < 20.25)

If Player.GetItemCount MyArmorA >= 1

Player.RemoveItem MyArmorA 1

endif

If Player.GetItemCount MyArmorB >= 1

Player.RemoveItem MyArmorB 1

endif

endif

 

Elseif (GameHour >= 20.25 && GameHour <= 24) || (GameHour > 0 && GameHour <= 5.75)

If Player.GetItemCount MyArmorA < 1

Player.AddItem MyArmorA 1

Player.EquipItem MyArmorA

endif

If player.GetItemCount MyArmorB < 1

Player.AddItem MyArmorB 1

Player.EquipItem MyArmorB

endif

Endif

Edited by GePalladium
Link to comment
Share on other sites

Thank you for the script. However, I've been tinkering with it, and I have to say that it doesn't seem to work in my case. I might be inserting it into the wrong method or something, I don't know. Basically, I have it set to an actor effect inside a perk, but even with the perk active, it doesn't swap the armor out during night-time. Is there something I'm doing wrong, something I could check? Any input would be helpful, thank you!

Link to comment
Share on other sites

Thank you for the replies! I actually don't know how to do that yet, how am I supposed to go about doing so? Do I make a new quest or something along those lines? Again, I'm very inexperienced at scripting, the small paragraph of code I wrote before took me hours to put together. ^^; Is there a tutorial for making it a base for a quest script? Anything I can use for reference? o-o

Link to comment
Share on other sites

When you make a script in geck after you set it as new there is a dropdown menu on the right of the script screen defaults to object the other 2 are quest and effect. I am relatively weak at scripting myself I just know the basics of using GECK and what setups to use for what I want to achieve. When it comes to the actual scripting it's trial and error for me (I sucked at scripting and animating in class) until I ask for assistance myself. As for setting up a quest I don't think you gotta do that just set the script as a quest script. GePalladium will correct me if I am wrong on that. I've just gotten into actual quest creating.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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