Jump to content

How to apply a script to a Static Object?


KDStudios

Recommended Posts

Okay so after a long time of taking a break in Modding I've finally decided to mess around.

So I reinstalled Fallout 3 and the GECK and to my surprise the GECK is like it was when I first came upon it... A puzzle :D

 

Things are slowly coming back to me, the more I load up my older mods and see what makes them tick, the quicker it seems to come.

Well, that and my fiancée (Emma, AKA Wiccan0Witch) glancing over my shoulders and pointing out my stupidity in places. Yes... The master who taught the student is now being taught BY the student http://forums.nexusmods.com/public/style_emoticons/dark/armscrossed.gif

How she remembers all of this when she's not been modding longer than I have is beyond me. Maybe it's a gender thing and we males just forget more :P

 

But to the matter at hand,

I remember running into this problem with Falloutcraft.

I want to attach a script to a static object.

The script is compiled and will work. All I need is a way to attach it to the object.

But Bethesda in all it's wisdom never added an option to attach a script to a Static object.

 

How on earth could I possibly achieve this?

 

Ps. I'd much prefer to avoid using FOSE/NVSE if possible. However if you know how to achieve this using FOSE/NVSE I'll gladly hear it. Any option is better than no option :D

 

If you're curious, here's the script. It will even give you a hint at what I'm trying to achieve ;)

 

 


scn KDSWDChopTreeScript

int iHealth
int iStage

float fTimer

Begin OnHitWith KDSWDWeapAxe

       if ( iHealth == 2 )
               Player.AddItem KDSWDPlank 1
               Disable
               MarkForDelete
       else
               Set fTimer to 2
               Set iStage to 1
               Set iHealth to iHealth + 1
       endif

End

Begin GameMode

       if ( fTimer > 0 )
               Set fTimer to fTimer - GetSecondsPassed
       elseif ( iStage == 1 )
               Set iStage to 0
               Set fTimer to 0
               Set iHealth to 0
       endif

End

 

 

 

Here's something I posted not too long ago that is related to the mod I'm making:

The Image

Edited by KDStudios
Link to comment
Share on other sites

Just make a new activator, open an activator, change it's name and, navigate it's model to the static you want to use. attach your new script to it. (I'm sure you know how to do all of that, I'm just over explaining. http://forums.nexusmods.com/public/style_emoticons/dark/whistling.gif)

 

It seems like the easiest thing to do without having to mess with scripting. http://forums.nexusmods.com/public/style_emoticons/dark/thumbsup.gif

 

Hope that helps.

 

chuck

Link to comment
Share on other sites

Yeah that was my first thought, as that's what I did in Falloutcraft.

Sadly this is next to impossible to do.

As I'm aiming to be able to chop down the trees of the wasteland.

As you can imagine... Swapping them all with Activators will be... Well let's not go there :P

 

Although I appreciate the reply, it's been a long time :P

Link to comment
Share on other sites

It might not be as impossible as you think.

 

You can change the type of some of the base objects without problems.

 

So if you create the activator as Chuck says, then edit the FormID of that to whatever the FormID of he tree is, all those tree-ref's in the wasteland will be using your new base object.

 

No guarantees that this will work as I've not tried Static->Activator. I can say that Activator->Container works without a hitch though.

Link to comment
Share on other sites

Just create a new activator for one tree model, then use the 'find and replace' option in the top menu. Then repeat with each tree type.

 

Other than replaces those statics with activators, there's no other way. If you're hoping to be able to activate a tree, then it has to be an activator.

Link to comment
Share on other sites

Just make a new activator, open an activator, change it's name and, navigate it's model to the static you want to use. attach your new script to it. (I'm sure you know how to do all of that, I'm just over explaining. http://forums.nexusmods.com/public/style_emoticons/dark/whistling.gif)

 

It seems like the easiest thing to do without having to mess with scripting. http://forums.nexusmods.com/public/style_emoticons/dark/thumbsup.gif

 

Hope that helps.

 

chuck

I was wondering the same thing as the OP, and your answer will work for mine just fine. Thanks!

It sure beats replacing 114 static objects with an activator, manually (which is what I'd started to do) :)

Link to comment
Share on other sites

It might not be as impossible as you think.

 

You can change the type of some of the base objects without problems.

 

So if you create the activator as Chuck says, then edit the FormID of that to whatever the FormID of he tree is, all those tree-ref's in the wasteland will be using your new base object.

 

No guarantees that this will work as I've not tried Static->Activator. I can say that Activator->Container works without a hitch though.

Oooh I remember that working a few times for other types. I'll be certain to give it a try!

But after trying rjhelms idea first. I'll let you guys know how it goes.

 

Just create a new activator for one tree model, then use the 'find and replace' option in the top menu. Then repeat with each tree type.

 

Other than replaces those statics with activators, there's no other way. If you're hoping to be able to activate a tree, then it has to be an activator.

I had completely forgot about that feature!

Thanks for reminding me. I'll be certain to try it out, although I cannot predict how it could affect the GECK and the system stability of it. There are tens of thousands of trees in the world. Heh.

Link to comment
Share on other sites

What are you going to do about the LOD trees once they are chopped down? Not to be a bummer, but...

 

My view of this is "Stuff the LOD"

It's a pain for people who make custom worldspaces and it'll be an even bigger pain for this if people are going to chop down the trees.

Not worth the time and probably not worth the effort either.

Let's not forget about such mods like RTS, Wasteland Defence and PortableCampStuff, you can build things, but that won't generate LOD for it. This is the same principle, only the opposite.

However, there's not much I can do about it unless anyone has an idea about it.

 

Anyway.

I managed to swap all the trees with activators.

Problem now is that the game refuses to open with the mod activated.

Think I'm going to have to approach this from a different angle, test this with fresh esp's.

If however the problem is with the game and I can't change all the trees to activators without the game crashing. I may need to think of new ways to acquire lumber.

Playing Skyrim has given me an idea of a chopping block, but I'd rather avoid something like that. Bit unrealistic for my liking.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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