Jump to content

Lutana NVSE Plugin


ChianasGeek

Recommended Posts

Posted

"Does it clash with the NX Extender?" is probably the important question many of us are probably thinking or possibly not thinking :)

Guest luthienanarion
Posted

The array/formlist thing looks pretty neat. Loogie mentioned this mod to me and the fileexists function as well, but I haven't tried any of it yet.

ListToArray was at Gribble's request. He much prefers working with arrays over form lists, and converting one to an array is much faster in C++ than using the game's scripting engine. I was scratching my head over how to return an array until I examined your NX source.

 

"Does it clash with the NX Extender?" is probably the important question many of us are probably thinking or possibly not thinking :)

No, it won't conflict with any of the existing published NVSE plugins.

Posted

Looking this plugin, and the whole NVSE and its functions... oh and I can't forget about the first person camera, of course! that's one of these! well, this all really makes me wonder.

If people can introduce new unbelievable things, new functions, why can't people change something else about the engine itself? I mean, is there a big difference?

To explain better... The game didn't give me the possibility to GetKeyPressed. Then someone did it, and to my eyes this seems a miracle. NVSE seems really a miracle to me. So for example wouldn't be possible for these people to make other miracles like that, change something else in the engine... you know all those little annoying things... like... just to make a RANDOM example... ... adding custom paths for animgroups... ? :)

Posted

Probably possible. Not trivial by any means.

 

NVSE development is reverse engineering the game EXE to find the function entry points, decode the data structures, and so on. Every new feature that gets added to NVSE is basically a 'crack' of the EXE implemented nearly from scratch. NX (and other plugin) functionality is far simpler, but can only use engine functions and data structures already exposed by NVSE.

 

NVSE and SKSE progress so rapidly because the engine is basically the same since oblivion, so most of the data structures and code from OBSE work with little modification -- it's "just" the entry points and other locations in the EXE that need to be found.

Guest luthienanarion
Posted

Jazz tasked me with creating a function that returns an actor's current combat style: essentially a port of OBSE's GetCombatStyle.

bool Cmd_CCCGetCombatStyle_Execute(COMMAND_ARGS)
{
    *result = 0;
    UInt32 *refResult = (UInt32*)result;
    if(!thisObj) return true;
    if(thisObj->baseForm->typeID == kFormType_Creature)
    {
        TESCreature* creature = DYNAMIC_CAST(thisObj->baseForm, TESForm, TESCreature);
        if(creature) *refResult = creature->combatStyle->refID;

    }
    else if(thisObj->baseForm->typeID == kFormType_NPC)
    {
        TESNPC* npc = DYNAMIC_CAST(thisObj->baseForm, TESForm, TESNPC);
        if(npc) *refResult = npc->unk1D4->refID;
    }
    return true;
}

This works for finding the combat style set for an actor's base form, but I can't seem to get it working for an actor's reference, which can have its combat style changed via SetCombatStyle.

I've tried using "TESCreature* creature = DYNAMIC_CAST(thisObj, TESObjectREFR, TESCreature)" but that seems to fail the "if(creature)" condition afterward. The same goes for NPCs.

 

Any ideas?

Guest luthienanarion
Posted

The Creature class doesn't seem to exist. Unfortunately, the Character, Actor, MobileObject, and TESObjectREFR classes either don't contain the info I'm looking for or it's not decoded. I only found unk1D4 in the TESNPC class because it's declared as a TECCombatStyle.

Ah, well. I'll put that function on hold.

Posted

So it seems Creature never been required yet :)

CombatStyle for actors are stored as ExtraData type 0x69 ExtraCombatStyle.

 

It should be implemented as :

class ExtraCombatStyle : public BSExtraData
{
public:
	ExtraCombatStyle();
	virtual ~ExtraCombatStyle();

	TESCombatStyle    combatStyle;		// 00C
};


Guest luthienanarion
Posted

I see. Thanks, jaam.

 

 

 

Edit: You missed a dereference operator:

 

class ExtraCombatStyle : public BSExtraData
{
public:
    ExtraCombatStyle();
    virtual ~ExtraCombatStyle();

    TESCombatStyle*    combatStyle;        // 00C
};

I have the function working the way I want it to now. Thanks again. :)

Archived

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

  • Recently Browsing   0 members

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