Broken Functions List
#26
Posté 29 mai 2012 - 10:19
(yep, still doing faction tribulations)
#27
Posté 31 mai 2012 - 01:38
AdjustReputation(x, y, n)
so ... *apparently* ( and i say apparently because so far there's no indication i'm not psychotic )
Apparently, the engine takes how x feels about y then adds n to how y feels about x ...
Note that when dealing with PC-faction these issues do not show up. That's because the engine happily transposes NPC-faction reps to PC-faction reps, so when using faction functions the order of (oPC, oNPC) does not seem to matter,
it ought come into play only when dealing with reputations between nonPC factions.
#28
Posté 19 juillet 2012 - 09:42
In the 'hench_i0_ai' script there's an 'InitializeItemSpells' function that, among other things, determines whether to exclude item "talents". Down about 45 lines from the start of the function, there is an 'if' statement that first checks if the creature is polymorphed, then looks to see if the first item in its inventory is valid. This code looks like the following (without the line wrapping):
if (bPolymorphed ||
!GetIsObjectValid(GetFirstItemInInventory()) ||
!GetCreatureUseItems(OBJECT_SELF))
{
gExcludedItemTalents |= TALENT_EXCLUDE_ITEM;
}
The issue here is that the 'GetFirstItemInInventory' call only checks the items in the unequipped inventory; it does not check the equipped items. This means if a creature has an equipped item with a usable property (like a staff or wand), it may not get used unless there is also an unequipped item in its inventory.There are several fixes for this:
- Always add an item to the inventory of creatures that have items with activated properties.
- Modify the above code to check for equipped items.
- In the Campaign spawn script, check whether the spawned creature has an equipped item with an item property. If it does, add a worthless item to the inventory. (For example, the 'broken item'.)
// Return TRUE if the target has an equipped item or inventory
int HasAnItem( object oTarget = OBJECT_SELF )
{
if ( GetIsObjectValid( GetFirstItemInInventory( oTarget ) ) )
return TRUE;
int nSlot;
for ( nSlot = INVENTORY_SLOT_HEAD; nSlot < NUM_INVENTORY_SLOTS; nSlot++ ) {
if ( GetIsObjectValid( GetItemInSlot( nSlot, oTarget ) ) )
return TRUE;
}
return FALSE;
}
It is called with a line like the following:
if ( bPolymorphed ||
!HasAnItem() ||
!GetCreatureUseItems( OBJECT_SELF ) )
{
gExcludedItemTalents |= TALENT_EXCLUDE_ITEM;
}
Modifié par rjshae, 19 juillet 2012 - 09:53 .
#29
Posté 29 juillet 2012 - 07:43
Set/GetFactionLeader: I couldn't get it to work for NPCs, GetFactionLeader always returned OBJECT_INVALID. Workaround: use a fixed set of faction leaders, and write your own GetFactionLeader function like this:
[nwscript]
object myGetFactionLeader(object oNPC)
{
object leader;
leader = GetObjectByTag("Leader_Faction1");
if (GetFactionEqual(oNPC, leader))
return leader;
leader = GetObjectByTag("Leader_Faction2");
if (GetFactionEqual(oNPC, leader))
return leader;
...
}
[/nwscript]
#30
Posté 29 juillet 2012 - 12:10
GetFactionLeader is not initialized. You have to intialize it yourself.diophant wrote...
putations seem to be broken (yes, I activated them in the campaign settings). Workaround: Change to STANDARD_FACTION_HOSTILE, or adjust the faction reputation. You might readjust the faction reputation in the onExit script of the area (see http://social.biowar...13272578-1.html).
Set/GetFactionLeader: I couldn't get it to work for NPCs, GetFactionLeader always returned OBJECT_INVALID. Workaround: use a fixed set of faction leaders, and write your own GetFactionLeader function like this:
[nwscript]
object myGetFactionLeader(object oNPC)
{
object leader;
leader = GetObjectByTag("Leader_Faction1");
if (GetFactionEqual(oNPC, leader))
return leader;
leader = GetObjectByTag("Leader_Faction2");
if (GetFactionEqual(oNPC, leader))
return leader;
...
}
[/nwscript]
social.bioware.com/%20http:/social.bioware.com/forum/1/topic/164/index/8906305#13260454
SetFactionLeader is supposed to make the npc it runs on the leader.
Modifié par kamal_, 29 juillet 2012 - 12:11 .
#31
Posté 29 juillet 2012 - 03:36
kamal_ wrote...
GetFactionLeader is not initialized. You have to intialize it yourself.diophant wrote...
putations seem to be broken (yes, I activated them in the campaign settings). Workaround: Change to STANDARD_FACTION_HOSTILE, or adjust the faction reputation. You might readjust the faction reputation in the onExit script of the area (see http://social.biowar...13272578-1.html).
Set/GetFactionLeader: I couldn't get it to work for NPCs, GetFactionLeader always returned OBJECT_INVALID. Workaround: use a fixed set of faction leaders, and write your own GetFactionLeader function like this:
[nwscript]
object myGetFactionLeader(object oNPC)
{
object leader;
leader = GetObjectByTag("Leader_Faction1");
if (GetFactionEqual(oNPC, leader))
return leader;
leader = GetObjectByTag("Leader_Faction2");
if (GetFactionEqual(oNPC, leader))
return leader;
...
}
[/nwscript]
social.bioware.com/%20http:/social.bioware.com/forum/1/topic/164/index/8906305#13260454
SetFactionLeader is supposed to make the npc it runs on the leader.
I initialized the faction leader on client enter, but GetFactionLeader still returned OBJECT_INVALID. Has somebody successfully used these functions?
#32
Posté 21 août 2012 - 12:52
( conversation check for Alignment )
line 55, change nCheck to nAlignCheck
#33
Posté 12 octobre 2012 - 02:59
rjshae wrote...
The ItemPropertyOnHitCastSpell call can be used to add a spell of type IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER to a weapon. When this is applied to a throwing weapon, however, an attack hit does not fire the on-hit-cast-spell script named "i_{THROWING ITEM TAG}_hc". This also does not work if you build a throwing weapon item with the property "On Hit Cast Spell: Unique Power (On Hit)".
This must have been fixed in a patch at some point, because it works now. My return-on-hit throwing weapon scripts utilise it.
#34
Posté 07 janvier 2013 - 05:23
// Get oCreature's animal companion creature type // (ANIMAL_COMPANION_CREATURE_TYPE_*). // * Returns ANIMAL_COMPANION_CREATURE_TYPE_NONE if oCreature is invalid or does // not currently have an animal companion. int GetAnimalCompanionCreatureType(object oCreature);
couldn't get it to work. It kept returning "-1"
So i'd beware this one too:
int GetFamiliarCreatureType(object oCreature);
#35
Posté 07 janvier 2013 - 06:02
#36
Posté 07 janvier 2013 - 07:17
tried both, and with the summons up and without ...
If you or someone can get it to work that be cool,
[edit] maybe, hold on .......
Modifié par kevL, 07 janvier 2013 - 07:22 .
#37
Posté 07 janvier 2013 - 07:53
when passing in my Badger (although the badger companion has Badger as its AC type in its properties). I thought for a moment that it was returning -1 because I was testing on one of Cyphre's extended companions #28 the Smilodon ... but the AnimalCompanionType is stored in the .Bic/.Ifo simply as an integer and that should not be a problem : just return the integer from character properties. But even when I swapped the Smilodon (#28) for a Badger (#0) it still gave me -1
when i passed in the Master, whether the companion was summoned or not; but when I passed in the companion, the Smilodon returned -1 as it has no AnimalCompanionType set in its blueprint, the Badger returned 255 as noted above ( probably because it doesn't have the Animal Companion feat )
But I really want to just grab the ACType straight from the PC properties GFF file 'cause it's right there in front of my eyes, listed "CompanionType" as an Int. ah well, more workarounds ...
#38
Posté 22 mars 2013 - 12:07
talent TalentSpell(int nSpell); talent TalentFeat(int nFeat); talent TalentSkill(int nSkill);
still broken.
int GetCreatureHasTalent(talent tTalent, object oCreature=OBJECT_SELF);
crash to desktop.
Use
talent GetCreatureTalentRandom(int nCategory, object oCreature=OBJECT_SELF, int iExcludedTalentsFlag = 0); talent GetCreatureTalentBest(int nCategory, int nCRMax, object oCreature=OBJECT_SELF, int iExcludedTalentsFlag = 0); int GetIsTalentValid(talent tTalent);
#39
Posté 07 avril 2013 - 09:40
DAMAGE_TYPE_ALL <--> DAMAGE_TYPE_BLUDGEONING
loL,
- a comment in 'nx_s0_glass_doppel_buff'
Confirmed in test. Plus, DT_Bludgeoning seems to be DT_All (vice versa). This is when used in EffectDamageReduction(), although i imagine that as an nwscript constant it might foobar be global ...// DAMAGE_TYPE_ALL is bludgeoning DR, don't ask me why
#40
Posté 07 avril 2013 - 10:19
(By the way, what did you change on Mass Deathward? I couldn't tell what was different.)
#41
Posté 08 avril 2013 - 12:02
just added Druid 9 to the castersList on MassDW (MotB addition). True Sight? I'm not sure, a couple years ago i had the same thoughts as others recently: does this work. Ark's right in that it shouldn't see through Stealth, but the only creature I've (not even) tested with is ... Dragons. They all have True Sight on their carapices -- which means it's an itemproperty like an amulet is. Spell Resistance taught us to be leary of itemproperties (though the vast majority work great). I'm thinking that, like SR, if a modder wants to be sure® of TS then apply it like an effect ( EffectTrueSeeing() )
all i can say without specific testing is that my playful dragons didn't let anything by ( w/ TS as itemproperty on their carapice ), although i also like to have their Spot & Listen up very high.
Thanks ... i think i might make that change for Dragons in the OC (True Seeing as effect, take it off the hide), or first do some tests vs. Greater Invis. if/when I get my head out from a score of discombobulated spellscripts .. & Factions still trouble me though i'm using scripts now that seem to make faction-decisions tighter and i got so upset with STANDARD_HOSTILE spellTargetting that i changed it to mean "start a riot" (hit everything, friend or foe! * ), which could well lead me back into more efforts on factions .....
* but not Plot
[ edit ] looks like Dann has TS covered in General
Modifié par kevL, 08 avril 2013 - 12:24 .
#42
Posté 14 avril 2013 - 09:35
RPGplayer1 01/06/09 - Changed damage bonus from magical to physical
// HACK:
// If sum of two physical DAMAGE_TYPE_* constants is used (like 1+2 in this case),
// extra damage will be labeled as physical and will be of same type as weapon used
eg:
effect eDmg = EffectDamageIncrease(3, 3);
The second "3" represents the addition of nwscript constants
int DAMAGE_TYPE_BLUDGEONING = 1; int DAMAGE_TYPE_PIERCING = 2;
( Also, not sure how this relates to Type_All/Type_Bludgeoning, noted above. )
Modifié par kevL, 14 avril 2013 - 09:42 .
#43
Posté 31 mars 2014 - 11:39
I looked at the Wiki this morning and saw you've been busy. Do you have any thoughts on True Sight?
(By the way, what did you change on Mass Deathward? I couldn't tell what was different.)
From the point of view of being able to attack when blinded, true sight as an item property certainly works. I have a permanently blind companion in a module I'm working on who can only initiate attacks when wearing a circlet with the true sight item property. The downside is that the companion also reacts to hostile creatures with an ethereal effect on them, but can't actually attack them, so they tend to run back and forth near the target in confusion.
#44
Posté 04 mai 2014 - 01:47
GetLastSpell()
as used in the OnSpellCastAt event, ignores the SpellID that was passed in w/
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, iSpellID));
and uses a value like GetSpellId() instead.
For example, a spell's Child ID will be referenced, if trying to trigger a particular OnSpellCastAt event with its Master ID.
Workaround: kill it with fire (that wasn't very helpful)
- handle the direct SpellID somehow. Set/Get a local_var or if possible map the child to its parent to trigger the action you want in the SpellCastAt script itself ...,,
/ carry on.
- rjshae aime ceci
#45
Posté 04 mai 2014 - 01:47
GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_*)
returns a creature that feels reputation_type vs OBJECT_SELF instead of as seemingly advertised; how OBJECT_SELF feels about creature.
cf. my previous comments about Reputation I've come to the conclusion that everything works fine if the Faction_Table is reversed, except for the PC column (which doesn't matter because it returns the same value either way)
here is the testscript
- rjshae aime ceci
#46
Posté 12 mai 2014 - 08:51
GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_*)
returns a creature that feels reputation_type vs OBJECT_SELF instead of as seemingly advertised; how OBJECT_SELF feels about creature.
cf. my previous comments about Reputation I've come to the conclusion that everything works fine if the Faction_Table is reversed, except for the PC column (which doesn't matter because it returns the same value either way)
here is the testscript
Hi KevL,
Yes, I have noticed "errors" with "GetNearestCreature" too. I wrote a function called GetNearestNPC, which says this: "GetNearestNPC will return any living NPC either friend or enemy. This replaces GetNearestCreature which can return a companion not currently controlled by a player even if NOT_PC is specified." The function is too home-brew with references to other functions to include here I'm afraid.
I have a couple more home brew functions around this topic, including this one too:-
///////////////////////////////////////////////////////////////////////////////////////////////////
// Returns a LIVING enemy - More useful that attacking dead ones!
// Rewrite of official campaign function.
///////////////////////////////////////////////////////////////////////////////////////////////////
object GetNearestLiveEnemy(object oSource=OBJECT_SELF, int nNth = 1);
object GetNearestLiveEnemy(object oSource=OBJECT_SELF, int nNth = 1)
{
return GetNearestCreature(CREATURE_TYPE_REPUTATION,
REPUTATION_TYPE_ENEMY,
oSource, nNth, CREATURE_TYPE_IS_ALIVE, CREATURE_ALIVE_TRUE);
}
#47
Posté 01 août 2015 - 05:04
iprp_feats.2da - note that rows 22(WeaponProfMartial) and 23(WeaponProfSim) do not jive with nwscript constants
IP_CONST_FEAT_WEAPON_PROF_SIMPLE = 22
IP_CONST_FEAT_WEAPON_PROF_MARTIAL = 23
workaround: when scripting, use the numeric constants. Ie,
22 = Martial Proficiency ip
23 = Simple Proficiency ip
they are used only in the function, ItemPropertyBonusFeat()
afaiaa





Retour en haut






