Jump to content

Hi everyone Im in the proccess of making a three player mod for fallout nv i need help debugging some script.


phrophet

Recommended Posts

here is the script I hope someone can assist me.

 

ScriptName amxPlayerControl3
float player2x
float player2y
int idle
int holstered
ref npc
int jumping
float jumpheight
float maxjumpheight
float jumpforce
float npcmass 1
float gravity -9.8
int jumpcount
short doOnceGetClothes
short pantsPercent
short shirtPercent
short shoesPercent
int firedelaycount
int weaponc
float aimangle 0
int vx2
; keys "16: Q17: W18: E19: R20: T21: Y22: U23: I24: O25: P30: A31: S32: D33: F34: G35: H36: J37: K38: L44: Z45: X46: C47: V48: B49: N50: M"
; * -1 - none
; * 0 - ANIM_ACTION_EQUIP_WEAPON
; * 1 - ANIM_ACTION_UNEQUIP_WEAPON
; * 2 - ANIM_ACTION_ATTACK
; * 3 - ANIM_ACTION_ATTACK_FOLLOW_THROUGH
; * 4 - ANIM_ACTION_ATTACK_THROW
; * 5 - ANIM_ACTION_ATTACK_THROW_ATTACH
; * 6 - ANIM_ACTION_BLOCK
; * 7 - ANIM_ACTION_RECOIL
; * 8 - ANIM_ACTION_RELOAD
; * 9 - ANIM_ACTION_STAGGER
; * 10 - ANIM_ACTION_DODGE
; * 11 - ANIM_ACTION_WAIT_FOR_LOWER_BODY_ANIM
; * 12 - ANIM_ACTION_WAIT_FOR_SPECIAL_IDLE
; * 13 - ANIM_ACTION_FORCE_SCRIPT_ANIM
begin GameMode
set idle to 1
set npc to getcontainer
npc.setplayerteammate 1
npc.removefromallfactions
npc.removescriptpackage
npc.addscriptpackage amxFollow2
npc.setignorefriendlyhits 999
npc.setav responsibility 1
npc.setav assistance 2
npc.setav aggression 1
npc.setav confidence 4
ref rSelf
set rSelf to GetSelf
;npc.AddtoFaction PartyFaction 1
;npc.setfactionrank PlayerFaction 1
SetAlert 1
if GetKnockedState == 0
if IsKeyPressed 71 ==1
if npc.GetAnimAction != 2
set firedelaycount to firedelaycount + 1
if firedelaycount > 2
set firedelaycount to 0
set idle to 0
PlayGroup AttackPower 0
if getEquipped WeapFlamer == 1
FireWeapon WeapFlamer
endif
if getEquipped WeapLaserPistol == 1
FireWeapon WeapLaserPistol
endif
if getEquipped Weap10mmPistol == 1
FireWeapon Weap10mmPistol
endif
if getEquipped WeapLaserRifle == 1
;FireWeapon WeapLaserRifle
endif
if getEquipped WeapMissileLauncher == 1
FireWeapon WeapMissileLauncher
endif
if getEquipped WeapShotgunCombat == 1
FireWeapon WeapShotgunCombat
endif
if getEquipped WeapMinigun == 1
FireWeapon WeapMinigun
endif
endif
endif
endif
if IsKeyPressed 72 ==1
; key J
set player2x to player2x - 200
Rotate Z player2x
if idle == 1
PlayGroup TurnLeft 2
endif
set idle to 0
endif
if IsKeyPressed 73 ==1
;key - L
set player2x to player2x+200
Rotate Z player2x
if idle == 1
PlayGroup TurnRight 2
endif
set idle to 0
endif
set vx2 to vx2 + 1
if IsKeyPressed 74 ==1
if idle==1
if npc.isAnimPlaying Equip == 0
;if npc.GetAnimAction != 0
; key o
if getEquipped OutfitJumpsuitTLHandyman== 0
equipItem OutfitJumpsuitTLHandyman
endif
if vx2 >50
set vx2 to 0
endif
if vx2 ==0
FireWeapon Weap10mmPistol
int vx
set vx to 1
if weaponc == 1 && vx == 1
equipItem WeapShotgunCombat
set vx to 0
endif
if weaponc == 2 && vx == 1
set vx to 0
equipItem WeapMissileLauncher
endif
if weaponc == 3 && vx == 1
set vx to 0
equipItem WeapFlamer
endif
if weaponc == 4 && vx == 1
set vx to 0
equipItem WeapLaserPistol
endif
if weaponc == 5 && vx == 1
set vx to 0
equipItem Weap10mmPistol
endif
if weaponc == 6 && vx == 1
set vx to 0
equipItem WeapLaserRifle
endif
if weaponc == 7 && vx == 1
set vx to 0
equipItem WeapMinigun
endif
set weaponc to weaponc + 1
if weaponc > 7
set weaponc to 1
endif
endif
;PlayGroup Equip 0
set idle to 0
endif
endif
endif
if IsKeyPressed 75 ==1
;if npc.isAnimPlaying FastForward == 0
; forward - i
;set player2y to player2y+10
if idle == 1
PlayGroup FastForward 0
endif
set idle to 0
;PlayGroup Idle 1
;endif
endif
if IsKeyPressed 76 ==1
PlayGroup FastBackward 0
set idle to 0
endif
if IsKeyPressed 77 ==1
;key H - return home
Moveto Player
endif
if IsKeyPressed 79 ==1
;key U
if jumping == 0
;PlayGroup JumpStart 0
;PlayGroup BlockHit 0
PlayGroup JumpLoopForward 0
;PushActorAway rSelf 1
;PlayGroup JumpLoop 0
set idle to 0
set jumping to 1
set maxjumpheight to GetPos Z + 100
set jumpforce to 10
set jumpcount to 0
endif
set jumpcount to jumpcount + 1
float zPos
;float finaljumpforce
;set finaljumpforce to jumpforce-gravity
set zPos to GetPos Z + jumpforce
if jumpcount < 10
SetPos Z zPos
endif
set jumpforce to jumpforce * 0.95
;if GetPos Z < maxjumpheight
; set jumpheight to jumpheight + jumpforce
;endif
else
set jumping to 0
set jumpheight to 0
set jumpforce to 0
endif
if IsKeyPressed 80 ==1
set aimangle to aimangle + 3
endif
if IsKeyPressed 81 ==1
set aimangle to aimangle - 3
endif
if aimangle > 90
set aimangle to 90
endif
if aimangle < -90
set aimangle to -90
endif
endif
SetAngle X aimangle
if idle == 1
PlayGroup Idle 0
endif
set player2x to player2x * 0.3
set player2y to player2y * 0.3
;Player.SetPos Z zPos
;=======
;Teleport
;=======
if(npc.GetDistance player>500)
npc.moveto player
printtoconsole "SCC: %n too far. Moving to player." npc
endif
;===========
;End Teleport
;===========
;if(npc.GetIsCurrentPackage aaaFollow == 0 )
; npc.removescriptpackage
; npc.addscriptpackage amxFollow3
;endif
end
Link to comment
Share on other sites

  • Recently Browsing   0 members

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