View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Wed Jun 30, 2010 18:26 Post subject: Not easy |
|
|
Attack time is dependant on variables such as attacks per round etc per each character.
It would probably require alot of modifications, but alternatively, nwnx_funcs 'may' be able to affect the probability of hitting a target.
It would involve an event hook, on a nwn internal function that is called something like evaluatehit or something like that.
I know that hooking onto Devastating Hits has been done, and players can now change how these are handled by their own scripts.
Attacks in general, the best you could probably hope for is making your weapons do 0 damage, and have them do a unique power on hit, and then script in the dependancies that are required to inflict damage.
Attack Rate/Time is one of those things which is tied heavilly into the nwn internal 'circuitry' I believe, it would involve alot more modifications, than simple hooking can provide.
Would require some re-writes of the code inside nwn, which is in theory possible, via code caving etc. Many of the nwnx plugins use a code cave approach already. |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Wed Jun 30, 2010 19:04 Post subject: Re: Not easy |
|
|
Baaleos wrote: | Attack time is dependant on variables such as attacks per round etc per each character.
It would probably require alot of modifications, but alternatively, nwnx_funcs 'may' be able to affect the probability of hitting a target.
It would involve an event hook, on a nwn internal function that is called something like evaluatehit or something like that. |
I figured it would be difficult to change the attack delay. Seems like most of the game mechanics work around the 6 seconds/round.
Hooking the chance to hit would be a benefit though. That's something else that would help me out. Any ideas on how to start with that?
Quote: | Attacks in general, the best you could probably hope for is making your weapons do 0 damage, and have them do a unique power on hit, and then script in the dependancies that are required to inflict damage. |
Yeah, I'm working on something similar to that now. Different from changing the attack speed, but along the same lines.
Quote: | Would require some re-writes of the code inside nwn, which is in theory possible, via code caving etc. Many of the nwnx plugins use a code cave approach already. |
Not familiar with code caving. Will have to check it out.
Thanks |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Wed Jun 30, 2010 19:15 Post subject: |
|
|
CNWSCombatRound::InitializeAttackActions(unsigned long)
CNWSCombatRound::InitializeNumberOfAttacks(void)
CNWSCombatRound::ClearAllAttacks(void)
There are several other methods inside the CNWSCombatRound class which might be useful, they include the addition and removal of attacks from attack rounds.
Using them though, is another problem.
I am still noob at plugin creation, so wouldnt know where best to hook, and I especially dont know how to call internal methods without crashing the server yet.
Would be best if you asked someone else about these methods, they would likely do what you want to do, to a point, im just unsure how to hook them, without causing lag or crashes. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu Jul 01, 2010 2:28 Post subject: |
|
|
I've created a sourceforge project for nwnx_funcs; mostly to have a version control system (the vault's fine, but it's kind of a pain to package and upload stuff)
Repository URL
https://mrnwnxstuff.svn.sourceforge.net/svnroot/mrnwnxstuff/Trunk
Trac
http://sourceforge.net/apps/trac/mrnwnxstuff/
Project page
http://sourceforge.net/projects/mrnwnxstuff/
Just like Baaleos, I went "hook crazy" once I figured out how to do it, so there's a little more than just nwnx_funcs (but it's mainly for that).
nwnx_areas: It is a port of, and has the same functionality as virusman's linux version and is stable as far as I can tell.
nwnx_combat: Some combat related stuff I'm playing around with.
nwnx_trinity: Mostly stuff used by our nwn server. (the level cap remover doesn't quite work yet
All the projects are are part of the nwn_funcs solution. (Yea, yea, I know, I had no clue what I was doing.)
I'm also not too familiar with sourceforge or subversion, so bear with me when I screw things up. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Jul 01, 2010 2:41 Post subject: Laughs My Ballz Off |
|
|
Lol - Your AMAZING...
I dont care about the gender barrier.... I wana have your babies..
I turned NWNX_Areas when it first came out, into a method of players acquiring their own player housing, eg - It self reproduces the area, and changes some of the contents of the area, to make it personalized for the player.
The one thing I never had access to, was setting the areas name though.
Now we can have 'Baaleos' Abode....' Lol
The Trinity plugin, if it ever works, will be SOUGHT after by all.
The Combat one, if that is capable of creating our own combat engine, then it would be a great addition.
Eg - Overriding attacks, to say whether or not they hit or not hit, and control the damage.
For a server, such as mine, which is about vampires, who are meant to be agile, the ability to 'override' hit chances and make the vampires able to dodge on command, would be great. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu Jul 01, 2010 3:19 Post subject: Re: Laughs My Ballz Off |
|
|
Baaleos wrote: |
I turned NWNX_Areas when it first came out, into a method of players acquiring their own player housing, eg - It self reproduces the area, and changes some of the contents of the area, to make it personalized for the player.
|
You have to thank virusman for that one. I think the only actual difference is the resource manager hook to load areas with nwnx_resman; I don't have the source for the version I'm using, so it had to go in areas. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Jul 01, 2010 3:21 Post subject: |
|
|
I think another difference between yours and his, is that your windows one, has the AddAreaToCreatures method call.
Im not sure if it was left out of virusmans win32 release, but I know that the result was that if you joined the game before the area was created, then when you entered the area, it would be all perpetual darkness.
Not sure if it is different in yours, but heres hoping. Lol |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Thu Jul 01, 2010 4:14 Post subject: |
|
|
I ran through a little of your NWNX_Combat source. The first thing that stuck out for me was your comments. Thank you so much for adding them
Gonna see if I can learn a little more about how NWNX and the hooks work so I can start contributing to development as well. Keep up the great work! |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu Jul 01, 2010 4:39 Post subject: |
|
|
Baaleos wrote: | I think another difference between yours and his, is that your windows one, has the AddAreaToCreatures method call.
Im not sure if it was left out of virusmans win32 release, but I know that the result was that if you joined the game before the area was created, then when you entered the area, it would be all perpetual darkness.
Not sure if it is different in yours, but heres hoping. Lol |
It works fine with Mordenkainen's Magnificent Mansion |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
|
Back to top |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Fri Jul 02, 2010 4:59 Post subject: |
|
|
I'd recommend just defining a macro to make the class call so you aren't tied to using the __fastcall hack later if you want to, say, change to defining the class directly and completely filling out the vtable. Similar to the old COBJMACROS that you'll find for COM interfaces. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Fri Jul 02, 2010 19:34 Post subject: |
|
|
Very well, I will be using it
If that's what I think it is and how it's supposed to work: That's brilliant! |
|
Back to top |
|
|
Sethan
Joined: 04 Oct 2008 Posts: 47
|
Posted: Sun Jul 04, 2010 1:43 Post subject: |
|
|
*NWNXFuncs_SetAge* - Awesome.
One thing I haven't been able to find, is a method of setting racial type without using EffectPolymorph.
For PCs, you don't want to set their racial type outside the playable races - but we use a token system, whereby you can drop tokens on things to change their characteristics. Some of those are undead tokens (ghoul, skeleton, zombie), and when used on NPCs they give the NPCs the appropriate resistances and such. Most scripts can be changed to deal with that appropriately. The one thing we can't do is change the racial type so that weapons with 'vs. Undead' properties work correctly. This also means that the Bless Weapon spell doesn't work, since it adds a temporary weapon property vs. undead. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Sun Jul 04, 2010 3:24 Post subject: Done |
|
|
Code: |
// Set the racial type of oObject to iRace;
// Will not change the actual appearance of iObject
void NWNXFuncs_SetRace(object oCreature, int iRace);
|
This is already in nwnx_funcs.
This will work on Players, just as well as it will work on NPC's.
The effect may not reveal itself, until the object updates itself via equipping armor or something, but the change in the character screen should be instant.
Using some Race Numbers, may result in invisible appearances, but thats to be expected if you are setting a player to be Outsider or something.
I would, just to be safe, re-set appearance, back to what it is meant to be, after you use this function. |
|
Back to top |
|
|
Sethan
Joined: 04 Oct 2008 Posts: 47
|
Posted: Mon Jul 05, 2010 4:55 Post subject: |
|
|
Aha - missed that. Excellent. |
|
Back to top |
|
|
|
|
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
|