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 
 
Plugin & Script Request: OnAttack
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Sun Mar 04, 2007 15:21    Post subject: Reply with quote

scarface wrote:
It would only work if the attacker actually pulled of a hit, that's why we need an OnPhysical/SpellcastAt event. Using hides and on-hit isn't really going to help determine the first attacker because If the attacker misses, and the attackee hits first, wouldn't they be flagged as the first attacker? It's a decent suggestion but won't be much use in this PvP scenerio.


Ah, cmon, now you're just nitpicking. Razz That, plus a 'first damager' rule and you're set. Combine with a local set from the spellhook and you can pretty much always discern who's bs'ing. Course it'll be a moot point once virusman does his thing. Wink
Funky
Back to top
View user's profile Send private message
scarface



Joined: 12 Jun 2005
Posts: 94
Location: Sweden

PostPosted: Sun Mar 04, 2007 20:37    Post subject: Reply with quote

FunkySwerve wrote:
scarface wrote:
It would only work if the attacker actually pulled of a hit, that's why we need an OnPhysical/SpellcastAt event. Using hides and on-hit isn't really going to help determine the first attacker because If the attacker misses, and the attackee hits first, wouldn't they be flagged as the first attacker? It's a decent suggestion but won't be much use in this PvP scenerio.


Ah, cmon, now you're just nitpicking. Razz That, plus a 'first damager' rule and you're set. Combine with a local set from the spellhook and you can pretty much always discern who's bs'ing. Course it'll be a moot point once virusman does his thing. Wink
Funky


I'm not nitpicking at all mate Razz I need a reliable way to determine the first attacker/hostile actor, and the way you suggested is by no means reliable for that scenerio, getting the first damager isn't going to tell us who attacked who first which is what we need and the major reason I need this event hooked.
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Sun Mar 04, 2007 21:27    Post subject: Reply with quote

Yeah...that's why the first damager rule. Laughing Anyway, looks like you'll get your plugin. Smile
Funky
Back to top
View user's profile Send private message
milliorn



Joined: 03 Jun 2006
Posts: 29

PostPosted: Mon Mar 05, 2007 3:34    Post subject: Reply with quote

ondamage wouldnt settle in a pvp module(arena, hak n slash, etc) cause like mentioned before, a module's team needs to know who initated the pvp, not who damaged first with physical attack or spellcasted. problem lies with lets say "effortless" rated players making first strike, failing, an impossible rated player auto-attacking back, to just a mage trying to stay alive yet perhaps not break a server rule about no effy killing. could say perhaps well why are the two in same area? well some modules perhaps have areas that overlap territory for one reason or another. another reason being in an arena enviroment also.

besides tracking down pickpocketing an having it dealt with scripts instead of logs be one less task an report a dm has to handle. imo most module teams wish for there dm's to have more room to be a dm, more so than a "cop". for those activites scripts are unbias, dont show any favortism, just flat out enforces a rule Very Happy

thank you very much virusman for getting involved. when your done the time be worth the wait. now, just need someone to write up some code perhaps to hook it to the module an nwnx Very Happy
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Mon Mar 05, 2007 18:07    Post subject: Reply with quote

milliorn wrote:
ondamage wouldnt settle in a pvp module(arena, hak n slash, etc) cause like mentioned before, a module's team needs to know who initated the pvp, not who damaged first with physical attack or spellcasted.


As with most things, you can make up for engine shortcomings with well-crafted rules (for instance, first damager rather than first attacker). Of course, the plugin is preferable, I'm not naysaying that, I was merely suggesting an alternative for the meantime, but it sounds like you aren't interested. I'm also fairly certain the impossible rated player in your scenario would have to hostile the effy before he'd take an AoO.
Funky
Back to top
View user's profile Send private message
milliorn



Joined: 03 Jun 2006
Posts: 29

PostPosted: Mon Mar 05, 2007 18:12    Post subject: Reply with quote

FunkySwerve wrote:
milliorn wrote:
ondamage wouldnt settle in a pvp module(arena, hak n slash, etc) cause like mentioned before, a module's team needs to know who initated the pvp, not who damaged first with physical attack or spellcasted.


As with most things, you can make up for engine shortcomings with well-crafted rules (for instance, first damager rather than first attacker). Of course, the plugin is preferable, I'm not naysaying that, I was merely suggesting an alternative for the meantime, but it sounds like you aren't interested. I'm also fairly certain the impossible rated player in your scenario would have to hostile the effy before he'd take an AoO.
Funky

perhaps true from reading what your saying. but, the point still is that effy's will go out an start fights with imp's to get killed an punish imps in some modules. basically they know they will not damage the imp, an depending on what build imp has, auto attack in some cases, will kill the effy, thus giving a false report. this is what im hoping to stamp out, by finding who initated the pvp period, same goes with pickpocket Very Happy your logic most likely will work in most modules, but where pvp is very intense, the ability to enforce a no effy killing rule, imo can only be done by first determing who initated the pvp action, not who took first blood... Smile
Back to top
View user's profile Send private message
milliorn



Joined: 03 Jun 2006
Posts: 29

PostPosted: Mon Mar 05, 2007 18:17    Post subject: Reply with quote

funky: if i sound argumentive, I apologize. im being persistant on this from experience in PvP modules. we all respect you highly for your awesome work with HGLL an SimTools, im along with Scar is just pushing this being that we truely need this form of functionality that is not available in the form we wish to have.
Back to top
View user's profile Send private message
scarface



Joined: 12 Jun 2005
Posts: 94
Location: Sweden

PostPosted: Mon Mar 05, 2007 22:20    Post subject: Reply with quote

FunkySwerve wrote:
milliorn wrote:
ondamage wouldnt settle in a pvp module(arena, hak n slash, etc) cause like mentioned before, a module's team needs to know who initated the pvp, not who damaged first with physical attack or spellcasted.


As with most things, you can make up for engine shortcomings with well-crafted rules (for instance, first damager rather than first attacker). Of course, the plugin is preferable, I'm not naysaying that, I was merely suggesting an alternative for the meantime, but it sounds like you aren't interested. I'm also fairly certain the impossible rated player in your scenario would have to hostile the effy before he'd take an AoO.
Funky


I'm not nitpicking again, just letting you know Surprised but not all AoE spells need you to be hostile to harm you, prehaps with certain rulesets, but as it is we use the normal ruleset and most AoEs do damage players even non hostile (except in no PvP areas of course).
Back to top
View user's profile Send private message
milliorn



Joined: 03 Jun 2006
Posts: 29

PostPosted: Tue Mar 06, 2007 17:54    Post subject: Reply with quote

well, virusman said he was gonna produce a plugin, so I think next step is to see who is going to volunteer some time to hook this plugin into a module Very Happy
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Tue Mar 06, 2007 21:53    Post subject: Reply with quote

scarface wrote:
FunkySwerve wrote:
milliorn wrote:
ondamage wouldnt settle in a pvp module(arena, hak n slash, etc) cause like mentioned before, a module's team needs to know who initated the pvp, not who damaged first with physical attack or spellcasted.


As with most things, you can make up for engine shortcomings with well-crafted rules (for instance, first damager rather than first attacker). Of course, the plugin is preferable, I'm not naysaying that, I was merely suggesting an alternative for the meantime, but it sounds like you aren't interested. I'm also fairly certain the impossible rated player in your scenario would have to hostile the effy before he'd take an AoO.
Funky


I'm not nitpicking again, just letting you know Surprised but not all AoE spells need you to be hostile to harm you, prehaps with certain rulesets, but as it is we use the normal ruleset and most AoEs do damage players even non hostile (except in no PvP areas of course).


You haven't applied PvP fixes?? I coulda sworn you had some posted to the vault, though I don't know if they included AoE fixes. Simple hostile checks will handle that, and you'll have to make those changes (as well as the spellhook edits), and some tweaks to the summoning ai, if you want a complete check, as onattack probably won't handle those. Ondamaged, on the otherhand, probably would, though I'm unsure if appying a damage effect constitutes a 'hit' - guessing yes.
Funky
Back to top
View user's profile Send private message
scarface



Joined: 12 Jun 2005
Posts: 94
Location: Sweden

PostPosted: Wed Mar 07, 2007 16:02    Post subject: Reply with quote

FunkySwerve wrote:
scarface wrote:
FunkySwerve wrote:
milliorn wrote:
ondamage wouldnt settle in a pvp module(arena, hak n slash, etc) cause like mentioned before, a module's team needs to know who initated the pvp, not who damaged first with physical attack or spellcasted.


As with most things, you can make up for engine shortcomings with well-crafted rules (for instance, first damager rather than first attacker). Of course, the plugin is preferable, I'm not naysaying that, I was merely suggesting an alternative for the meantime, but it sounds like you aren't interested. I'm also fairly certain the impossible rated player in your scenario would have to hostile the effy before he'd take an AoO.
Funky


I'm not nitpicking again, just letting you know Surprised but not all AoE spells need you to be hostile to harm you, prehaps with certain rulesets, but as it is we use the normal ruleset and most AoEs do damage players even non hostile (except in no PvP areas of course).


You haven't applied PvP fixes?? I coulda sworn you had some posted to the vault, though I don't know if they included AoE fixes. Simple hostile checks will handle that, and you'll have to make those changes (as well as the spellhook edits), and some tweaks to the summoning ai, if you want a complete check, as onattack probably won't handle those. Ondamaged, on the otherhand, probably would, though I'm unsure if appying a damage effect constitutes a 'hit' - guessing yes.
Funky


