sgtchubs Posted February 26, 2021 Share Posted February 26, 2021 Hey all! I'm trying to port Kim from Nehrim as a follower into Oblivion and I've gotten most things working but her script to heal the player isn't working. scn OKimFScript short HelpPlayershort PlayerBaseHealthfloat HelpTimer Begin GameMode if ( OKimFRef.getCurrentAIPackage != 6 ) ;KIM HELP THE PLAYER IF LOW HEALTH if ( GetDistance Player <= 700 ) && ( GetStage mq04 >= 70 ) && ( KimFermaleRef.GetFriendHit Player < 4 ) && ( GetCombatTarget != player ) set PlayerBaseHealth to player.getbaseactorvalue health if ( Player.GetLevel <= 15 ) && ( Player.GetActorValue Health < 65 ) && ( HelpPlayer == 0 ) && ( Player.GetActorValue Health < 0.5 * PlayerBaseHealth )OKimFRef.Cast "aaaOKimPlayerHeal01" PlayerSet HelpPlayer to 1 elseif ( Player.GetLevel > 15 ) && ( Player.GetActorValue Health < 155 ) && ( HelpPlayer == 0 ) && ( Player.GetActorValue Health < 0.5 * PlayerBaseHealth )OKimFRef.Cast "aaaOKimPlayerHeal02" PlayerSet HelpPlayer to 1 elseif ( Player.GetLevel > 20 ) && ( Player.GetActorValue Health < 200 ) && ( HelpPlayer == 0 ) && ( Player.GetActorValue Health < 0.5 * PlayerBaseHealth )OKimFRef.Cast "aaaOKimPlayerHeal02" PlayerSet HelpPlayer to 1endifendif if ( GetDistance Player > 700 ) && ( HelpPlayer == 1 )Set HelpPlayer to 0EVP;KimFermaleRef.MoveTo Player 32, 0, 0 endif if ( HelpPlayer == 1 )Set HelpTimer to HelpTimer + GetSecondsPassedif ( HelpTimer >= 2 )Set HelpTimer to 0Set HelpPlayer to 0endifendif endif End I'm getting an error at "OKimFRef.Cast "aaaOKimPlayerHeal01" Player" and I have no idea why. I've tried switching the ref with other characters and sometimes it would work, and sometimes I'd get the same error. Script 'OKimFScript', line 17:Syntax error. Invalid reference 'OKimRef' (only object refrerences and reference variables are allowed in this context) Thanks! Link to comment Share on other sites More sharing options...
Pellape Posted February 26, 2021 Share Posted February 26, 2021 (edited) Well you need to MAKE the spell aaaOKimPlayerHeal01 ...to be able to use it. Edited February 26, 2021 by Pellape Link to comment Share on other sites More sharing options...
sgtchubs Posted February 26, 2021 Author Share Posted February 26, 2021 The spell does exist. The problem seems to be coming from the NPC ref. Like for example when I put Baurusref.Cast "aaaOKimPlayerHeal01" Playerthere is no error, but there is for OKimF. There is even errors if I put in other Vanilla NPCs LyndaCarterTestref.Cast "aaaOKimPlayerHeal01" Playerspits out the same error. I'm thinking I'm missing something with the OKimF npc, but I don't know what. Link to comment Share on other sites More sharing options...
sgtchubs Posted February 26, 2021 Author Share Posted February 26, 2021 Ah! I found out. I had to actually place the NPC in the world and give it a ref id. Link to comment Share on other sites More sharing options...
Pellape Posted February 27, 2021 Share Posted February 27, 2021 Objects and refs.... :D Good you did solve it. :) Link to comment Share on other sites More sharing options...
Recommended Posts