Info Panel
________________
FO MOD MASTER THREAD
TES MOD MASTER THREAD

________________


________________
_
November 2017
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
27282930   

Calendar Calendar


Companion Scripting help...I think

View previous topic View next topic Go down

Companion Scripting help...I think

Post by Onceknown on Wed Feb 01, 2017 12:17 pm

Okay, so I'm making a mod called synths of the Mojave and there is going to be a companion that is a synth. I wanted to make it were you have to repair the synth before she could become your companion but I had no clue how to do that so I copied ED-e's script. it kinda worked but instead of spawning the synth it spawns ED-e (which I expected to happen) but I don't know how to fix this so if anyone could possibly help that would be great. Here is a video of what is happening. PS. I'm on my phone at school so I can't embed the link, I'll update it when I get home.

https://youtu.be/IpLTnInZbqM

Thanks to anyone that can help or trys to help Smile


_________________
I'm apart of an elite group of keyboard warriors.


-P.S- Usually gone on weekends

avatar
Onceknown

Posts : 181
Join date : 2017-01-21
Age : 16
Location : Somewhere...i think

Character sheet
Name: Character
Faction:
Level:

View user profile

Back to top Go down

Re: Companion Scripting help...I think

Post by TheHermit on Wed Feb 01, 2017 12:38 pm

Paste script here (in spoiler and code tags)

_________________
Please visit and subscribe to my channel:

MY MODS:
AMBER ENB
COBALT ENB & RUST ENB
MALLORY: A Fallout: New Vegas Companion [WIP]

avatar
TheHermit

Posts : 1443
Join date : 2014-05-22
Age : 32
Location : No Place Nowhere

Character sheet
Name: Mickey
Faction: Independent
Level: N/A

View user profile https://www.youtube.com/user/OrmrSnaethorsen/feed

Back to top Go down

Re: Companion Scripting help...I think

Post by Onceknown on Wed Feb 01, 2017 10:29 pm

@TheHermit Sorry for the late response ive been at school, but anyways before i show the scripts i just want to say there are two, one for the broken ed-e and another for the actual working Ed-e. and i had a broken synth and copied the damaged ed-e script to him and i copied the working ed-e script to the working synth. just wanted to say that so you would know.

Damaged ed-e:
Code:
scn EDEScriptDisabled

int Waiting                        ; 0 = Not waiting, 1 = Waiting
int CombatStyleMelee            ; 0 = Not melee, 1= Melee
int CombatStyleRanged            ; 0 = Not ranged, 1 = Ranged
int IsFollowingDefault            ; 0 = Not following default, 1 = Is following default range
int IsFollowingLong               ; 0 = Not following long, 1 = Is following long
int FollowerSwitchAggressive      ; 0 = Passive (wait on player), 1 = Aggressive (attack when see enemies)
int iEDEFixed                     ; 1 = EDE Fixed, 2 = EDE Upgraded
int iButton                        ; Tracks the button presses for EDE's repair menus
int iMenu                        ; Tracks the current menu screen for EDE's repair menus
int iRepairState
float fTimer

begin OnActivate Player
   if IsActionRef Player
      set vDialogueEDE.bEDEExamined to 1
      if Player.IsInCombat == 1
         showmessage EDECombatMessage
      else
         showMessage EDERepair00
      endif
   endif
end

begin OnActivate
   if IsActionRef Player
      if Player.IsInCombat == 1
         showmessage EDECombatMessage
      else
         showMessage EDERepair00
      endif
   endif
end

