GetWeaponReach

Post » Tue Nov 09, 2010 2:39 am

Hello! I have made the following script to get weapon's reach but the results i get are wrong.
For example if i have equiped a dagger (reach: 0,6000) the engine turns me 0,5000. Same if i use Warhammer (reach: 1,3000) and it turns me that it has 1,0000.
I wander why ti gives me lower values...
(The script is attached on actor but i get the same if i use it on me.)

........

ref NPC
ref Weapon
float WeaponSkill
......

set NPC to GetSelf
set Weapon to NPC.GetEquippedObject 16
set WeaponSkill to GetWeaponReach Weapon
.....

MessageEX "WeaponReach: %2.5f" WeaponSkill
.....
User avatar
Elizabeth Falvey
 
Posts: 3347
Joined: Fri Oct 26, 2007 1:37 am

Post » Tue Nov 09, 2010 1:23 am

IIRC the scale of the character factors in. A Bosmer has less reach than an Aureal because of shorter arms!
User avatar
Franko AlVarado
 
Posts: 3473
Joined: Sun Nov 18, 2007 7:49 pm

Post » Tue Nov 09, 2010 12:23 am

IIRC the scale of the character factors in. A Bosmer has less reach than an Aureal because of shorter arms!


Naaah! I call weapon reach! A weapon stat that is always the same. The actual reason that this was shorter, was because OOO changes this stat. I didnt knew that.
Anyway I made it now and it get the actual value for this but... whn i call it in IF STATEMENT is doesnt appear to give me results.
(of my reach values in as OOO! Different that vanilla)

It shows me the message in Dagger and Warhammer (IF) but i dont get any message in WarAxe, BattleAxe and Mace,
Dunno why...

ref NPC
ref Weapon
short WeaponType
float WeaponSkill
short ShoutType
float ShoutDuration
float fQuestDelayTime

Begin GameMode

set NPC to GetSelf
set Weapon to NPC.GetEquippedObject 16
set Weapontype to GetWeaponType Weapon
set WeaponSkill to GetWeaponReach Weapon

set fQuestDelayTime to 0.001

MessageEX "%1.5f and %.0f" WeaponSkill WeaponType <-- THIS WORKS AND GIVES CORRECT VALUES

If ( WeaponType == 0 ) && ( WeaponSkill == 0.5000 ) <-- WORKING
PrintToConsole "%n holds a dagger" NPC
endif

If ( WeaponType == 0 ) && ( WeaponSkill == 0.7500 ) <-- NOT TESTED
PrintToConsole "%n holds a shortsword" NPC
endif

If ( WeaponType == 0 ) && ( WeaponSkill == 0.9000 ) <-- NOT TESTED
PrintToConsole "%n holds a longsword" NPC
endif

If WeaponType == 1 <-- NOT TESTED
PrintToConsole "%n holds a Greatsword" NPC
endif

If ( WeaponType == 2 ) && ( WeaponSkill == 0.6500) <-- NOT WORKING
PrintToConsole "%n holds an War axe" NPC
endif

If ( WeaponType == 2 ) && ( WeaponSkill == 0.8000 ) <-- NOT WORKING
PrintToConsole "%n holds a Mace" NPC
endif

If ( WeaponType == 3 ) && ( WeaponSkill == 0.9000 ) <-- NOT WORKING
PrintToConsole "%n holds a Battleaxe" NPC
endif

If ( WeaponType == 3 ) && ( WeaponSkill == 1.0000 ) <-- WORKING
PrintToConsole "%n holds a Warhammer" NPC
endif

END
User avatar
Rachel Eloise Getoutofmyface
 
Posts: 3445
Joined: Mon Oct 09, 2006 5:20 pm

Post » Mon Nov 08, 2010 6:54 pm

Still cannot fix it... :(
Can anyone spot my mistake?
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am


Return to IV - Oblivion