Home   Help Search Login Register  

Author Topic: Go and Defend Script... dont work!  (Read 6297 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Go and Defend Script... dont work!
« Reply #15 on: 20 Jun 2007, 19:19:40 »
Change east by east0 as east is a reserved word for east side. Why do you use createAgent instead of createUnit?

Offline Cheetah

  • Former Staff
  • ****
Re: Go and Defend Script... dont work!
« Reply #16 on: 20 Jun 2007, 19:25:26 »
He wants to avoid adding the unit to a group.

What I normally do is add him to a group unit and immediatly join GrpNull him.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline BozBog

  • Members
  • *
Re: Go and Defend Script... dont work!
« Reply #17 on: 21 Jun 2007, 21:34:29 »
Guess it still dont work :(.. i tried what Mandoble sed.. and about the GrpNull..
...Gosh i ask too much, is that ok? lol well.. how would i go about doing it
properly? the wiki didnt help as i entered the command as shown, and it didnt
work (that was before i used createagent). Thnxs for help :).

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: Go and Defend Script... dont work!
« Reply #18 on: 21 Jun 2007, 21:52:06 »
this is interesting, it would certainly help, however in my opinion the bads out weight the goods here (but with 200+ soldiers on the map at once.. nothings good :P ).  For one, this method takes a lot longer, and secondly its a lot easier and more precise to do it in the editor.  However the main good point is that it looks a lot nicer :D but the player wont know that..
Campaigns are hard, I'll stick with scripting for now!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Go and Defend Script... dont work!
« Reply #19 on: 21 Jun 2007, 21:55:00 »
LOL first change all the para# = setPos by para# setPos. the = sign is breaking the code there.

EDIT: And aside of that, createAgent command doesnt seem to work at all. And BIS Wiki indicates:
"This is a reserved keyword for future implementations"
« Last Edit: 21 Jun 2007, 21:56:59 by Mandoble »

Offline BozBog

  • Members
  • *
Re: Go and Defend Script... dont work!
« Reply #20 on: 21 Jun 2007, 22:10:21 »
Looool i realised that too in the code.. doh both made same mistake. lol bout createAgent, i didnt notice that line in the Wiki.
Everything seems to be working now apart from the units.. and maybe.. if a parachute will only be seen if a unit is in it as i dont see it flying down. oh well, anyways, gonna experiment on the createUnit command.. mite be the only way.
thanks :)

Offline BozBog

  • Members
  • *
Re: Go and Defend Script... dont work!
« Reply #21 on: 21 Jun 2007, 22:26:16 »
Loooool! Looks funny when a unit spawns in midair at 50 meters and they have to get the parachute out quick lol! So i upped it to 150 meters.

Here's the script, it works like a charm ;) hehe thxs all.. can i keep this thread open for any other problems i may have? thxs, cya!

Code: [Select]
;*****************************************************
; ** Defend Position **********************************
; *****************************************************
_specops = createGroup east;

playsound "alarm"
~20
Officer sideChat "Theyre' here! Everyone up the front line and defend!."
~10
Officer sideChat "Do not let them pass the fortresses otherwise we will have to retreat!"
~15


_ang = 0
para1 = "ParachuteEast" createVehicle [0,0,0]
para1 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east1 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east1 moveInDriver para1


~5
_ang = _ang + 45
para2 = "ParachuteEast" createVehicle [0,0,0]
para2 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east2 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east2 moveInDriver para2


~5
_ang = _ang + 45
para3 = "ParachuteEast" createVehicle [0,0,0]
para3 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east3 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east3 moveInDriver para3


~5
_ang = _ang + 45
para4 = "ParachuteEast" createVehicle [0,0,0]
para4 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east4 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east4 moveInDriver para4


~5
_ang = _ang + 45
para5 = "ParachuteEast" createVehicle [0,0,0]
para5 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east5 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east5 moveInDriver para5


~5
_ang = _ang + 45
para6 = "ParachuteEast" createVehicle [0,0,0]
para6 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east6 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east6 moveInDriver para6


~5
_ang = _ang + 45
para7 = "ParachuteEast" createVehicle [0,0,0]
para7 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east7 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east7 moveInDriver para7


~5
_ang = _ang + 45
para8 = "ParachuteEast" createVehicle [0,0,0]
para8 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east8 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east8 moveInDriver para8


~5
_ang = _ang + 45
para9 = "ParachuteEast" createVehicle [0,0,0]
para9 setPos [(getPos logic select 0)+sin(_ang)*20,(getPos logic select 1)+cos(_ang)*20, getpos logic select 2]
east9 = _specops createUnit ["SoldierEB", (position player), [] ,0 ,"seargent"]
east9 moveInDriver para9


