sagittarius22 Posted April 22, 2011 Share Posted April 22, 2011 (edited) I am trying to make an alternative to the VATS system by implementing the same thing there is in SC Conviction.But when I press the key, my game crashes. Can someone help me? scn SAGMortalReflexSCRIPT short VatsKey ref Enemy ref CurrentWeapon short Once Begin Gamemode set CurrentWeapon to player.getequippedobject 5 set Enemy to GetFirstRef set Vatskey to 2 label 1 if (iskeypressed VatsKey) && Once==0 if (Enemy.getshouldattack player>0) if (player.getlos Enemy) player.useweapon CurrentWeapon player Enemy 1 set Once to 1 player.look enemy endif elseif Enemy.getshouldattack player==0 set Enemy to GetNextRef goto 1 endif endif endif if iskeypressed vatskey==0 set once to 0 player.stoplook enemy endif End Edited April 22, 2011 by sagittarius22 Link to comment Share on other sites More sharing options...
tunaisafish Posted April 22, 2011 Share Posted April 22, 2011 What's the default type of form scanned for when you don't specify any params to GetFirstRef?If it is an actor, then could that include the player?I could see that crashing if enemy == player. Link to comment Share on other sites More sharing options...
sagittarius22 Posted April 22, 2011 Author Share Posted April 22, 2011 I tried a new script: scn SAGMortalReflexSCRIPT short VatsKey ref Enemy ref CurrentWeapon short Once Begin Gamemode set CurrentWeapon to player.getequippedobject 5 set Enemy to GetFirstRef 200 2 set Vatskey to 2 label 1 if (iskeypressed VatsKey) && Once==0 if enemy==player goto 1 set enemy to getnextref endif if (Enemy.getshouldattack player>0) if (player.getlos Enemy) player.useweapon CurrentWeapon player Enemy 1 set Once to 1 player.look enemy endif elseif Enemy.getshouldattack player==0 set Enemy to GetNextRef goto 1 endif endif endif if iskeypressed vatskey==0 set once to 0 player.stoplook enemy endif End Still does not work :( Link to comment Share on other sites More sharing options...
rausheim Posted April 23, 2011 Share Posted April 23, 2011 if enemy==player should be if enemy == player Don't forget the space :-) Link to comment Share on other sites More sharing options...
tunaisafish Posted April 23, 2011 Share Posted April 23, 2011 Try it on a different key.If the game is entering VATS mode then running an animation on the player at the same time is probably asking for trouble. Link to comment Share on other sites More sharing options...
sagittarius22 Posted April 23, 2011 Author Share Posted April 23, 2011 Try it on a different key.If the game is entering VATS mode then running an animation on the player at the same time is probably asking for trouble.Still crashes :/ Link to comment Share on other sites More sharing options...
rickerhk Posted April 24, 2011 Share Posted April 24, 2011 I don't think you can have two GetNexRefs in the same loop, and you need the 'apple bug' fix in there. scn SAGMortalReflexSCRIPT short VatsKey ref Enemy ref CurrentWeapon short Once Begin Gamemode set CurrentWeapon to player.getequippedobject 5 set Enemy to GetFirstRef 200 1 set Vatskey to 2 label 1 if (iskeypressed VatsKey) && Once==0 if enemy==player elseif (Enemy.getshouldattack player>0) if (player.getlos Enemy) if (CurrentWeapon) player.useweapon CurrentWeapon player Enemy 1 set Once to 1 player.look enemy endif endif endif set Enemy to Pencil01 set Enemy to GetNextRef goto 1 endif if iskeypressed vatskey==0 set once to 0 player.stoplook enemy endif End Link to comment Share on other sites More sharing options...
sagittarius22 Posted April 24, 2011 Author Share Posted April 24, 2011 Thanks I'll try it. What's the apple bug fix? Link to comment Share on other sites More sharing options...
rickerhk Posted April 24, 2011 Share Posted April 24, 2011 Thanks I'll try it. What's the apple bug fix?There's some bug where calling GetNextRef with Enemy equal to the previously found REF would cause a malfunction, so you set Enemy to something arbitrary before calling GetNetRef (In Oblivion they used the apple). Link to comment Share on other sites More sharing options...
Recommended Posts