View previous topic :: View next topic |
Author |
Message |
Jambo
Joined: 24 Sep 2008 Posts: 22
|
Posted: Wed Sep 24, 2008 8:23 Post subject: |
|
|
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.
And I'll check out nwnx_structs, thanks! |
|
Back to top |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Sat Feb 07, 2009 22:04 Post subject: |
|
|
With great fields description of nwn structs in nwnx includes it wasn't hard to
create few functions which I needed (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 |
|
|
kucik
Joined: 11 Feb 2009 Posts: 19 Location: Czech Republic
|
Posted: Wed Feb 11, 2009 16:39 Post subject: |
|
|
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 |
|
|
Quixsilver
Joined: 20 Jan 2009 Posts: 30
|
Posted: Fri Feb 20, 2009 3:55 Post subject: |
|
|
Any chance of getting SetOverrideBAB() into this plugin? |
|
Back to top |
|
|
Lokey
Joined: 02 Jan 2005 Posts: 158
|
Posted: Fri Feb 20, 2009 5:45 Post subject: |
|
|
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 |
|
Back to top |
|
|
acaos
Joined: 08 May 2007 Posts: 153
|
Posted: Sun Feb 22, 2009 10:21 Post subject: |
|
|
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 |
|
|
Quixsilver
Joined: 20 Jan 2009 Posts: 30
|
Posted: Tue Feb 24, 2009 3:11 Post subject: |
|
|
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 |
|
|
Quixsilver
Joined: 20 Jan 2009 Posts: 30
|
Posted: Wed Feb 25, 2009 5:36 Post subject: |
|
|
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 |
|
|
Borys
Joined: 21 May 2008 Posts: 10 Location: Poland
|
Posted: Wed Feb 25, 2009 10:19 Post subject: |
|
|
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 |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Wed Feb 25, 2009 18:40 Post subject: |
|
|
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 |
|
|
Borys
Joined: 21 May 2008 Posts: 10 Location: Poland
|
Posted: Wed Feb 25, 2009 23:37 Post subject: |
|
|
When u turn off AI even HB script is not called. On AI Very Low hb script is called. |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Thu Feb 26, 2009 21:41 Post subject: |
|
|
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 |
|
|
Borys
Joined: 21 May 2008 Posts: 10 Location: Poland
|
Posted: Fri Feb 27, 2009 16:33 Post subject: |
|
|
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 |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Fri Feb 27, 2009 17:17 Post subject: |
|
|
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 |
|
|
jangle
Joined: 03 Mar 2009 Posts: 1
|
Posted: Tue Mar 03, 2009 6:43 Post subject: |
|
|
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 |
|
|
|