mrcurry 496 Posted February 10, 2010 (edited) Aight I need some help troubleshooting this script execution Basicly I've got a script for spawning an infantry group at a position with a SAD waypoint at somewhere, parameters being: spawn (Position) grouptypes (Array) target (Position) side (Side) Init.sqf is: SPAWN_WAVE = compile loadFile ("scripts\spawn_wave.sqf"); SPAWN_INF = compile loadFile ("scripts\spawn_infantry.sqf"); SPAWN_VEC = compile loadFile ("scripts\spawn_vehicles.sqf"); eastHQ=createCenter east; westHQ=createCenter west; infantry_groups = [(configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSection"),(configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSection_MG")]; l_vehicles = ["UAZ_AGS30_RU","UAZ_MG_Base","BRDM2_Base","BTR90_Base"]; h_vehicles = ["BMP2_Base","BMP3","T72_RU","T90"]; To test it out I've added a trigger with onAct code: hint "Inf activated!"; rawr=[getPos inf1, infantry_groups, getPos fb_hill, east] call SPAWN_INF; //this is basicly where it fails In the script itself I've added, for debug purposes sleep(3); hint "A"; And as I set of the trigger I get "Inf activated!" and... nothing... if i print the script variables I get what i should, aka the script itself. So why is it not running the script? Edited February 10, 2010 by mrCurry Share this post Link to post Share on other sites
Big Dawg KS 6 Posted February 11, 2010 Well, you can't sleep in a function called with call, and to be honest I don't see why you even need to use call. Use spawn or execVM instead, should work better. Share this post Link to post Share on other sites
mrcurry 496 Posted February 11, 2010 (edited) well execVM wont work, since i wan't to return the group that has just spawned, im not sure about spawn but execVM returns a script handle the sleep is just there for test purposes but cheers for the headsup, still dont get the hint that should come after so it aint solving me problem. Edited February 11, 2010 by mrCurry Share this post Link to post Share on other sites
Big Dawg KS 6 Posted February 11, 2010 Well, you didn't post your actual script in question, so it's hard to identify the problem... Share this post Link to post Share on other sites
mrcurry 496 Posted February 11, 2010 well the problem obviously isnt in the script since the first line in the script is: hint "A"; which doesn't show up... but sure here it is: hint "A"; if(!isServer) exitWith{}; waitUntil {!isNil "bis_fnc_init"}; _pos = _this select 0; _grps = _this select 1; _target = _this select 2; _side = _this select 3; hint "B"; _grp = _grps select floor(random count _grps); hint formatText["%1",_grp]; _spawnGrp = [_pos, _side, _grp] call BIS_fnc_spawnGroup; hint formatText["%1",_spawnGrp]; _speeds=["NORMAL","FULL"]; _spawnGrp setSpeedMode "FULL"; _spawnGrp setBehaviour "COMBAT"; _spawnGrp setCombatMode "RED"; _wp1 = _spawnGrp addWaypoint[_target,5]; _wp1 setWaypointType "SAD"; _spawnGrp so basically the script doesn't execute Share this post Link to post Share on other sites
Monsada 10 Posted February 11, 2010 Im not sure but try compile preprocess I supose this fucntions runs ok then try: SPAWN_WAVE = compile preprocessFileLineNumbers ("scripts\spawn_wave.sqf"); SPAWN_INF = compile preprocessFileLineNumbers ("scripts\spawn_infantry.sqf"); SPAWN_VEC = compile preprocessFileLineNumbers ("scripts\spawn_vehicles.sqf"); in yor trigger: sidechat format["inf1=%1", inf1]; sidechat format["infantry_groups=%1", count infantry_groups]; sidechat format["fb_hill=%1", getPos fb_hill]; rawr=[getPos inf1, infantry_groups, getPos fb_hill, east] call SPAWN_INF; //this is basicly where it fails if u get troubles checks for errors in: C:\Users\"YOUR MACHINE"\AppData\Local\ArmA 2\arma2.RPT Share this post Link to post Share on other sites
mrcurry 496 Posted February 11, 2010 Yepp that solved it, could anyone explain why though? been lookin on the biki and there call, compile and loadFile are used together in some examples thx alot :) Share this post Link to post Share on other sites
Monsada 10 Posted February 11, 2010 (edited) loadfile only loads a file wathis more there are some characters not compiled. its all. Now u would make me a favour, take a look at UPSMON, it will love u, sure, let me know Edited February 11, 2010 by Monsada Share this post Link to post Share on other sites