logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
nwnx_dmactions (win32)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
axs



Joined: 11 Feb 2005
Posts: 76

PostPosted: Tue May 11, 2010 13:21    Post subject: nwnx_dmactions (win32) Reply with quote

I've begun porting nwnx_dmaction to windows.
This is very early release, my first touch with development for win32 NWNX2, so things need tests.

Plugin is fully ported, current functionality:

  • DM_ACTION_MESSAGE_TYPE - Catch almost every dm message and prevent it (fe dumpvars, setvars, setstats)
  • DM_ACTION_GIVE_XP
  • DM_ACTION_GIVE_LEVEL
  • DM_ACTION_GIVE_GOLD
  • DM_ACTION_CREATE_ITEM
  • DM_ACTION_HEAL_CREATURE
  • DM_ACTION_REST_CREATURE - multiselection suported, create your own multiselection tool (example code in package)
  • DM_ACTION_RUNSCRIPT - lets control which scripts can be run
  • DM_ACTION_CREATE_PLACEABLE

Hope you will enjoy. Please post if there are any problems.

DLL and Sources: http://x.nwns.pl/


Last edited by axs on Wed May 12, 2010 10:00; edited 1 time in total
Back to top
View user's profile Send private message
axs



Joined: 11 Feb 2005
Posts: 76

PostPosted: Tue May 11, 2010 20:17    Post subject: Reply with quote

Windows version is now fully ported.
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Wed May 12, 2010 0:35    Post subject: Reply with quote

You're awsome! Very Happy
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Disco



Joined: 06 Dec 2006
Posts: 152

PostPosted: Tue May 18, 2010 12:10    Post subject: Reply with quote

Could you explain where you use this for. I got some ideas myself, but I am interested in the thoughts behind the plugin.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue May 18, 2010 15:15    Post subject: Reply with quote

Disco wrote:
Could you explain where you use this for. I got some ideas myself, but I am interested in the thoughts behind the plugin.
Hey, myself I dont consider this something extra but it is surely useable.

1) DM resurrection and ability to bind it with custom persistent death
2) Give XP rewrite via SetXP, by default this DM function uses GiveXP which has racial penalty and often wont "persist" after relog!
3) Giving gold for logging purposes, some peoples using gold tracking feature (im not one of them)

However many of us already workarounded these via DM wand, but there is one more thing you can do with this.

4) bad DM logging, you now can log all actions so you always know that your DM gave big advantage to his friend or so... this was requested many times

Well im not sure if I use it myself, however doing this axs surely was worth, the more things will be available on windows the better. Thanks.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
axs



Joined: 11 Feb 2005
Posts: 76

PostPosted: Tue May 18, 2010 16:21    Post subject: Reply with quote

Mostly, logging and access control (fresh dms have no access to item creation, no access to SetVar* dm_dumplocals* etc.)

And tools,
creating placeable for persist decorations.
changed dm rest radial menu position to multiselection tool,
alternative heal code.

I think there are lots of possible uses.
Back to top
View user's profile Send private message
Asparius



Joined: 18 Sep 2007
Posts: 52

PostPosted: Mon May 24, 2010 3:42    Post subject: Reply with quote

Great work.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue Jun 08, 2010 17:06    Post subject: Question Reply with quote

I have a question regarding the dm plugin, and about its capabilities.

Say for instance, you run a PW, where you have artifacts, and powerful items that exist in the game world as a single pickup EVER.

Obviously, the last thing you want is a DM spawning these specific items, and screwing up your artifact system.


The way mine worked, was that the monsters would have a rare chance to drop one, and then it looks in database for a resref of an artifact that has not been dropped yet, then when it picks one, it removes it from the database, and spawns it on the monster.

If the player picks it up, then it gets totally removed from database, if not picked up, it gets re-added on next server reset.

Obviously there is 3 different things that a dm could do to mess around with this.

Spawn artifact on ground
Spawn artifact on creature/player
Spawn artifact on container


Is this dm plugin, capable of 'blocking' the spawn item command conditionally, based on the tag or resref of the item being requested?


Eg - Allow dm's to spawn any item, but when they try to spawn an artifact
"Artifact Spawning is Forbidden at your Access Level"
or something like that.


Now, I know that you have provided a script with your plugin, which does the switch statement, and it could be used sorta for what I need to use it for.

But what I dont know is, if someone uses the dm spawn function on a player for instance, does the code in the switch statement get run
Before the item appears
or
After the item appears.

If it gets run before, and can then block the item from appearing, then nothing to worry about.

If it gets run after, and then I would have to signal a delete of the item manually, then this causes problems, cause then I have to tell the artifact system to disregard the 'acquire' event of the artifact being acquired by t he player.


Any insight?
Back to top
View user's profile Send private message
axs



Joined: 11 Feb 2005
Posts: 76

PostPosted: Tue Jun 08, 2010 19:25    Post subject: Reply with quote

The hook begins after item is loaded but not added yet to inventory or area.
As in example, when DM spawn item that cost more then 10000 script will prevent item appearing in object inventory, after that DestroyObject is needed,else we will cause some kind of memory leak, item will be not accesible in limbo.
Code:

    if(nAction == DM_ACTION_CREATE_ITEM_ON_OBJECT) {
        object oTarget = oGetDMAction_Target();
        object oItem = oGetDMAction_Target(TRUE);
        WriteTimestampedLogEntry("DM Action: <"+GetName(oDM)+"> (CreateItem "+GetResRef(oItem)+") <"+GetName(oTarget)+"> <"+(GetIsPC(oTarget)?GetPCPlayerName(oTarget):GetTag(oTarget))+">");
        if(GetGoldPieceValue(oItem) > 10000) {// Prevent creation of expensive items
            PreventDMAction();
            DestroyObject(oItem); // Clean up; We don't need it anymore?
        }
    }


With this plugin you can do pretty nice access control system, storing rights in vars and prevent access to dm_dump* dm_setvar* SetVar*.


Last edited by axs on Tue Jun 08, 2010 19:29; edited 1 time in total
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue Jun 08, 2010 19:28    Post subject: Ahh cool Reply with quote

Ahh, I get it now.

So it does prevent it from appearing in inventory, the DestroyObject method acts more like a back end clean up of sorts.


Thats exactly what I needed to hear. Means that onAcquire shouldnt be fired for the player/creatures who are targets of the GiveItem dm method.
Back to top
View user's profile Send private message
Dorakhan



Joined: 24 Jun 2009
Posts: 2

PostPosted: Sat Jun 25, 2011 23:51    Post subject: Reply with quote

Not sure if anyone has had this issue (I realize this is an old thread), but certain length returns from "RUNSCRIPT" will crash the module.

EX: FOG_ICY will not crash it, but CATAPULT_BOULDER will.

I tried changing the buffer length and the string compare lengths in the source code, but this didn't help.

Any advice?
Back to top
View user's profile Send private message
axs



Joined: 11 Feb 2005
Posts: 76

PostPosted: Sun Jun 26, 2011 22:16    Post subject: Reply with quote

I'll take a look on this problem soon.
Back to top
View user's profile Send private message
Wart



Joined: 13 Jun 2012
Posts: 45

PostPosted: Sat Aug 18, 2012 15:56    Post subject: Reply with quote

Can the last version of this plugin be ported to windows?
Back to top
View user's profile Send private message
Wart



Joined: 13 Jun 2012
Posts: 45

PostPosted: Sun Nov 04, 2012 2:02    Post subject: Reply with quote

Any hope to see the porting of the latest version?
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Feb 12, 2015 20:09    Post subject: Reply with quote

Any chance that someone has any version of this port? I couldn't find that on git
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group