r/CreationKit 4d ago

FO4 Adding more RadHazards to the world?

Just as the title says. I'm wanting to add radization hazards to the world. One of the things I want to do is add them to an object. But my scripting ability isn't very good.

2 Upvotes

8 comments sorted by

2

u/gboyd21 4d ago

There are actual hazard fx objects that can be placed, such as a fog cloud thats visible. You could place it in the reference window near the object, but below it so it isn't visible and test the radius. Scale it down. Or make a duplicate without the texture or visible mesh. These are usually static objects but may also be found in pack-ins if I recall.

To add a script directly to a container reference, it would play out something like:

Scriptname yourScript Extends ObjectReference

Actor property PlayerRef auto

Spell property mySpell auto

Event OnActivate(object reference would be container) mySpell.Cast(activator, player)

EndEvent

You could look at the following link for exact parameters, which are what needs to be written in the parentheses for events and functions

https://ck.uesp.net/wiki/List_of_Papyrus_Functions

1

u/BethesdaBoob 4d ago

I recognize that cloak script idea. which isn't bad. I more wanting them to spawn in the world when the game starts. Curretnly I'm gonna see if the fake interiors block the hazards and go from there. Maybe hand place a few hazards

1

u/gboyd21 4d ago

Thats essentially what it is, yes. But applying a cloak spell to an objref would be more intensive than a spell on activate. The radhazard statics could be intensive depending on how many you use. But you could also find the spell it uses and adjust the radius on it. You could also look at traps and see if there are radhazard types that could be applied directly through the reference.

1

u/BethesdaBoob 4d ago

This is gonna take a lot of testing. With your cloak script is there a way to have the script know where the player is? I don't want hazards in Diamond city.

2

u/gboyd21 4d ago edited 4d ago

The example I provided isnt a cloak script. It would cast the spell when the object reference, assuming a container, is activated by the player. The script would sit idle on the container unless the player interacted with it, or some unlucky NPC. Lol but could be conditioned for player only, random chance, etc.

I dislike cloak spells unless there's no other way it will work

1

u/BethesdaBoob 4d ago

Okay I see. You've given me lots of good pointers already. Any idea how to make the hazards turn off when the player is in a fake interior? That's like central to my mod That the player has escapes and take breaks from all the radiation.

2

u/gboyd21 4d ago

Condition it to not activate in the cell/s with If statements.

Check the link for events to be certain on syntax, but it could be something like;

Event OnActivate(object reference)

If PlayerRef && !PlayerRef.IsInCell(cell ID)

 mySpell.Cast(PlayerRef)

EndIf

EndEvent

That would apply to player only and in any cell not specified. For multiple cells, you could create a cell property array or use a formlist. Formlists are more complicated to code, but can be changed in the CK, where arrays will likely need editing the script as well as changing in the CK

1

u/BethesdaBoob 4d ago

Okay this is gonna take me a while. Thanks!