begin GameMode
   if iEDEFixed == 1
      set fTimer to GetSecondsPassed + fTimer
      if fTimer >= 2
         set iEDEFixed to 2
         EDE1Ref.SetRestrained 1
         EDE1REF.enable
         EDE1Ref.ResetAI
         disable
      endif
   elseif iEDEFixed == 2
      disable
      return
   endif
   set iButton to GetButtonPressed
   if iButton == 0
      set iMenu to 0
   endif
   if iMenu == 0      ; EDERepair00
      if iButton == 1
         showMessage EDERepair01
         set iMenu to 1
      elseif iButton == 2
         ShowMessage EDERepair03
         set iMenu to 3
      elseif iButton == 3
         ShowMessage EDERepair02
         set iMenu to 2
      endif
   elseif iMenu == 1   ; EDERepair01
      if iButton == 1
         imod FadeToBlackAndBackQuickExtendedISFX
         set iEDEFixed to 1
         disableplayercontrols
         startquest vDialogueEDE
         set vNPCFollowers.bEDEAvailable to 1
         set VNPCFollowers.nRecruited to VNPCFollowers.nRecruited + 1;
         EDE1Ref.MoveTo NVCompanionEDEDisabledREF
      elseif iButton == 2
         showmessage EDERepair02
         set iMenu to 2
      elseif iButton == 3
         showMessage EDERepair04
         set iMenu to 4
      endif
   elseif iMenu == 3   ; EDERepair03
      if iButton == 1
         imod FadeToBlackAndBackQuickExtendedISFX
         set iEDEFixed to 1
         disableplayercontrols
         startquest vDialogueEDE
         set vNPCFollowers.bEDEAvailable to 1
         set VNPCFollowers.nRecruited to VNPCFollowers.nRecruited + 1;
         EDE1Ref.MoveTo NVCompanionEDEDisabledREF
      elseif iButton == 2
         showMessage EDERepair04
         set iMenu to 4
      endif
   elseif iMenu == 2   ; EDERepair02
      if iButton == 1
         showMessage EDERepair01
         set iMenu to 1
      elseif iButton == 2
         set iRepairState to 1
         showMessage EDERepair03
         set iMenu to 3
      endif
   elseif iMenu == 4 ; EDERepair04
      if iButton == 1
         player.RemoveItem ScrapElectronics 1
         player.RemoveItem SpareParts 3
         player.RemoveItem SensorModule 2
         imod FadeToBlackAndBackQuickExtendedISFX
         set iEDEFixed to 1
         disableplayercontrols
         startquest vDialogueEDE
         set vNPCFollowers.bEDEAvailable to 1
         set VNPCFollowers.nRecruited to VNPCFollowers.nRecruited + 1;
         EDE1Ref.MoveTo NVCompanionEDEDisabledREF
      elseif iButton == 2 && iRepairState == 0
         showMessage EDERepair01
         set iMenu to 1
      elseif iButton == 2 && iRepairState == 1
         showMessage EDERepair03
         set iMenu to 3
      elseif iButton == 3
         showMessage EDERepair02
         set iMenu to 2
      endif
   endif
end


living ed-e script:
Code:
scn EDEScript

int Waiting                        ; 0 = Not waiting, 1 = Waiting
int CombatStyleMelee            ; 0 = Not melee, 1= Melee
int CombatStyleRanged            ; 0 = Not ranged, 1 = Ranged
int IsFollowingDefault            ; 0 = Not following default, 1 = Is following default range
int IsFollowingLong               ; 0 = Not following long, 1 = Is following long
int FollowerSwitchAggressive      ; 0 = Passive (wait on player), 1 = Aggressive (attack when see enemies)
float fTimer               
int OnceOnly
int iLogsPlayed                  ; Count of the number of logs played
int iRadioConversation            ;
ref rLogBlocker                     ; reference to stop the player from getting logs in the same cell
int bSameCell                     ; Set to 1 if the player is in the same cell as a log blocker.

begin OnLoad
   if OnceOnly == 0
      set OnceOnly to 1
   endif
end

begin GameMode
   if iRadioConversation == 1 && this == EDE1Ref
      EDERadioREF.enable
      sayto Player EDEStatic
      set iRadioConversation to 2
   endif
   if (rLogBlocker != 0 && bSameCell == 0)
      if (rLogBlocker.GetInSameCell Player)
         set bSameCell to 1
      endif
   elseif bSameCell == 1 && rLogBlocker.GetInSameCell Player == 0
      set bSameCell to 0
   endif
end

begin SayToDone EDEStatic
   startconversation Player EDERadioConversation
end


;---------------------------------------------------------------------------------------------------------------------------------------------

