Jump to content

Why isn't my script working?


ArdentFlame

Recommended Posts

This is a simple script that should make followers draw their weapons when I do. Luckily, this is probably a very simple fix. I got this script from this link:

 

http://forums.nexusmods.com/index.php?/topic/680526-companion-drawing-weapons/

 

The people here made this script, but when I go to enter it I get this message:

 

"SCRIPTS: Script 'FollwersDrawWeaponsQ', line 5:

Reference function 'GetPlayerTeammate' requires explicit reference in quest script.

 

 

 

Context: DEFAULT

"Yes to all" will disable all Warnings for this context."

 

 

Every time I hit "Yes to All" it doesn't save my script. So, obviously, GECK doesn't like something about this script. Here's the script in the format that I have it currently in:

 

scn FollowersDrawWeaponsQ
BEGIN GameMode
; Draw weapon when player has weapon out.
if ( GetPlayerTeammate == 1 ) && ( player.IsWeaponOut == 1 )
SetAlert 1
else
SetAlert 0
endif
end
Does anyone see what's wrong with this?
Link to comment
Share on other sites

First off, the query "getplayerteammate requires a reference, so unless I'm totally misremembering, So:

 

scn FollowersDrawWeaponsQ
ref Me ;Holder for companion identity
BEGIN GameMode
Set Me to GetSelf ;Assign Me to current Actor
; Draw weapon when player has weapon out.
if ( Me.GetPlayerTeammate == 1 ) && ( player.IsWeaponOut == 1 )
SetAlert 1
else
SetAlert 0
endif
end
(Note, I haven't worked with the SetAlert Command, so it's possible it may require "Me.SetAlert" but I'm too lazy to open up the GECK right now to check.)

 

Secondly, you might want to take a look at this: http://fallout3.nexusmods.com/mods/17404/?. This is the script editor I use, and it allows me to work out a script outside of the GECK, and fix syntax errors before they occur, instead of having to retype a script every time if GECK yacks up a hairball over it.

Link to comment
Share on other sites

The script in the other post that you linked to has the same problem. They are using a quest script - so you have to tell the game who you are talking about - you need to use the REFID.

The quest script is going to act on specific followers - not followers in general, as that would require advanced FOSE scripting. So if you want to control specific followers you can use this as a template:

scn MyFollowersAlertQuestScript





; Quest delay 1 second



BEGIN GameMode

    



        if (CloverREF.HasBeenHired && (CloverREF.IsFollowingLong || CloverREF.IsFollowingDefault) && (CloverREF.GetDistance Player < 3000) && Player.IsWeaponOut)

            if (CloverREF.GetIsAlerted)

                ; do nothing

            else

                CloverREF.SetAlert 1

            endif

        else

            if (CloverREF.GetIsAlerted)

                CloverREF.SetAlert 0

            endif        

        endif



    

END

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...