Welcome Guest ( Log In | Register )

 Forum Rules ArmedAssault.info Forum Rules
Reply to this topicStart new topic
> Need Scripting Help!
post Jun 23 2012, 22:16
Post #1

New Member

Group: Members
Posts: 2
Joined: 23-June 12
Member No.: 9,658

Ok so i have NEVER scripted in this language before, so yeah im a noob.

I pulled this script from another thread to use in my mission (credit to Linker Split) and modified it to do what i wanted it but can't see what im doing wrong as i do not know this syntax.

So basically it is for an enemy spawner, im using two files.

The Spawn.sqs reads:

#Spawn script by Linker Split

#[markerstart,markerend,time,totalunits] exec "spawn.sqs"

_MarkerStart = _this select 0
_MarkerEnd = _this select 1
_t = _this select 2
_totalfinalunits = _this select 4
_amount = _this select 3

_posS = getMarkerPos _MarkerStart
_posE = getMarkerPos _MarkerEnd

_unit= createUnit ["SoldierWB", _posS [_this setCombatMode "RED";_this domove getMarkerPos _posE], 0, "NONE"]
_amount = _amount + 1

_amount < _totalfinalunits : goto "START"

What i want it to do is: spawn 3 units at a time until a total of 15 units have been spawned, with an interval of 10.
If the total amount of units (15) has been spawned i want the script to stop (but not terminate)
I do not want the script to end, this is because if the number of spawned units falls below 15, i want the script to spawn more units as before until there are more or equal to 15 again.

The init.sqs reads:

["MarkerStart","MarkerEnd",10,3,15] exec "spawn.sqs"

Now im not sure if i have these files the wrong way round, if some code is wrong, or if its just all complete rubbish.
I would appreciate any help, if you feel like it i would love for someone to re-write this script for me.
Thank you in advance!
Quote Post
post Jun 23 2012, 22:34
Post #2

New Member

Group: Members
Posts: 2
Joined: 23-June 12
Member No.: 9,658

Note: i realise that the last line of the script will not work as i havnt written a way to measure if the total numer of active enemy units are less than 15... i honestly havnt a clue what im doing but at the moment this script does nothing and im unsure as to why
Quote Post
post Jun 23 2012, 23:32
Post #3

Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155

Hi smile.gif

If you just want to add something to your post, can you use the edit button in the future, rather than double-posting? Thanks.

On topic, I'm not a scripting expert, but I did notice you're trying to spawn the class "SoldierWB" - this class only exists a reference in ArmA.2, so you shouldn't try to spawn it ingame, as it'll probably crash your game. You can find a list of ArmA.2 and OA classes here. The closest equivalent to SolderWB would probably be USMC_Soldier.

The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I donít understand it, Iím afraid of it, and one day Iíll accidentally be killed by one.
Quote Post

Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:


Lo-Fi Version Time is now: 21st August 2019 - 21:17