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 
 
Port Function from Linux funcsext to Windows

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
BelowTheBelt



Joined: 28 Jul 2010
Posts: 29

PostPosted: Fri Apr 24, 2015 17:19    Post subject: Port Function from Linux funcsext to Windows Reply with quote

Would someone be willing to help port the linux function CreateGenericTriggerOnLocation from the linux funcsext plugin to windows? I'm happy to support/test/do whatever, but have no clue how to start.

(Thanks to Bhaal for finding this function in the linux version)
GitHub here


Essentially, I'm needing to be able to spawn a trigger from a script. THis seems to spawn a trap and then convert that trap into either a generic trigger or an area transition.

object CreateGenericTriggerOnLocation(location lLocation, float fSize=2.0f, string sTag="") {
object oTrigger = CreateTrapAtLocation(1, lLocation, fSize, sTag);
if(GetIsObjectValid(oTrigger)) {
SetLocalString(oTrigger, "NWNX!FUNCSEXT!SETISGENERICTRIGGER", " ");
DeleteLocalString(oTrigger, "NWNX!FUNCSEXT!SETISGENERICTRIGGER");
}
return oTrigger;
}

Thanks!
_________________
www.arenthyor.com
Back to top
View user's profile Send private message Visit poster's website
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Apr 29, 2015 14:06    Post subject: Reply with quote

Do you have IDA infront of you with the nwserver symbols for win32?

Code:

*(dword*)&pSetIsTrap = 0x081f3078;
   *(dword*)&pSetIsAreaTransition = 0x081f2e5c;


void SetIsGenericTrigger(CNWSTrigger *pTrigger) {
   pSetIsTrap(pTrigger, 0);
   pSetIsAreaTransition(pTrigger, 0);
}

void SetIsAreaTransition(CNWSTrigger *pTrigger) {
   pSetIsTrap(pTrigger, 0);
   pSetIsAreaTransition(pTrigger, 1);
}


These linux addresses point to methods:
I dunno what the exact name of the methods are.
It seems that by setting a Trigger to be not a trap, or a transition, then it by default will be a Generic Trigger.


The key to a port, will be finding out what the official name of those methods are, and finding their counterparts in the win32 symbols.
Back to top
View user's profile Send private message
BelowTheBelt



Joined: 28 Jul 2010
Posts: 29

PostPosted: Sat May 02, 2015 0:03    Post subject: Reply with quote

Thanks for the help!!

What is IDA? I'll get it, but need a little help in the right direction... Very Happy

Regarding the symbols, from the below comment from the forum previously, it 'may' exist in the windows _funcs plugin? What file should I look in to pull it out? This is the best my google-fu has been able to turn up.


Posted: Mon Mar 14, 2011 19:10 Post subject: Reply with quote
Short answer: yes, there are 'official' symbols for nwserver.exe, they're just not embedded in the .exe itself. Contact me or any other NWNX developer to get them.
Regarding the Win32 version of Core-2.8 NWServer API: as far as I know, MaxRock already has something similar in his nwnx_funcs plugin.

I don't mind giving a go with a little bit (read that as 'a lot') of help.

Thanks!
_________________
www.arenthyor.com
Back to top
View user's profile Send private message Visit poster's website
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu May 07, 2015 15:28    Post subject: Reply with quote

IDA stands for Interactive Disassembler or something along those lines.

https://www.hex-rays.com/products/ida/

It is possibly one of the better ones to use with nwn and nwnx development.

There are symbols - I have a copy of them, I think the community tries to avoid posting them on public sites to avoid hacker/script kiddies from messing with other peoples PW.
I will see if I can host them somewhere for you to download from.

Try getting IDA free version, or dare I say it..... 'acquire' a full version through whatever means you want...

IDA can then open the symbols, and let you get the memory addresses of the methods within the nwserver executable.
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 technical support All times are GMT + 2 Hours
Page 1 of 1

 
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