Jump to content

Figuring out the script extenders/engines??


twistsword

Recommended Posts

Posted

It seems some of the most useful mods make use of some of the script engines out there (ScriptDragon or SKSE) and so for my goal of being able to easily arm and equip NPCs I decided this would be my trial.

 

The first thing I looked for was a way to add items (baby steps) and I found one in the trainer for ScriptDragon. Pushing 6 equips the user with a variety of daedric items.

 

The list of items you get was listed in the file trainer.cpp so I added a few items to the end of the list like so (as this looks to be just an array that populates variables).

 

 

int daedric_ids[] = {

ID_TESObjectWEAP::DaedricBow,

ID_TESObjectWEAP::DaedricDagger,

ID_TESObjectWEAP::DaedricGreatsword,

ID_TESObjectWEAP::DaedricMace,

ID_TESObjectWEAP::DaedricSword,

ID_TESObjectWEAP::DaedricWarhammer

ID_TESObjectARMO::HTcloth,

ID_TESObjectARMO::HTBoots,

ID_TESObjectARMO::ArmorSPACuirass,

ID_TESObjectARMO::ArmorSPABoots,

ID_TESObjectARMO::ArmorSPAGauntlets,

ID_TESObjectARMO::RCBcloth,

ID_TESObjectARMO::RCBBoots,

ID_TESObjectARMO::DarkStringCuirass,

ID_TESObjectARMO::RingofTheWarriorStone,

};

 

The items were Hentai Bikini, Rainbow Bikini and Skimpy Plate Armor (and gauntlets and boots)

 

Of course, those are just the names I needed the ID codes so I found the file enums.h in the common folder. I found the armor section and added the items in question.

 

 

namespace ID_TESObjectARMO

{

enum

{

DremoraBoots = 0x00016FFF,

DremoraRobesBlack = 0x00016FFE,

EnchArmorElvenShieldBlock04 = 0x0010FC28,

EnchArmorElvenShieldBlock03 = 0x0010FC27,

(....)

SkinNaked = 0x00000D6

HTcloth = 0x137777de

HTBoots = 0x137777df

ArmorSPACuirass = 0x197777e3

ArmorSPABoots = 0x197777e4

ArmorSPAGauntlets = 0x197777e5

RCBcloth = 0x198888a1

RCBBoots = 0x198888a2

DarkStringCuirass = 0x2901393e

RingofTheWarriorStone = 0x2B001000

};

}

 

I did NOT add the items to ID_TESObjectARMA as well (still confused by the difference between those) but decided to run a test and see if those items added to the inventory.

 

Nope.

 

Anyone have any idea what I might be doing wrong? Any suggestions as to guides, resources or the like to be able figure out how to use the script extenders/engine like either SKSE or ScriptDragon?

 

This is my first attempt at this and so far - I am not accomplishing much.

Posted

Ok after long minutes/hours of messing with the files and not seeing noticeable changes I thought that it was that I was screwing up format/syntax or definitions.

 

So I figured when you do not know something at least test based on what you DO know. So I used items that are not mods and are standard well known game items.

 

Nada.

 

Then I took an existing amount of items it added and changed the # instead of adding ANY new items. No change. I was baffled.

 

Was I writing/reading it wrong?

 

Nope. The truth is that it was much worse. I was/am a moron. I was messing with source files not realizing that the code that generates the actions in the game is the asi file.

 

Ok, so I am not a programmer.

 

 

Now I just have to research how to turn the .cpp files written for scriptdragon into .asi files. At least I know what does not work.

 

But I did notice a lot of capability for mods in the Script Dragon and by reading the Decorator's Assistant, Souls to Perks and various Trainer sources for the routines I am getting a better understanding of at least how things can be modified now.

 

Clearly I feel like a guy that is posting about learning about painting his living room wall on a forum where accomplished painters of portrait and landscape art frequent but I could find NOTHING helping someone trying to start using the script extenders to do simple things they cannot find mods for.

 

But at least I clearly have a better idea of what not to do, so that is a start.

Posted

Ok after long minutes/hours of messing with the files and not seeing noticeable changes I thought that it was that I was screwing up format/syntax or definitions.

 

