FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visitView your postsView unanswered posts

Lifeguard for Player Script?

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
Frog_808

New Member
New Member


Joined: 13 May 2020
Posts: 16

44 Bank Notes
Items

PostPosted: Sun Nov 22, 2020 11:23 am    Post subject: Lifeguard for Player Script? Reply with quote

Hello, does anyone have an idea for an script of an enemy who guards the player?

(Follow player and shoot at enemys)

I would be grateful.
Back to top
View user's profile Send private message
SooperK

Junior Member
Junior Member


Joined: 10 Nov 2014
Posts: 52
Location: Jennewa, Airdenor
114 Bank Notes
Items

PostPosted: Mon Nov 23, 2020 12:14 am    Post subject: Lifeguard for Player Script? Reply with quote

Bodyguard script: In this example I used "sam" in findactor 0, but you would put in the name of whatever you named your bodyguard

enemy_vidim 0
dim_frm 4
dim_act 6
dim_flt 5
commandblock 1
findactor 0, "Sam"
findactor 5, "Tommy"
human_addweapon 0, 10, 50, 200
human_holster 0
frm_seton 3, 0
commandblock 0
human_set8slot 0, 1
let flt[3] = 1
{ up
if flt[3] = 0, -1, 1
Label F
enemy_action_follow 5, 1.2, CROUCH
goto F
label 1
goto 1
}
event use_ab
enemy_actionsclear
wingman_setindicator 0, 1, 0
enemy_vidim 1
label Follow
event_use_cb 1
if flt[3] = 1, 2, -1
enemy_forcescript 0
let flt[3] = 1
return
label 2
let flt[3] = 0
return

enemy_vidim 0
dim_frm 4
dim_act 6
dim_flt 5
commandblock 1
findactor 0, "Sam"
findactor 5, "Tommy"
human_addweapon 0, 10, 50, 200
human_holster 0
frm_seton 3, 0
commandblock 0
human_set8slot 0, 1
let flt[3] = 1
{ up
if flt[3] = 0, -1, 1
Label F
enemy_action_follow 5, 1.2, CROUCH
goto F
label 1
goto 1
}
event use_ab
enemy_actionsclear
wingman_setindicator 0, 1, 0
enemy_vidim 1
label Follow
event_use_cb 1
if flt[3] = 1, 2, -1
enemy_forcescript 0
let flt[3] = 1
return
label 2
let flt[3] = 0
return
Back to top
View user's profile Send private message
Frog_808

New Member
New Member


Joined: 13 May 2020
Posts: 16

44 Bank Notes
Items

PostPosted: Tue Nov 24, 2020 7:16 pm    Post subject: Lifeguard for Player Script? Reply with quote

Thanks! I will try it out.

Can you explain me, what "human_set8slot" do?
Back to top
View user's profile Send private message
SooperK

Junior Member
Junior Member


Joined: 10 Nov 2014
Posts: 52
Location: Jennewa, Airdenor
114 Bank Notes
Items

PostPosted: Tue Nov 24, 2020 9:00 pm    Post subject: Lifeguard for Player Script? Reply with quote

HUMAN_SET8SLOT XX,YY
???Allows an actor to have eight inventory slots?
xx == ID of Actor to set
yy == Toggle (1 = on,0 = off)

The above is directly copied out of SomebodY's improved Script Ref which can be downloaded from this site. Its an awesome tool I use alot to understand script
Back to top
View user's profile Send private message
Frog_808

New Member
New Member


Joined: 13 May 2020
Posts: 16

44 Bank Notes
Items

PostPosted: Wed Nov 25, 2020 4:02 pm    Post subject: Lifeguard for Player Script? Reply with quote

Yes, I know that. But I had tried out at Tommy and I can´t see 8 inventory slots.
But thanks anyways.
Back to top
View user's profile Send private message
MatteoCapoletti

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 05 Mar 2013
Posts: 536

1054 Bank Notes
Items

PostPosted: Fri Jan 15, 2021 7:21 pm    Post subject: Lifeguard for Player Script? Reply with quote

On Capoletti Mod I used this script

I had 15 body guards that My guy could activate by clicking on them. Then they would follow Tommy around a fight with Him

The First Body guard got a special script

Matman1 Script

-----------
commandblock 1
dim_flt 2
dim_act 15

(this section identifies all 15 body guards and Tommy)

findactor 0,"matman1"
findactor 1,"matman2"
findactor 2,"matman3"
findactor 3,"matman4"
findactor 4,"matman5"
findactor 5,"matman6"
findactor 6,"matman7"
findactor 7,"matman8"
findactor 8,"matman9"
findactor 9,"matman10"
findactor 10,"matman11"
findactor 11,"matman12"
findactor 12,"matman13"
findactor 13,"matman14"
findactor 14,"matman15"
findactor 15,"Tommy"

( This section gave the body guard a weapon)

human_addweapon 0, 10, 50, 500
human_holster 0
commandblock 0

(This section made all 16 characters as part of a team so they would not shoot eachother)

enemy_group_new 0
enemy_group_add 0,1
enemy_group_add 0,2
enemy_group_add 0,3
enemy_group_add 0,4
enemy_group_add 0,5
enemy_group_add 0,6
enemy_group_add 0,7
enemy_group_add 0,8
enemy_group_add 0,9
enemy_group_add 0,10
enemy_group_add 0,11
enemy_group_add 0,12
enemy_group_add 0,13
enemy_group_add 0,14
enemy_group_add 0,15

(This was an animation that played until the body guard was activated)

label 110
{ up
label 107
enemy_playanim "KurakLoop.i3d",0
wait 5000
enemy_playanim "KurakPotahnuti.i3d",0
let flt[0]=flt[0]-83
wait flt[0]
emitparticle 0,25
goto 107
}

( This script is what made them follow tommy, when he clicked on them)


event use_ab,10970007
enemy_action_follow 10, 5, crouch, nonext


That script was only for the first body guard, known as matman1
All the other matmans got a shorter script as only one was needed to group them


Scripts for matman2-matman14

commandblock 1
dim_flt 2
dim_act 2

findactor 0,"matman2"
findactor 1,"Tommy"

human_addweapon 0, 10, 50, 500
human_holster 0
commandblock 0


label 110
{ up
label 107
enemy_playanim "KurakLoop.i3d",0
wait 6000
enemy_playanim "KurakPotahnuti.i3d",0
let flt[0]=flt[0]-83
wait flt[0]
emitparticle 0,25
goto 107
}

event use_ab,10970007
enemy_action_follow 1, 5, crouch, nonext
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.020 | Queries: 18