begin OnDeath

   if VNPCFollowers.bEDEHired == 1
      set VNPCFollowers.nCurrentFollowers to VNPCFollowers.nCurrentFollowers - 1;
      set vNPCFollowers.bCritterinParty to 0
      if (VNPCFollowers.nCurrentFollowers == 0)
         set VNPCFollowers.bPlayerHasFollower to 0
      endif
      set VNPCFollowers.bEDEHired to 0
      ShowMessage FollowerMessageDeadEDE
      player.RemovePerk EnhancedSensors
      ShowMessage FollowerMessagePerkEDERemove
   endif
   
   set VNPCFollowers.bEDEDead to 1
   if GetQuestCompleted vDialogueEDE == 0
      setstage vDialogueEDE 100
   endif

end

begin GameMode
   if OnceOnly == 1
      set fTimer to GetSecondsPassed + fTimer
      if fTimer >= 5
         set OnceOnly to 2
         set EDE2Ref.OnceOnly to 2
         set EDE3Ref.OnceOnly to 2
         setrestrained 0
         resetai
      endif
   endif
end

;---------------------------------------------------------------------------------------------------------------------------------------------

begin OnCombatEND

   if GetPlayerTeammate == 1
      resethealth
      restoreav perceptioncondition 100
      restoreav endurancecondition 100
      restoreav leftattackcondition 100
      restoreav leftmobilitycondition 100
      restoreav rightattackcondition 100
      restoreav rightmobilitycondition 100
   
      ; JSH 02.04.11 - Reset ED-E if he's frenzied.
      SetActorValue Aggression 0;
      RestoreActorValue BrainCondition 100;
   endif

end


Also maybe this could be the problem, Theres something called the Ed-e home marker that is in the primm nash residence home that is directly under where ed-e spawns after he is fixed.

The home marker thing:

Anyways thanks for any help you may be able to give me and even if you cant help thank you for responding Smile

_________________
I'm apart of an elite group of keyboard warriors.


-P.S- Usually gone on weekends

avatar
Onceknown

Posts : 181
Join date : 2017-01-21
Age : 16
Location : Somewhere...i think

Character sheet
Name: Character
Faction:
Level:

View user profile

Back to top Go down

Re: Companion Scripting help...I think

Post by TheHermit on Thu Feb 02, 2017 2:54 am

You should know, I'm no expert - so hopefully someone can chime in if what I tell you is erroneous.

The first thing I would suggest is you make a new script from copy (which I guess you have done), but give it a different name, for example, SynthScriptDisabled and make sure that the first line is scn SynthScriptDisabled.
At the moment, your synth turns into E-DE because you haven't tailored the script to the synth. It's not as simple as just copy and paste in all cases. Basically, using the Damage Ed-E script as an example, you need to create scripts that point to custom synth and not Ed-E. A lot of the script is superfluous for what you're wanting to do. You don't want any references to Ed-E in there at all or it will affect Ed-E instead. I imagined the script would be a more simplistic - on par with most follower mod scripts, but there's a lot of stuff in there that I'm not sure about... timers, etc. The script also references a lot of 'showMessage xxx' and you'll find those messages in the GECK. You shouldn't use them for the Synth, though. You should make your own. If I was to do this myself, I would see if I can find all of those messages and references in GECK, look at them and then possibly copy them too, rename them and change everything up to reference the new stuff.

I can't really be much help here, I'm afraid. Sorry.

_________________
Please visit and subscribe to my channel:

MY MODS:
AMBER ENB
COBALT ENB & RUST ENB
MALLORY: A Fallout: New Vegas Companion [WIP]

avatar
TheHermit

Posts : 1443
Join date : 2014-05-22
Age : 32
Location : No Place Nowhere

Character sheet
Name: Mickey
Faction: Independent
Level: N/A

View user profile https://www.youtube.com/user/OrmrSnaethorsen/feed

Back to top Go down

Re: Companion Scripting help...I think

Post by Onceknown on Thu Feb 02, 2017 3:01 am

Even if it doesn't work thanks for your input Smile , but yeah I'll try it tomorrow and see what I can do.

_________________
I'm apart of an elite group of keyboard warriors.


-P.S- Usually gone on weekends

avatar
Onceknown

Posts : 181
Join date : 2017-01-21
Age : 16
Location : Somewhere...i think

Character sheet
Name: Character
Faction:
Level:

View user profile

Back to top Go down

Re: Companion Scripting help...I think

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum