Eatingyou
-
Content Count
5 -
Joined
-
Last visited
-
Medals
Posts posted by Eatingyou
-
-
I have got some problems with my script to spawn random npcs on a random marker and with random weapons and random magazines. The random Npcs on the random positions are working fine, but i can't figure out, how to use the addWeapon and addMagazine comand in the initialisation line of the spawned npcs. I removed the default weapons with the removeAllWeapons comand. The point of my plan with this script is, to randomize the amount of magazines of the npcs. Please post some ideas how to get this script working with a random amount of magazines.
_GrpTwo = createGroup EAST; _skill = random 1; if (_skill <= 0.3) then {_skill = _skill + 0.3}; Hint "Die Russen kommen!!!"; _spawnArray = ["AI1","AI2","AI3"]; _enemyArray = ["RU_Soldier","RU_Soldier_Medic","RU_Soldier_MG","RU_Soldier_Sniper","RU_Soldier_AT","RU_Soldier_GL","RU_Soldier_Officer","RU_Soldier2","RU_Soldier_Marksman","RU_Soldier","RU_Soldier2"]; _spawn = _spawnArray select (floor (random (count _spawnArray))); _enemy = _enemyArray select (floor (random (count _enemyArray))); _unit = _GrpTwo createUnit [_enemy, getMarkerPos _spawn,[],0, "FORM"]; _unit setrank "PRIVATE"; _unit setskill _skill; removeAllWeapons _unit; removeAllItems _unit; sleep 0.1; nul = [_unit] execVM "Scripts\Spawn\RU Kits\Kits.sqf";Scripts\Spawn\RU Kits\Kits.sqf
private ["_unit"]; _unit = this select 0; hint "Los"; _kit1 = ["AK_107_kobra", "30Rnd_545x39_AK"]; _kit2 = ["SVD", "10Rnd_762x54_SVD"]; _kit3 = ["RPK_74", "75Rnd_545x39_RPK"]; _kitArray = [_kit1, _kit2, _kit3]; hint "1"; _kit = _kitArray select (floor (random (count _kitArray))); _weapon = _kit select 0; _magazine = _kit select 1; hint "2"; _unit addWeapon _weapon; amnt = ceil (random 3); counter = 0; while{counter <= amnt} do { _unit addmagazine _magazine; counter = counter +1;}; hint "3"; -
You missed one quote at the "p7" part of the array.I know you told me in Teamspeak, but why do you post this here? :P
Do you need posts? :P
-
Thank you i'll try if that works.
---------- Post added at 15:57 ---------- Previous post was at 14:27 ----------
Maybe move that from the init field into the init.sqf after a sleep and a waitUntil {player == player}; check? So if someone's slow in loading it won't make the chute till you're actually in game?okay, i tried like to do what yous aind and this is my code:
sleep 30;
hint "Debug script loaded";
_playerArray ["p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", "p16", "p17", "p18", "p19", "p20", "p21", "p22", "p23", "p24", "p25", "p26", "p27, "p28", "p29", "p30", "p31", "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39", "p40", "p41", "p42", "p43", "p44"];
_playerCounter = 0;
while {(_playerCounter +1)< (count _playerArray)} do {if ((_playerArray select _playerCounter) == player) then {(_playerArray select _playerCounter) exec "ca\air2\halo\data\scripts\halo_getout.sqs"; _playerCounter = _playerCunter +1};};
hint "Done";
Okay thank you it works :D
-
Hey,
i wrote this in the init line of every unit: [this] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs"
and when i try my mission in the editor there are no problems with my steerable chute, but when in play this with my friend in a mp mission, i often happens, that one of us hasn't got a chute at all and dies because of the impact. Somethimes it is him, sometime it is me, who hasn't got a parachute but i don't why.
Sorry for my bad english and i hope to get some answers.
addWeapon Problems, no RPT file
in ARMA 2 & OA : MISSIONS - Editing & Scripting
Posted
@tryteyker thanks for your help but if i use your idea in my script
private ["_unit"]; _unit = this select 0; hint "Los"; _kit1 = ["AK_107_kobra", "30Rnd_545x39_AK"]; _kit2 = ["SVD", "10Rnd_762x54_SVD"]; _kit3 = ["RPK_74", "75Rnd_545x39_RPK"]; _kitArray = [_kit1, _kit2, _kit3]; hint "1"; _kit = _kitArray select (floor (random (count _kitArray))); _weapon = (_kit select 0) select 0; _magazine = (_kit select 0) select 1; hint "2"; _unit addWeapon _weapon; amnt = ceil (random 3); counter = 0; while{counter <= amnt} do { _unit addmagazine _magazine; counter = counter +1;}; hint "3";i get this error messege and the unit stil hasn't got a gun:
Maybe i didn't understood your idea as you ment it so I hope you can explain your idea a little bit more precise for my script if i was doing it wrong.