View previous topic :: View next topic |
Author |
Message |
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Tue May 11, 2010 13:21 Post subject: nwnx_dmactions (win32) |
|
|
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 |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Tue May 11, 2010 20:17 Post subject: |
|
|
Windows version is now fully ported. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Wed May 12, 2010 0:35 Post subject: |
|
|
You're awsome! |
|
Back to top |
|
|
Disco
Joined: 06 Dec 2006 Posts: 152
|
Posted: Tue May 18, 2010 12:10 Post subject: |
|
|
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 |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Tue May 18, 2010 15:15 Post subject: |
|
|
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 |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Tue May 18, 2010 16:21 Post subject: |
|
|
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 |
|
|
Asparius
Joined: 18 Sep 2007 Posts: 52
|
Posted: Mon May 24, 2010 3:42 Post subject: |
|
|
Great work. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Tue Jun 08, 2010 17:06 Post subject: Question |
|
|
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 |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Tue Jun 08, 2010 19:25 Post subject: |
|
|
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 |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Tue Jun 08, 2010 19:28 Post subject: Ahh cool |
|
|
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 |
|
|
Dorakhan
Joined: 24 Jun 2009 Posts: 2
|
Posted: Sat Jun 25, 2011 23:51 Post subject: |
|
|
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 |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Sun Jun 26, 2011 22:16 Post subject: |
|
|
I'll take a look on this problem soon. |
|
Back to top |
|
|
Wart
Joined: 13 Jun 2012 Posts: 45
|
Posted: Sat Aug 18, 2012 15:56 Post subject: |
|
|
Can the last version of this plugin be ported to windows? |
|
Back to top |
|
|
Wart
Joined: 13 Jun 2012 Posts: 45
|
Posted: Sun Nov 04, 2012 2:02 Post subject: |
|
|
Any hope to see the porting of the latest version? |
|
Back to top |
|
|
Valgav
Joined: 28 Aug 2010 Posts: 53
|
Posted: Thu Feb 12, 2015 20:09 Post subject: |
|
|
Any chance that someone has any version of this port? I couldn't find that on git |
|
Back to top |
|
|
|