Home   Help Search Login Register  

Author Topic: Respawn and Attack  (Read 1489 times)

0 Members and 1 Guest are viewing this topic.

Offline Ghost644

  • Members
  • *
    • Ghostland
Respawn and Attack
« on: 27 May 2006, 16:23:04 »
I have tried many respawn scripts, from Snypirs to other various scripts. Though some are close to perfect for my needs there are some things i want that they do not offer. I would like a script like CHSBAS_v1.0, but have the units attack an area. I want to make a defensive mission that has many waves of units coming in. So the script will need to repeat X amount of times and the spawned units will do a S&D around lets say a marker(town, camp, ect) I do not want the bodies of dead soldiers to dissappear neither. Here is what CHSBAS_v1.0 script looks like, so basically just need some extra lines added to it to do what i want. Unfortunately i do not know a lot about scripting :(

Code: [Select]
;------------------------------------------------------------------;
;--- Scripted by Chaos --- for Operation Flashpoint RESISTANCE ----;
;--------------------------- in December 2005 ---------------------;
;------------------------------------------------------------------;
;------------------------------------ http://www.ofpmdb.de.vu -----;
;------------------------------------------------------------------;
; Syntax:
;   [doorpos,createpoint,direction,basisgroup,leader enemy group] exec "CHSBAS.sqs"
;
; WHAT IS WHAT ?
;   doorpos     - position of the door
;   createpoint - point of creation (units)
;   direction   - direction of the units after they pass the door
;   basisgroup  - basisgroup of the units
;   ldr. e. grp - leader of the enemy group (player group ?)
;
; Example:
;   [pt1,crepointE,180,basisR,leader amis] exec "CHSBAS.sqs"
;
;
; Using of addons:
;   If you want to use addons, you must change the names of positions
;   _men1 to _men12 with these of the addon units
;
; Example:
;   _men1 = "BAS_JRangerGLS"
;   _men2 = "BAS_JRangerRTOS"
;   ..... etc.
;
;------------------------------------------------------------------;

_pt = _this select 0
_cp = _this select 1
_dr = _this select 2
_bas = _this select 3
_enemy = _this select 4

_SPA = getPos _cp select 0
_SPB = getPos _cp select 1
_SPC = getPos _cp select 2

_n = 0

_men1 = "OfficerE"
_men2 = "SoldierEMG"
_men3 = "SoldierEG"
_men4 = "SoldierEB"
_men5 = "SoldierELAW"
_men6 = "HeavyGrenadier"
_men7 = "SoldierEAT"
_men8 = "SoldierEAA"
_men9 = "SoldierEMiner"
_men10 = "SoldierEMedic"
_men11 = "SoldierESaboteurPipeHG"
_men12 = "SoldierESaboteurPipe"

;-------------------------------
;    ZEITLICHE VARIABLITÄT
;       TIME VARIABLITY
;-------------------------------

_ZUX = Random 6
? _ZUX < 1 : _t = 2; goTo "ZT"
? _ZUX < 2 : _t = 4; goTo "ZT"
? _ZUX < 3 : _t = 6; goTo "ZT"
? _ZUX < 4 : _t = 7; goTo "ZT"
? _ZUX < 5 : _t = 8; goTo "ZT"
? _ZUX < 6 : _t = 9; goTo "ZT"

#ZT
~_t

;----------------------------
;     VARIANTEN WÄHLEN
;      CHOOSE VARIANTS
;----------------------------

_FUX = Random 12
? _FUX < 1 : _nmb = 1; goTo "variant"
? _FUX < 2 : _nmb = 2; goTo "variant"
? _FUX < 3 : _nmb = 3; goTo "variant"
? _FUX < 4 : _nmb = 4; goTo "variant"
? _FUX < 5 : _nmb = 5; goTo "variant"
? _FUX < 6 : _nmb = 6; goTo "variant"
? _FUX < 7 : _nmb = 7; goTo "variant"
? _FUX < 8 : _nmb = 8; goTo "variant"
? _FUX < 9 : _nmb = 9; goTo "variant"
? _FUX < 10 : _nmb = 10; goTo "variant"
? _FUX < 11 : _nmb = 11; goTo "variant"
? _FUX < 12 : _nmb = 12; goTo "variant"

;----------------------------
;         VARIANTEN
;          VARIANTS
;----------------------------

#variant
_men1 createUnit [[(_SPA),(_SPB),(_SPC)], _bas,"",0.65,"Sergeant"];
_ldr = (units _bas) select 1
[_ldr] join grpNull
_newgroup = group _ldr
_ldr = Leader _newgroup

? _nmb == 1 : goTo "flw"
~.2
_men2 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.5,"Corporal"];
? _nmb == 2 : goTo "flw"
~.2
_men3 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 3 : goTo "flw"
~.2
_men4 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 4 : goTo "flw"
~.2
_men5 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 5 : goTo "flw"
~.2
_men6 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 6 : goTo "flw"
~.2
_men7 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 7 : goTo "flw"
~.2
_men8 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 8 : goTo "flw"
~.2
_men9 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 9 : goTo "flw"
~.2
_men10 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 10 : goTo "flw"
~.2
_men11 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];
? _nmb == 11 : goTo "flw"
~.2
_men12 createUnit [[(_SPA),(_SPB),(_SPC)],_newgroup,"",0.45,"Private"];

#flw
~1
_ldr setFormDir _dr

#loop0
_men = units _newgroup select _n
_men setUnitPos "up"
_men setBehaviour "aware"
_men setSpeedMode "full"
_men setCombatMode "red"
_men setDir _dr
~1
_n = _n + 1
? _n >= count units _newgroup : _n = 0; goTo "loop1"
goTo "loop0"

#loop1
_men = units _newgroup select _n
_men move getPos _enemy
_men setPos getPos _pt
_men setDir _dr
~2
_n = _n + 1
? _n >= count units _newgroup : _n = 0; goTo "nxt1"
goTo "loop1"

#nxt1
_ldr setFormation "wedge"
_ldr setSpeedMode "full"
_ldr setCombatMode "red"
_ldr setBehaviour "aware"
_ldr setUnitPos "up"
_ldr move getPos _enemy

~15

#loop2
_men = units _newgroup select _n
_men setUnitPos "auto"
~2
_n = _n + 1
? _n >= count units _newgroup : _n = 0; goTo "nxt2"
goTo "loop2"

#nxt2

exit
Ghost

Offline Ghost644

  • Members
  • *
    • Ghostland
Re: Respawn and Attack
« Reply #1 on: 09 Jun 2006, 04:10:22 »
This is the script i have atm
Code: [Select]
?Stopspawn: exit
#loop
"SoldierEB" createUnit [getmarkerpos "spawn1", attackgrp_1]
~.5
"SoldierEB" createUnit [getmarkerpos "spawn1_1", attackgrp_2]
~.5
"SoldierEB" createUnit [getmarkerpos "spawn1_2", attackgrp_3]
~.5
"SoldierEB" createUnit [getmarkerpos "spawn1_3", attackgrp_4]
#start
attackgrp_x move [7968,9182,0]
~.5
goto "loop"

Can anyone see a better way of doing this? I am trying to cut down on a big script so the game wont lag, sinc i do not want the dead bodies to disappear
Ghost