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 
 
Beta plugin: nwnx_funcs
Goto page Previous  1, 2, 3, 4, 5 ... 9, 10, 11  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Jambo



Joined: 24 Sep 2008
Posts: 22

PostPosted: Wed Sep 24, 2008 8:23    Post subject: Reply with quote

FunkySwerve wrote:
Casterlevel is scripted, so while I suspect it's possible to do, it wouldn't make a lot of sense to. For the effect id, you want nwnx_structs.

Funky


That was my thought (for caster level), but is that actually taken in to account for dispel checks ie, which all seem to be handled internally by the NWN engine (via EffectDispelMagicAll(nCasterLevel) ). I figured there had to be some internal calculation/tracking for the caster level Effects are applied with. It's those sort of situations I'd be interested in being able to make such a change, but it depends how it works. Maybe someone can shed light on what happens under the hood with EffectDispelMagicAll. Wink

And I'll check out nwnx_structs, thanks!
Back to top
View user's profile Send private message
axs



Joined: 11 Feb 2005
Posts: 76

PostPosted: Sat Feb 07, 2009 22:04    Post subject: Reply with quote

With great fields description of nwn structs in nwnx includes it wasn't hard to
create few functions which I needed Wink (thx acaos (?))
So I've added to funcs:

Get/SetPlaceableEventHandler
SetPlaceableHasInventory

Get/SetCostAddValue for items.

And standalone GetSet Events for creatures and plcs based on virusman's functions.

In both, it is impossible to add script if event field is empty in bluprint,
but this also apply for orginal SetEvents in nwnx_funcs and functions so this issue can be difficult to solve, especially for me ^^.

To be honest it's my first touch with C so code may be horrible.


tar contains only changed files and precompiled .so.
http://www6.zippyshare.com/v/74423818/file.html
Back to top
View user's profile Send private message
kucik



Joined: 11 Feb 2009
Posts: 19
Location: Czech Republic

PostPosted: Wed Feb 11, 2009 16:39    Post subject: Reply with quote

acaos wrote:

Code:
string GetEntireItemAppearance (object oItem);
void RestoreItemAppearance (object oItem, string sApp);
int SetItemAppearance (object oItem, int nIndex, int nApp);
int SetItemColor (object oItem, int nIndex, int nColor);


Acaos


I was looking for a maximum length of string returned by "GetEntireItemAppearance". I need to know it for DB table structure. So I looked into f_GetEntireItemAppearance.c. Is the 58chars real maximum?
I assume these functions are faster than compose item appearance throught CopyAndModifyItem, right?

Anyway thanks for this wonderfull job.
Back to top
View user's profile Send private message Visit poster's website
Quixsilver



Joined: 20 Jan 2009
Posts: 30

PostPosted: Fri Feb 20, 2009 3:55    Post subject: Reply with quote

Any chance of getting SetOverrideBAB() into this plugin?
Back to top
View user's profile Send private message
Lokey



Joined: 02 Jan 2005
Posts: 158

PostPosted: Fri Feb 20, 2009 5:45    Post subject: Reply with quote

Quixsilver wrote:
Any chance of getting SetOverrideBAB() into this plugin?

Doesn't the engine ignore this now (at least for players)?
_________________
Neversummer PW NWNx powered mayhem Wink
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Sun Feb 22, 2009 10:21    Post subject: Reply with quote

Thanks for the patch! I'll definitely look into it.

I believe the maximum length is indeed the 58 characters for any GetEntireItemAppearance() call. Yes, it is MUCH faster than CopyItemAndModify().

Yes, the engine ignores override BAB for PCs, but we could add it for creatures.

Acaos
Back to top
View user's profile Send private message
Quixsilver



Joined: 20 Jan 2009
Posts: 30

PostPosted: Tue Feb 24, 2009 3:11    Post subject: Reply with quote

acaos wrote:

Yes, the engine ignores override BAB for PCs, but we could add it for creatures.
Acaos


Thanks, override for creatures is precisely what I'm looking for.
Back to top
View user's profile Send private message
Quixsilver