@(unitReady leader grp4)&&(unitReady leader grp5)&&(unitReady leader grp6)&&(unitReady leader grp7)&&(unitReady leader grp8)
~10
Officer sideChat "Ok, everyone going in to position? Good. Now try your best not to let them through!"
~10
Officer sideChat "There have been report's via satelite that there are more than 200 unit's on their way"
~10
Officer sideChat "Good luck, out"


exit

;******CREDIT******************************

;**Mandoble - Wicked Scripting ************

;**Cheetah - Trying to help ***************

;**Crashdome - Also trying to help ********

;**Lee - Trying to help too ***************

;**Surdus Priest - Good Advice ************
edit: oops.. again i forgot to modify post! soz!!

editx2: Lol i am interested in the createCenter command.. any chance to tell me what it actually does.. hard to understand on the wiki.. and whether it is useful for my mission.. which involves the play protecting Corozal and when the enemies get closer to the town (more than 200+ units) (IT DONT SLOW MY COMP SO MUCH  :D) the current groups protecting Corozal retreats and goes back to the base near the corozal, and protect that.
« Last Edit: 21 Jun 2007, 22:46:31 by BozBog »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Go and Defend Script... dont work!
« Reply #22 on: 21 Jun 2007, 22:57:00 »
createCenter is used to create a side when no units of that side are intially on the map.
For example, if you put only west side units on the map, east side will not exist, and you will not be able to create any group of east side. But if you place a single east unit in the map, east side is created and then you can create any east group too.

If you want to spawn all your units using scripts, so you will start with none but the payer and its group, then use createCenter at init.sqs to be sure other sides exist. createCenter east, createCenter resistance, createCenter west or/and createCenter civilian.

May be you would also be able to createCenters (sides) for enemy and friendly. enemy and friendly are listed as sides, units in enemy side are enemies to everyone, units in friendly side are friendly to anyone.

Offline BozBog

  • Members
  • *
Re: Go and Defend Script... dont work!
« Reply #23 on: 21 Jun 2007, 23:00:48 »
Ahh rite, nothin i could use lol.. but.. sounds like there may be a possibility that we can have more sides than those mentioned above.. i hope so too.

lool i making another script now.. so the unit's can fallback.. i kno i ask too much.. if thats ok? lol but im wonderin how do i make the unit move to the vehicle and get in it? I dont wanna use moveInCargo.. as it jumps em in.. is there any other way? thxs so much.

Code: [Select]
~10
Officer sideChat "Damn! everybody fall back now! Fall back to the base!!"
~10
Officer sideChat "There's more than 200 unit's here, you people will be overrun!"
~10
Officer sideChat "See you back at the base! Out"

truck1 move (getmarkerpos safehaven)
truck2 move (getmarkerpos safehaven1)

grp4 move (getmarkerpos safehaven)
grp5 move (getmarkerpos safehaven)
grp6 move (getmarkerpos safehaven1)
grp7 move (getmarkerpos safehaven1)

@(unitReady leader truck1)&&(unitReady leader truck2)

grp4 action ["getin", vehicle truck1]
grp5 action ["getin", vehicle truck1]
grp6 action ["getin", vehicle truck2]
grp7 action ["getin", vehicle truck2]

@(unitReady leader grp4)&&(unitReady leader grp5)&&(unitReady leader grp6)&&(unitReady leader grp7)

truck1 move (getPos Officer)
truck2 move (getPos Officer)

exit

this code doesnt work :(.
« Last Edit: 21 Jun 2007, 23:26:45 by BozBog »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Go and Defend Script... dont work!
« Reply #24 on: 21 Jun 2007, 23:51:49 »
cud try createGuardedPoint... even tho i really dont understand wat dat means... mebe mandoble will tell us wat dis 1 does also :D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline BozBog

  • Members
  • *
Re: Go and Defend Script... dont work!
« Reply #25 on: 22 Jun 2007, 00:09:55 »
maybe lol if that's to guard a vehicle (WIKI) but then how would they get in it it lol, yeh Mandoble owns when it comes to commands.. we shuld hear from him :)

cheers!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Go and Defend Script... dont work!
« Reply #26 on: 22 Jun 2007, 00:15:42 »
I wount tell anything about that one  :P

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Go and Defend Script... dont work!
« Reply #27 on: 22 Jun 2007, 00:27:59 »
u just wont admit u dont know  :P

LCD OUT

plz plz tell me ?
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Go and Defend Script... dont work!
« Reply #28 on: 22 Jun 2007, 10:31:25 »
Just an small tip: what guard units in GUARD type waypoints? :D

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Go and Defend Script... dont work!
« Reply #29 on: 22 Jun 2007, 13:13:02 »
dat wat i was thinkin... but rIght now dey seem 2 reinforce ma enemies wen i kill em  :P  :D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta