Jump to content

[LE] Not a Scripter


Recommended Posts

I've seen a few mods that give you a portable enchant table that comes out of your inventory and back again

I'd go take a long look at how that was done.

_____________

 

After thinking about this I remembered an old mod I put together.

Here are a few clipped snips ...

 

 

Activator vB

Int o1

 

Event OnInit()

o1 =(New ObjectReference)

vB =(Game.GetFormFromFile(17074860,"rgd.esp") as Activator)

...

...

 

Self.setForm(vB as form,cX[p0]- 50,cY[p0],p2- 40,0,0,0,1)

 

 

Function SetForm(Form sObj,Int xPos,Int yPos,Int zPos,Int xAng,Int yAng,Int zAng,Float sScale)
ObjectReference Obj=(Game.GetPlayer().PlaceAtMe(sObj, 1, false, false))
Obj.SetAngle(xAng as Float, yAng as Float, zAng as Float)
Obj.SetPosition(xPos as Float, yPos as Float, zPos as Float)
Obj.SetScale(sScale)
o1 =(Obj)
EndFunction
Function ClearForm()
o1.Delete()
o1 =(None)
EndFunction

 

In this case via script I set down the activator object where I wanted and removed it in real time on the fly.

The snips had to be heavily modified as they did much more than this with way more objects.

But, this technique should work in your case very well. Sorry it's so raw but, you should be able to

convert it to your use. With a bit of tweaking and a whole lot of testing :tongue:

Edited by NexusComa
Link to comment
Share on other sites

To get that number you need to look at your object. It's object number will be in hexadecimal you will need to convert that to decimal.

Then just aim it at your mod name. This allows you to pull objects into your scripts via script. Once that is done the Function setForm

let's you drop it down anyplace you wish based off where the player is standing ...

 

Function SetForm(your Object,X,Y,Z,XAngel,YAngel,ZAngel,Scale)

Edited by NexusComa
Link to comment
Share on other sites

All i can really decipher is having the mesh of the misc object 'exchange' with the desirable object.

 

Is that the goal here?

Is there actually a script command (or group of commands) that changes the Form of the object to something else upon certain parameters? That would probably be the easiest route and most ideal.

 

Is it possible to essentially "swap" items with another item? SetForm? ChangeForm? Something?

 

The hexadecimal codes, are those the same codes found through the 'help' function in Skyrim command menu?

Link to comment
Share on other sites

I'm just putting this out there. GetFormFromFile works just fine with the hex ID#. It does not need to be converted to decimal. All that is required is that the load order digits (first two) remain zero as the function looks inside the targeted ESP/ESM file rather than scanning the entire load order.

 

Example line of code pulled from a fully functional script:

(Game.GetFormFromFile(0x0016638D,ModName) as FormList).HasForm(TheItem)

And yes, you can get the Editor ID from the in-game console. You can also get it by looking up the object in the Creation Kit and / or TES5Edit.

Link to comment
Share on other sites

The hex code is right on the object top right i believe.

 

No it's not exchanging, it's putting it down after pulling the object right from the mod itself.

After thinking about this .. this may not work for you as with this method you need to know exactly where you

want to place the object. You would have to test if havoc would drop it in place for you.

Link to comment
Share on other sites

Maybe I should have chose a different second mod to make.

 

I still can't even find a decent reference, maybe this is what I get for getting into a game's modding scene 7 years after it's release, aye?

 

https://forums.nexusmods.com/index.php?/topic/951098-how-to-create-a-placeable-static/?p=7672595

 

The comment by unuroboros is EXACTLY what I want to do but he hasn't been on since last November so I'm assuming he left.

Edited by YellowJacketXV
Link to comment
Share on other sites

  • Recently Browsing   0 members

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