Jump to content

Need help with Notification script on player's equipped body slot.


Recommended Posts

Hello,

 

I wanted to create a script that checks if the player character has armor parts equipped on their respective body slots and shows a repeated notification text depending on that (within some time intervals).

For example, as long as the player has no armor piece on their torso (body slot 41), the script would show a message informing about this every 5 minutes (or less, or more - doesn't matter at this moment I guess).

 

Unfortunately, I'm a complete bonehead as for scripting or coding, tried to read some tutorials, checked CK Wiki, but I just don't seem to understand all this coding language.

I tried to compile a short script that shows a message just once at least, but it turned out a mess:

 

Event OnInit()
if (Game.GetPlayer().WornCoversBipedSlot(41) == 0)
Debug.Notification("Message text here")
endIf
EndEvent
Actually I don't even know what I'm doing wrong here.
Is there a good soul out there to give a hand in this? Or at least push me in the right direction? :)
Thank you in advance!
Link to comment
Share on other sites

Thank you for your answer!

 

I guess a long script learning is ahead of me, because I have no idea how to make a function or loop a quest. Zero coding knowledge and script understanding here... I'll try to play with things then.

As for F4SE, I have it installed. Do I need to write something in the script to make it work through F4SE, or will the application recognize the script by itself somehow? Or do I need to put the script file into F4SE folder?

Link to comment
Share on other sites

Since you have installed it, which means u have copied everything under the scripts folder of F4SE to default Fallout 4 scripts folder, you are good to go.

 

On second look, is there a "WornCoversBipedSlot" function? The closest I see is "GetWornItem". But "GetWornItem" returns a struct so u can't just compared like what you did. You can check out creationkit wiki page (https://www.creationkit.com/fallout4/index.php?title=GetWornItem_-_Actor) to see how it is used. Maybe something along the line of wornItem.Item.GetName() to get a string and compare if it is the item u wanna check.

 

BTW, if u r using F4SE it means u can't port your mod to the console ...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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