Forum Jump :

Author Message


Posts: 3
Rank:


Level: Member

Country: au
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2016-10-03 10:47        
     
I am trying to create a script where a player can spawn in 10 AI at a given time as an addaction but I am having an issue with the For Var script I am using.

This is the setup:

for "_i" from 0 to 10 do
{
	hint “spawning new soldier”;
       _newSoldier = "B_Soldier_GL_F" createVehicle (position player);
        sleep 2;
        hint format [“Cycle: %1 Complete”,_i];
        sleep 2;
};
Ignore the createvehicle thing..it works when I try the code as a for spec loop but somehow nothing happens when I try a for var loop. More specifically I get an error that says 'Error invalid number in expression'

Any help please?

This post was edited by Echo93 (2016-10-03 12:43, 748 days ago)


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 21
In-game name: Wak

 
#2 Posted at 2016-10-03 12:13        
     
You can use the sqf tags to post script code:
[highlight=sqf][/highlight]

You problem might be that you have a space here:
_|#|newSoldier

It might also be that sqf doesn't work with those quote characters (“, ”), try this one: "

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 3
Rank:


Level: Member

Country: au
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2016-10-03 12:54        
     
Ah cheers! I thought I was going loco :-)

Anyway back to tinkering....