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_funcs for windows
Goto page Previous  1, 2, 3 ... 11, 12, 13 ... 27, 28, 29  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jun 30, 2010 18:26    Post subject: Not easy Reply with quote

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
View user's profile Send private message
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Wed Jun 30, 2010 19:04    Post subject: Re: Not easy Reply with quote

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. Smile

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 Smile
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jun 30, 2010 19:15    Post subject: Reply with quote

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
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Thu Jul 01, 2010 2:28    Post subject: Reply with quote

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 Crying or Very sad

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
View user's profile Send private message Send e-mail MSN Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Jul 01, 2010 2:41    Post subject: Laughs My Ballz Off Reply with quote

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
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Thu Jul 01, 2010 3:19    Post subject: Re: Laughs My Ballz Off Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Jul 01, 2010 3:21    Post subject: Reply with quote

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
View user's profile Send private message
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Thu Jul 01, 2010 4:14    Post subject: Reply with quote

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 Smile

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
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Thu Jul 01, 2010 4:39    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message Send e-mail MSN Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Jul 01, 2010 6:56    Post subject: Reply with quote

There is a repository for NWNX-Win32 already, why don't you use it?
http://nwn.virusman.ru/trac/nwnx2-win32/
Btw, there is a way to get rid of asm inlines:
http://nwn.virusman.ru/trac/nwnx4/browser/trunk/src/plugins/ruby/hook.cpp#L40
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Fri Jul 02, 2010 4:59    Post subject: Reply with quote

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
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Fri Jul 02, 2010 19:34    Post subject: Reply with quote

virusman wrote:
There is a repository for NWNX-Win32 already, why don't you use it?
http://nwn.virusman.ru/trac/nwnx2-win32/


Very well, I will be using it Smile

virusman wrote:

Btw, there is a way to get rid of asm inlines:
http://nwn.virusman.ru/trac/nwnx4/browser/trunk/src/plugins/ruby/hook.cpp#L40


If that's what I think it is and how it's supposed to work: That's brilliant! Very Happy
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Sethan



Joined: 04 Oct 2008
Posts: 47

PostPosted: Sun Jul 04, 2010 1:43    Post subject: Reply with quote

*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
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Sun Jul 04, 2010 3:24    Post subject: Done Reply with quote

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
View user's profile Send private message
Sethan



Joined: 04 Oct 2008
Posts: 47

PostPosted: Mon Jul 05, 2010 4:55    Post subject: Reply with quote

Aha - missed that. Excellent.
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 Previous  1, 2, 3 ... 11, 12, 13 ... 27, 28, 29  Next
Page 12 of 29

 
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