Author Topic: What would you do with these events?  (Read 426 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
What would you do with these events?
« on: January 07, 2015, 09:02:23 pm »


               
EVENT_INVALID

EVENT_SAVE_CHAR

EVENT_PICKPOCKET

EVENT_ATTACK

EVENT_EXAMINE

EVENT_TOGGLE_MODE

EVENT_STEALTH_MODE

EVENT_DEVASTATING

EVENT_UNPOLYMORPH

EVENT_TRAPTRIGGER

EVENT_ENDDIALOG

EVENT_ENDSANCTUARY


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
What would you do with these events?
« Reply #1 on: January 07, 2015, 11:28:39 pm »


               Where have you seen those constants? I'm not aware of them, but others may know better.


The standard ones are here:


http://www.nwnlexico...php?title=Event


Used in the user-defined event to determine which event just occurred.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
What would you do with these events?
« Reply #2 on: January 07, 2015, 11:29:43 pm »


               

I assume nwnx_cool / events?


 


SAVE_CHAR -  If you do decide to implement some sort of system where characters are modified in ways that you do not want to persist via saving. Then you could use SAVE_CHAR to bypass the save event. Eg: If a player had their appearance changed - you could use the bypass to avoid saving the character, while theyre appearance is messed up etc.


 


Attack - This fires when the enemy is clicked, not when a combat round determines an attack can be landed. This being the case- equip your character with a wand, and everytime you click on an enemy - make a magic missile visual fly off and impact the enemy - ala - Harry Potter wand fighting.


 


Toggle Mode - I use this with subraces: When a vampire uses stealth - they get turned invisible via nwnx_visibility hooks : not even dm's or allies can see them. (God characters can also do this - for an ingame/player centric dm invis mode)


 


Devastating - some people want to disable it - other mights want to change what it does: Eg: On devastating critical : if the player is a mage - incinerate the monster, instead of instant death.


 


The other ones - not sure.../


 


havent needed to use them myself.


 


Some hooks I have made however:


 


EVENT_SUMMONFAMILIAR
EVENT_SUMMONANIMALCOMPANION
 
EVENT_VALIDATECOUNTERSPELL
EVENT_EFFECTHANDLER_ONAPPLYDAMAGE

 


These were added to my nwnx as a necessity - to allow post level 40 leveling and companions to work.


However, now they are hooked - I am able to modify the companions and familiars via nwnscript.


Eg: Enhance them / Buff them as their master grows stronger - so too do they.


 


I have added a base increase to Ability Scores, Attack and AC of  : ((Master HitDice *2.25) * CurrentBaseValues) + CurrentBaseValues;


More the master levels up - the stronger his minions will get.


 


Validate Counterspell will fire when a mage tries to counter another mage.


I use it primarily to restock the mages spell casts - so they have unlimited countering ability. (Just for GOD Subrace)


 


On apply damage fires when a creature receives a damage effect:


I am able to modify the effect data before the creature actually suffers the effect.


Means I can heal creatures with fire, increase damage by flat % amounts etc, negate damage etc


One example is a feat I made : Adaptive Flesh


The more you suffer damage from one element, the more resistant you become to it.


(up to 95% resistance to one element (the dominant element from each attack) 5% per hit)


 


If the element changes (the dominant element in multi element attacks) - then the resistance will drop for the other elements, while the dominant one rises from 0 to 95  etc


 


Means the bearer of the feat can in effect - adapt to elemental attacks and become resilient towards specific foes.


Eg: Fighting a shadow who uses negative damage - the negative damage over the course of 20 hits could see his damage waning to 5% effectiveness


However, if the enemy uses multiple damages that alternate in strength- then the feat may not be able to adapt fully = vulnerability.


               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
What would you do with these events?
« Reply #3 on: January 08, 2015, 04:50:50 am »


               

Yes, I posted some events from my nwnx_events.dll 


 


You have good ideas with nwnx. Many of these events I see no need too. I'm currently using the event on unpolymorph to prevent exploits in my werewolf system. I have need to save the location whenever player leaves the game (to get their location onexiting).



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
What would you do with these events?
« Reply #4 on: January 08, 2015, 09:04:16 pm »


               

I currently use on examine to trigger my custom examine code when NWNX is available. Then the player doesn't have to use the custom radial but can use the normal one.  But that's just a convenience. The other radial is still present.  I may use some of the middle ones in the future.  PP, Devestating, Trap for example.  Fwiw.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
What would you do with these events?
« Reply #5 on: January 08, 2015, 11:25:19 pm »


               

@WhiteTiger-  I don't suppose you have the examine c++ code handy?


 


Is it the ASM version - where it is assembly code vs the c++ api?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
What would you do with these events?
« Reply #6 on: January 09, 2015, 04:30:14 am »


               


 


EVENT_INVALID

EVENT_SAVE_CHAR

EVENT_PICKPOCKET

EVENT_ATTACK

EVENT_EXAMINE

EVENT_TOGGLE_MODE

EVENT_STEALTH_MODE

EVENT_DEVASTATING

EVENT_UNPOLYMORPH

EVENT_TRAPTRIGGER

EVENT_ENDDIALOG

EVENT_ENDSANCTUARY

 




save char - for example bypass (cancel) the event if player is polymorphed (Note: no needed anymore with my fixes to polymorphing in 1.72beta)


pickpocket - i think this one is executed in the moment you click with pickpocket on a victim, not much usefull


attack - i used it for canceling attack on party members if player enabled this option in player menu, also used it in past in PvP arena module to disable attacking players outside +-5lvl range (opposed to penalizing for that)


examine - could be used to translate a note written in different language, if player knows that language you change the description of the item to english one, if not you make it foreign again, or as a trigger to something, if player examined door you trigger conversation with doors where you tell pc what he see through keyhole, etc. etc.


toggle mode - could be to alter default mode bonuses, for example if you would want to enforce 3.5 Expertise then you would apply 2 or 4AC penalty whenever E or IE is activated or to allow some custom content like item that grants +1 ac when stealthed etc.


devastating - not sure how this worked I think the devast wasnt possible to bypass so dont know what it was usefull for


unpolymorph - is possible to determine by standard means and not sure whether this one actually executed the "repolymorph" which is the problem with polymorphs (and I solved it in 1.72beta)


trap trigger - build in in toolset no idea why its added there


end dialog - same


end sanctuary - could be used to fix AI issues where they sometimes don't react after sanctuary ends


 


 


Anyway. Reading the responses, I would like to remind what I did in my Community Patch 1.72beta and NWNX_Patch + NWNCX_Patch plugin.


I have softcoded healing kits, death attack, devastating attack, animal companions, familiars. Builder can modify all these in NWScript directly, no hooking needed and works also for singleplayer (when client uses NWNCX).


As for polymorphing, I invented a new scripted "framework" (all in NWScript not using NWNX) that fixes all issues that polymorphing suffers:


- Temporary HitPoints stacking


- Losing merged itemproperties after "repolymorph" (which means that with my system its safe to export polymorphed characters)


- casting normal spells


- merged ability decreases now ignores immunity to ability decrease from shape or from other merged items


- dying after unpolymorph (and a related server crash)


- fixed prolonging the temporary shapes ad infinitum


- losing spellslots after polymorph/unpolymorph (this one requires the NWN©X running actually).


 


This plus new feature for builders, polymorph event, script that triggers when OnPolymorph, OnPrePolymorph, OnRePolymorph, OnUnPolymorph, these allows to dynamically (ie. without need to directly modify the scripts of the polymorph abilities) modify the stages of a polymorph, do something before it happens, after it happens, after internal repolymorph happens and after its canceled, most specifically the pre-polymorph is probably most usefull as it allows: cancel polymorphing effects completely (for example due to an immunity on such effect or because player has custom polymorph using SetAppearance and you dont want to allow change this appearance), modify the temporary hitpoints, modify the appearance (ie. if player is epic druid then dire bear is substituted with legendary bear etc.) or change the "locked" status (ie. if the polymorph is a bad effect from other person and its normally locked, then if the player is a shifter unlock it for him)



               
               

               
            

Legacy_Verilazic

  • Sr. Member
  • ****
  • Posts: 263
  • Karma: +0/-0
What would you do with these events?
« Reply #7 on: January 23, 2015, 03:11:42 pm »


               


EVENT_EXAMINE



 


What about using this to start a conversation? Like, the player goes to examine an NPC, and when they do, the NPC starts a conversation with them and says something like "What are you staring at?"