Joined: 20 Jan 2009
Posts: 30

PostPosted: Wed Feb 25, 2009 5:36    Post subject: Reply with quote

Sorry, but i have another request.

Would it be possible to get the following added?

Get/SetFamiliarType
Get/SetFamiliarName
Get/SetCompanionType
Get/SetCompanionName
Back to top
View user's profile Send private message
Borys



Joined: 21 May 2008
Posts: 10
Location: Poland

PostPosted: Wed Feb 25, 2009 10:19    Post subject: Reply with quote

Or bether:
Code:
// oCreature: object creature
// arg:
// 0 - turn off ai (no cpu usage)
// 1 - turn on ai
SwitchAI( object oCreature, int arg );


Creature with turnded off AI dont run any script, dont use cpu...
From DM radial menu u can do this manualy but preaty good will be to use it on script level.
Back to top
View user's profile Send private message Visit poster's website
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Wed Feb 25, 2009 18:40    Post subject: Reply with quote

Use SetAILevel to set it to AI_LEVEL_VERY_LOW and make all scripts check for an integer set on the creature that stops them running.
Back to top
View user's profile Send private message
Borys



Joined: 21 May 2008
Posts: 10
Location: Poland

PostPosted: Wed Feb 25, 2009 23:37    Post subject: Reply with quote

When u turn off AI even HB script is not called. On AI Very Low hb script is called.
Back to top
View user's profile Send private message Visit poster's website
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Thu Feb 26, 2009 21:41    Post subject: Reply with quote

Borys wrote:
When u turn off AI even HB script is not called. On AI Very Low hb script is called.


Do you know the interval at which it is called? It's about once every 15-30 seconds. And adding in a check for the "off" variable will make the script cause no lag.

In short, I don't see an immediate problem.
Back to top
View user's profile Send private message
Borys



Joined: 21 May 2008
Posts: 10
Location: Poland

PostPosted: Fri Feb 27, 2009 16:33    Post subject: Reply with quote

I dont talk about HB script only (it is called every ~3sec, for sure not every 10sec). That was only example. When creature has AI off serwer dont do any actions on this creature (preceptions, walk random/wp/patrol, hb, ...).
Back to top
View user's profile Send private message Visit poster's website
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Fri Feb 27, 2009 17:17    Post subject: Reply with quote

Borys wrote:
I dont talk about HB script only (it is called every ~3sec, for sure not every 10sec). That was only example. When creature has AI off serwer dont do any actions on this creature (preceptions, walk random/wp/patrol, hb, ...).


I'm sorry to be blunt, but that's just incorrect.

Under normal AI level, the heartbeat script is called at most about once every 6 seconds. This also tends to be the case for low AI, although low AI heartbeats aren't given very much priority so it may extend to as much as an 8 second interval, possibly more in heavy lag. When you lower the AI level to AI_LEVEL_VERY_LOW, however, heartbeats on that creature just slow down to a crawl. If you want to check this yourself, put a heartbeat script that causes a creature to shout something, then turn its AI level down to AI_LEVEL_VERY_LOW. You will immediately see what I'm talking about.

All of the examples you gave are done directly as a result of script calls. Perception fires a script. Walk random is handled in the heartbeat. Walkwaypoints is also handled by the heartbeat script, as is patrol routes.

Code:
if (GetAILevel() == AI_LEVEL_VERY_LOW)
{
  return;
}


Add that to the top of every one of the creature scripts, and it will act just as if it had been turned off by a DM, when its AI level is set to AI_LEVEL_VERY_LOW.
Back to top
View user's profile Send private message
jangle



Joined: 03 Mar 2009
Posts: 1

PostPosted: Tue Mar 03, 2009 6:43    Post subject: Reply with quote

hello

i am having a mild problem and would like some help sorry if this has been asked before b/c i searched all i could.

anyways i'm not a very scripter and am trying to help someone out, but i am not sure how to approach the problem.

i want to apply the function setmovement rate on a pc as a temporary effect but i'm not sure how thru scripting can someone help me?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5 ... 9, 10, 11  Next
Page 4 of 11

 
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