jaam Posted August 23, 2014 Share Posted August 23, 2014 Which ones ? Or do you mean creating the functionality for other items ? Link to comment
Xilandro Posted August 24, 2014 Share Posted August 24, 2014 IsPlayable works only with armours? Ugh-oh.. Lots of my scripts rely on that function to make sure tokens or any other items marked "non playable" (from other mods or vanilla) are not affected by anything what I'm doing with regular items. Sp weapons and ammo fix will be extremely useful.) Link to comment
Odessa Posted August 24, 2014 Share Posted August 24, 2014 @Xilandro, I wrote an IsPlayable UDF that works for weapons, armor and companion ammo, you can use it if you like: scn fnIsPlayable ; Returns 0 if the specified weapon or armor is not playable ; Returns 0 if the specified item is Magic Companion Ammo ; Returns 0 if the specified item is in not playable form list ; Otherwise returns the type of the item ; * args ref rItem ; * local int iType int bmWeapFlags int bmPlayable Begin Function { rItem } if eval !(IsFormValid rItem) Print "Error! fnIsPlayable passed invalid form" return endif let iType := GetType rItem if iType == 24 ; Armor if eval (IsPlayable rItem) SetFunctionValue iType else SetFunctionValue 0 endif return endif if iType == 40 ; Weapon let bmWeapFlags := GetWeaponFlags1 rItem let bmPlayable := ClearBit bmWeapFlags, 7 ; * 7 (128) is not playable flag if bmWeapFlags == bmPlayable SetFunctionValue iType else SetFunctionValue 0 endif return endif if rItem == AmmoCompanion SetFunctionValue 0 return endif if eval (ListGetFormIndex MyNonPlayableItemsFL, rItem) > NotFound SetFunctionValue 0 return endif ; * If we get here, the item is playable. SetFunctionValue iType End ============ Bug? The functions: The compiler disallows passing a reference directly to SetTokenRef and SetTokenValueAndRef. If you pass a reference via a ref var or use the CO it works correctly, as does passing base forms directly. Link to comment
Xilandro Posted August 24, 2014 Share Posted August 24, 2014 @Odessa That's neat! Thank you) Link to comment
Odessa Posted August 26, 2014 Share Posted August 26, 2014 Bug SetHotKeyItem appears to be broken- it crashes the script. Detected via debug prints on either side. Script/scof below. scn nvseHotKeysScript array_var aHK array_var entry ref rItem int iSlot int iRuns Begin GameMode if iRuns < 1 MessageEx "Starting" Con_SCOF "HotkeysTest.txt" Print "Init map" let aHK := Ar_Map 1::Weap10mmPistol, 3::WeapNV9mmPistol, 4::Stimpak, 5::Jet 6::Vodka foreach entry <- aHK let rItem := entry["value"] PlayerREF.AddItem rItem, 1 loop let iRuns := 1 Print "Done" return elseif iRuns == 99 return endif Ar_Dump aHK foreach entry <- aHK let iSlot := entry["key"] let rItem := entry["value"] Print "Testing SetHotkeyItem " + $iSlot + ", " + $rItem + " (" + (GetFormIDString rItem) + ")" SetHotkeyItem iSlot, rItem Print " Success" loop Print "Completed Reset Hot Keys" MessageEx "All done" let iRuns := 99 End Init mapDone** Dumping Array #1 **Refs: 1 Owner 0A: nvse-test.esp[ 1.000000 ] : 10mm Pistol (0000434F)[ 3.000000 ] : 9mm Pistol (000E3778)[ 4.000000 ] : Stimpak (00015169)[ 5.000000 ] : Jet (00015164)[ 6.000000 ] : Vodka (00032C74)Testing SetHotkeyItem 1, 10mm Pistol (0000434F) ** Dumping Array #1 **Refs: 1 Owner 0A: nvse-test.esp[ 1.000000 ] : 10mm Pistol (0000434F)[ 3.000000 ] : 9mm Pistol (000E3778)[ 4.000000 ] : Stimpak (00015169)[ 5.000000 ] : Jet (00015164)[ 6.000000 ] : Vodka (00032C74)Testing SetHotkeyItem 1, 10mm Pistol (0000434F) .... Link to comment
Guest luthienanarion Posted August 26, 2014 Share Posted August 26, 2014 Bug SetHotKeyItem appears to be broken- it crashes the script. Detected via debug prints on either side. Script/scof below. scn nvseHotKeysScript array_var aHK array_var entry ref rItem int iSlot int iRuns Begin GameMode if iRuns < 1 MessageEx "Starting" Con_SCOF "HotkeysTest.txt" Print "Init map" let aHK := Ar_Map 1::Weap10mmPistol, 3::WeapNV9mmPistol, 4::Stimpak, 5::Jet 6::Vodka foreach entry <- aHK let rItem := entry["value"] PlayerREF.AddItem rItem, 1 loop let iRuns := 1 Print "Done" return elseif iRuns == 99 return endif Ar_Dump aHK foreach entry <- aHK let iSlot := entry["key"] let rItem := entry["value"] Print "Testing SetHotkeyItem " + $iSlot + ", " + $rItem + " (" + (GetFormIDString rItem) + ")" SetHotkeyItem iSlot, rItem Print " Success" loop Print "Completed Reset Hot Keys" MessageEx "All done" let iRuns := 99 End Init map Done ** Dumping Array #1 ** Refs: 1 Owner 0A: nvse-test.esp [ 1.000000 ] : 10mm Pistol (0000434F) [ 3.000000 ] : 9mm Pistol (000E3778) [ 4.000000 ] : Stimpak (00015169) [ 5.000000 ] : Jet (00015164) [ 6.000000 ] : Vodka (00032C74) Testing SetHotkeyItem 1, 10mm Pistol (0000434F) ** Dumping Array #1 ** Refs: 1 Owner 0A: nvse-test.esp [ 1.000000 ] : 10mm Pistol (0000434F) [ 3.000000 ] : 9mm Pistol (000E3778) [ 4.000000 ] : Stimpak (00015169) [ 5.000000 ] : Jet (00015164) [ 6.000000 ] : Vodka (00032C74) Testing SetHotkeyItem 1, 10mm Pistol (0000434F) .... That's entirely my fault. At the end of the SetHotkeyItem function, it returns 0 ('false', since it's a boolean function) instead of 'true' like all NVSE functions should. I'm just too used to returning 0 at the end of integer functions... Returning false from an NVSE function doesn't crash the script; it just stops it after the function return. Your script is actually running through each time the quest delay comes around, but the return value from SetHotkeyItem is acting like a return in your script. I'll pass this along to hlp, or jaam can fix it. You make a great function tester, by the way. Link to comment
jaam Posted September 11, 2014 Share Posted September 11, 2014 New version up : http://forums.bethsoft.com/topic/1482519-beta-new-vegas-script-extender-nvse-v4/page-6?do=findComment&comment=23763556 Link to comment
Guest tomm434 Posted September 12, 2014 Share Posted September 12, 2014 jaam, but this bug (?) still remains For vanilla NW: set VNPCFollowers.fFollowerWaitingLeaveDay to ( GameDaysPassed + FollowerWaitTime ) -Is okay let VNPCFollowers.fFollowerWaitingLeaveDay := ( GameDaysPassed + FollowerWaitTime ) - COULD NOT PARSE THIS LINE I'm calling it from quest script. It's nothing really, I'm okay with "set" function but I thought you should know. Link to comment
jaam Posted September 12, 2014 Share Posted September 12, 2014 I can compile any of those: Set fHealth to GameDaysPassed + fHealth1 Let fHealth := GameDaysPassed + fHealth1 Let fHealth := { GameDaysPassed + fHealth1 } Let fHealth := ( GameDaysPassed + fHealth1 ) Link to comment
Guest tomm434 Posted September 12, 2014 Share Posted September 12, 2014 Can you compile this exact variable (VNPCFollowers.fFollowerWaitingLeaveDay) with let syntax? Link to comment
prideslayer Posted September 12, 2014 Author Share Posted September 12, 2014 It might be related to a quest var? I remember a similar issue a while back. Link to comment
Guest tomm434 Posted September 12, 2014 Share Posted September 12, 2014 Other quest vars are compiling good but this exact var compiles with "set" syntax but not with "let" syntax. There was a bug when you couldn't use let syntax for object script vars but it's been fixed. EDIT: you can try it yourself - it's vanilla NW variable. Link to comment
jaam Posted September 12, 2014 Share Posted September 12, 2014 No, but I can compile Let fHealth := VNPCFollowers.fCurrentDay In fact: The issue is the ; following the variable name in the original script if I edit the VNPCFollowersQuestSCRIPT script as: short bPlayerHasFollower; short nCurrentFollowers; float fFollowerWaitingLeaveDay ; float fCurrentDay It compiles OK. Link to comment
Guest tomm434 Posted September 12, 2014 Share Posted September 12, 2014 Ok, good to know, thanks. Link to comment
DoctaSax Posted September 12, 2014 Share Posted September 12, 2014 So the moral of the story is always leave a space before your semi-colons, especially after variable declarations? Considering this only appears to be an issue with "let" syntax, it should probably be pointed out in the available documentation (wiki, nvse beth thread). Link to comment
jaam Posted September 12, 2014 Share Posted September 12, 2014 Hopefully the parsing function can be corrected. Link to comment
Guest tomm434 Posted September 14, 2014 Share Posted September 14, 2014 Power armor check Item.GetEquipmentBipedMask == 32 doesn't appear to work. However "IsPowerArmor" works. GetEquipmentBipedMask for medium or heavy armor seem to be working. Link to comment
Odessa Posted September 14, 2014 Share Posted September 14, 2014 It is a bitmask stored in an int, not a number stored in an int, so think of binary: Bit number: 0 1 2 3 4 5 6 7 Value: 1 2 4 8 16 32 64 128 4 = HasBackpack 8 = Medium Armor 32 = Power Armor 64 = Non playable 128 = HeavyArmor Other bits are either unused or unknown. So, since all power armor is also heavy armor, both bit 5 and bit 7 are set (1), making the number equivalent: 160. If it has a backpack too, 164. There is probably a better way to check a specific bit, but have used this: let bmArmor := GetEquipmentBipedMask Item ; get the armor bit mask 'int' let bmIsPower := SetBit bmArmor, 5 ; get the bitmask with the power armor bit set to 1 if bmArmor == bmIsPower ; if they are the same, then the armor is PA Link to comment
Guest tomm434 Posted September 19, 2014 Share Posted September 19, 2014 Thanks, Odessa. I'll keep that in mind. Link to comment
Wotanpower Posted May 16, 2016 Share Posted May 16, 2016 V16 kann nicht installieren zeigt immer nicht vorhanden, Nicht funktioniert V16 Link to comment
DoctaSax Posted May 16, 2016 Share Posted May 16, 2016 Get your NVSE from the silverlock site: http://nvse.silverlock.org/ (5.0.3) Link to comment
Guest endgameaddiction Posted May 16, 2016 Share Posted May 16, 2016 http://nvse.silverlock.org/ Link you provided goes to a 404 Not found. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now