Jump to content

Scripting Help Needed - Followers Drawing weapons when i do


Recommended Posts

Hello everyone. I hope i'm in the right place.

For totally personal use and not intentioned to release a distro, i would like to make a modification to an already existing mod.

Mod in question is Phalanx Followers
First of all, thanks FO3Phalanx to create this great mod.

I'm a visual modder, modeler and texturer, but i really suck at scripting, i really miss skills on it.

My question is: to add more flavour to the moment, i would like to see followers draw the weapon when i do it, as Sydney Follower do.
I found a script which sounds convencing, and i compared it to the Sydney's mod creator drg6525

The sydney's script looks like this

if (IsInCombat == 0 && WeaponSync == 1 && Waiting ==0 && HasBeenHired == 1)
if (player.IsWeaponOut == 1)
setalert 1
endif
if (player.IsWeaponOut == 0)
setalert 0
endif

then the one found here at Nexus looks like that [credits goes to vforvic]

if ( getactorvalue variable03 == 1 )          ;Is the NPC following you?
if ( player.IsWeaponOut == 1 )        ;If your weapon is out
SetAlert 1                    ;NPC draws weapon
else                                  ;If weapon is not out
SetAlert 0                    ;NPC holsters weapon
endif
endif

Ok my question is
WHERE DO I PUT THIS?

into a global follower script? or do i have to add it to every single companion script? (<--more likely here)
I understand it goes in the "BEGIN GAMEMODE" block, and i'm about to trial and error when and where and how to put it.

For ex, it seems very handy to use TESnip (FOMM) instead of using the GECK (just for avoiding loading times :tongue: )
I also suppose i have to use "COMPILE SCRIPT" Fomm's function after changes are made.

As i said before, i really suck at scripting, i just know the basics but not how to apply them...

Any help around?

Thanks for reading and (hopefully) answer. Happy modding everyone

Link to comment
Share on other sites

maybe this instead

 

if ( Waiting ==0 && HasBeenHired == 1)
if (player.IsWeaponOut == 1)

 

THEN TELL FOLLOWERS TO HAVE WEAPONS OUT

 

aCTUally not really sure what you are asKing ?

Edited by Mktavish
Link to comment
Share on other sites

Hi Mktavish thanks for your reply. I'm asking about the location of where do i have to put those lines of code. I got i have to put them on the "BeginGameMode" block of the follower's script, but I'm still not sure where to insert the code, if before or after some instructions.

 

Ideal final purpose is to have them (the followers) drawing weapons and holster exactly when i do it...

Gotta try more.

Thanks for every kind of help

Link to comment
Share on other sites

Well thats good , cuz I wasn't sure.

This line had me wondering "WeaponSync == 1"

It seemed redundant.

Yes I understand what u mean, i believe WeaponsSync it's a user defined variable in the specific case of Sydney. Now, with last code i posted, it works flawlessy.

well almost, because for some unknown reason Charon won't draw his gun (the only case of malfuncioning), having full load of ammo and a gun. It could be a conflicting script loaded by some other mod, I am actually troubleshooting this by changing load order AND using FO3Edit. Let's see results (since now, no conflict detected, neither manually nor automatically). U know i enjoy more modding than playing :tongue:

 

Edit: I forgot to mention i had to insert the <code> into every single follower's script, bottom of BEGIN GAMEMODE.

I would really like to use Phalanx function "Everyone, Listen up!" then add a button like "Everyone, Mirror my moves!" to enable or disable the auto drawing, but this...still too advanced for me

Edited by lukejackska
Link to comment
Share on other sites

  • Recently Browsing   0 members

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