Nah, I created fixes for no pvp exploits, not pvp fixes (confused yet? lol), I fixed the kind where you can kill players in no PvP areas, if I were to fix all spells that kill non hostile players in pvp areas, i'd have to modify almost every damage AoE spell in the game, and i'm not patient enough Very Happy
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Mar 07, 2007 21:59    Post subject: Reply with quote

I had some free time today. Smile
First results:
Code:
const int EVENT_SAVE_CHAR = 1;
const int EVENT_PICKPOCKET = 2;
const int EVENT_ATTACK = 3;

void main()
{
    SetLocalString(OBJECT_SELF, "NWNX!EVENTS!GETEVENTID", "      ");
    int nEventType = StringToInt(GetLocalString(OBJECT_SELF, "NWNX!EVENTS!GETEVENTID"));
    WriteTimestampedLogEntry("NWNX Event fired: "+IntToString(nEventType)+", '"+GetName(OBJECT_SELF)+"'");
    switch(nEventType)
    {
        case EVENT_PICKPOCKET:
            object oPC = OBJECT_SELF;
            object oTarget = GetLocalObject(OBJECT_SELF, "NWNX!EVENTS!TARGET");
            WriteTimestampedLogEntry(GetName(oPC)+" tried to steal from "+GetName(oTarget));
    }
}

Code:
[Wed Mar  7 22:53:46] NWNX Event fired: 2, 'Test Player'
[Wed Mar  7 22:53:46] Test Player tried to steal from Dummy
[Wed Mar  7 22:53:53] NWNX Event fired: 2, 'Test Player'
[Wed Mar  7 22:53:53] Test Player tried to steal from Dummy

PickPocket event is hooked. Attack is on the way.
I had to modify NWNX2 core library to hook GetLocalObject as well.

P.S. The first release will be Linux only.
P.P.S. List of possibly "hookable" actions (loc_* are unidentified functions; this list does not include party, DM, inventory functions):
Code:
dd offset pcActMove
dd offset pcActAttack
dd offset pcActUseDoor
dd offset pcActEmote
dd offset pcActExamine
dd offset pcActCastFeat?
dd offset pcActUseSkill
dd offset pcActTalkTo
dd offset pcActUseItem
dd offset pcActToggleMode
dd offset pcActUse
dd offset pcActPickLock
dd offset pcActRest
dd offset pcActLockUnlock?
dd offset glb_8190801
dd offset loc_818F53C
dd offset loc_818F610
dd offset pcActCastSpell
dd offset pcActPossessFamiliar
dd offset loc_818FFA8
dd offset pcActDebugInfo
dd offset pcActMergeItems
dd offset pcActSplitItems
dd offset pcActPause
dd offset loc_81904AC
dd offset loc_8190544
dd offset pcActUnpossessFamiliar
dd offset pcActMoveKeyTurn
dd offset pcActMoveKeyMove
dd offset loc_8190670
dd offset pcActDownloadChar
dd offset pcActSaveGame
dd offset pcActMoveKeyRelease
dd offset pcActAbortAction
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Wed Mar 07, 2007 22:40    Post subject: Reply with quote

While we're at it, can you think of any way to allow an instant item use without a hak? Very Happy Planning to add some really cool stuff to SIMTools in nwn2, especially with some of the soon-to-be-added commands, but haks in 2 are considerably less problematic since players have to download anyway.

Idea would be to fire off an intant-use item on voice command to pull up a targeting cursor, so that voice commands not sent in tells would get targeted with the targeting cursor. In nwn2 1.06 they have a function for this, but in nwn its haxxors all the way.

Or, since you are the master, what about a function to pull up a targeting gui like in 1.06? Here's the link:
http://oeiprogrammer.blogspot.com/search/label/1.06


Thanks,
Funky
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Mar 07, 2007 22:55    Post subject: Reply with quote

FunkySwerve wrote:
While we're at it, can you think of any way to allow an instant item use without a hak? Very Happy Planning to add some really cool stuff to SIMTools in nwn2, especially with some of the soon-to-be-added commands, but haks in 2 are considerably less problematic since players have to download anyway.

Idea would be to fire off an intant-use item on voice command to pull up a targeting cursor, so that voice commands not sent in tells would get targeted with the targeting cursor. In nwn2 1.06 they have a function for this, but in nwn its haxxors all the way.

Or, since you are the master, what about a function to pull up a targeting gui like in 1.06? Here's the link:
http://oeiprogrammer.blogspot.com/search/label/1.06


Thanks,
Funky
I can't make a trageting GUI, but instant item use must be possible.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Mar 07, 2007 22:59    Post subject: Reply with quote

NWNX Events 1.0 beta (Linux)
http://data.virusman.ru/nwn/nwnx_events-1.0beta-linux.rar
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 of 6

 
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