So I figured when you do not know something at least test based on what you DO know. So I used items that are not mods and are standard well known game items.

 

Nada.

 

Then I took an existing amount of items it added and changed the # instead of adding ANY new items. No change. I was baffled.

 

Was I writing/reading it wrong?

 

Nope. The truth is that it was much worse. I was/am a moron. I was messing with source files not realizing that the code that generates the actions in the game is the asi file.

 

Ok' date=' so I am not a programmer.

 

 

Now I just have to research how to turn the .cpp files written for scriptdragon into .asi files. At least I know what does not work.

 

But I did notice a lot of capability for mods in the Script Dragon and by reading the Decorator's Assistant, Souls to Perks and various Trainer sources for the routines I am getting a better understanding of at least how things can be modified now.

 

Clearly I feel like a guy that is posting about learning about painting his living room wall on a forum where accomplished painters of portrait and landscape art frequent but I could find NOTHING helping someone trying to start using the script extenders to do simple things they cannot find mods for.

 

But at least I clearly have a better idea of what not to do, so that is a start.

[/quote']

 

EDIT - looked for compilers out there and found one called codeblocks. Interestingly enough, when I tried to compile the source code (unmodified) to learn how to make asi files, the build test failed because the void main () line in the code gave me an error.

 

Researching further I read a number of diatribes against the evil of void main () (!!) so codeblocks is out, but I did see that visual studio express should work so I am installing the free version and hoping it lets me do this.

 

The irony is that I HAVE a developer that I use for work purposes and now I see how hard his job is. Because he is coding in C++, Objective C and C# and I am pretty sure one of these languages is what I am messing with (C++?)

 

 

 

Posted

Success!

 

Ok for those of you as clueless as I am, here is what you do.

 

First, you need to find source to work off...those would be the .cpp and .h files that usually are listed when someone does a mod they put on something like github.

 

What that is, is C++.

 

So go to the mod and find what you want to change. In my instance, I wanted a way to add certain armor to inventory for my later attempt to force add and force equip NPCs so I do not have to go through the effort of trying to strip them, and manually equip each item.

 

Once you make your changes (assuming in a text editor) then save it.

 

Now you need to compile this into your file. This is what screwed me up as I had no idea what I was doing downloaded C# Visual Studio express and sat perplexed as nothing compiled.

 

So download TWO programs (one if you are smarter than I am). First CodeBlocks (you can google that up). It is free, and it never likes half the mod script that is out there (since it hates the void main() thing that is used so often) but it does a great job of stopping on errors (usually ones caused my your changing things) and then making it easy to figure out why. So if you are changing things it is a good step #1.

 

Then download Visual Studio Express C++ (Not C#!!) by Microsoft. It is free and you need it.

 

Finally CREATE COPY OF THE FOLDER WITH THE FILES YOU ARE TRYING TO MODIFY. Trust me, if you screw up you want to know you have the original somewhere. Then load Visual Studio express and open project, go to the folder you created as a copy and open the file (usually something like FILENAME.vcxproj)

 

On the far left you will see a series of files (the .cpp files) associated and select the one you modified (or want to modify).

 

At the beginning of the file you will see a list of entries like #include FILE1, etc. These are files the file needs to get information from so make sure to read through those. In my example, to add new nonreplacer armors I had to add those to the file ENUMS that TRAINER used to get the reference IDS.

 

Once all your changes are made you are ready to save.

 

Go to Debug and click BUILD. (this is also how I debug in CodeBlocks)

 

Now if you continue using CodeBlocks it will have problems with some of the mod script but if you are using Visual Studio 2010 keep reading.

 

Now to Compile you have to go to TOOLS, then SETTINGS and click EXPERT SETTINGS which will allow you to see COMPILE under the DEBUG list. Click Compile and it will save your file as an .asi file under the bin folder that was just created.

 

Now simply drag that ASI file into you had the old asi working in and it will replace functionality with the new changes.

 

Remember you are standing on the shoulders of giants here, someone else created the code that got you there but at least it is a start.

 

Note, I have no idea what I am doing but it works so if anyone sees anything wrong or dangerous please let me know.

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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