Jump to content

sasij

Member
  • Content Count

    8
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About sasij

  • Rank
    Private

core_pfieldgroups_3

  • Interests
    Drumming, Guitar, Programming
  1. I dunno. Maybe if I can figure out how to get zombie models into the a3 engine. It works decently but it's not very appealing to see your "zombies" as humans. I just made the zombie code for fun in case I ever felt like doing a mission with zombies.
  2. I've actually had no problem with this function at all. Works great on my end it seems. I've drawn lines and always get the correct eye positions. This is a snippet of the basic code I came up with. Haven't had any issues that I've noticed. case "Chase": { { _this doMove (getPos _x); if((_x distance _this)<1.5) then { _state = "Attack"; }; if((_x distance _this)>100 || terrainIntersect[ASLtoATL(eyePos _x), ASLtoATL(eyePos _this)] || lineIntersects[eyePos _x, eyePos _this, _x, _this]) then { _state = "Wander"; _this setSpeedMode "LIMITED"; }; }forEach playableUnits; //drawLine3D [ASLtoATL(eyePos player), ASLtoATL(eyePos _this), [1,0,0,1]]; };
  3. What about something basic like this? while {alive _unit} do { if((getMarkerPos "spwn1" distance _unit)>200) _unit setDamage 1; };
  4. Try this. this setCombatMode "BLUE";
  5. sasij

    GUI Wont Show Up!

    Could this be it? #define GUI_GRID_X (0) #define GUI_GRID_Y (0) #define GUI_GRID_W (0.025) #define GUI_GRID_H (0.04)
  6. Trying to get random loot to spawn in buildings at a random position in the building. The script works in the form of spawning in the loot just fine when I don't have it set to pick a random spot in the building. Hard to explain so I'll just show my simplistic code and hope somebody can give em a good slap in the face at whatever obvious mistake I'm making. If I uncomment the setPos line which sets position according to _i which is just 0,1,2,3 etc the code works fine and will spawn items in the first 4 spots on the building. If I try using the setPos using a random number from the building positions count it doesn't work properly. I will run into buildings and sometimes see a loot pile. Most of the time I see none then I change the one line and see all my loot piles. Sorry for babbling, to the code then.. _buildings = [List of building classes...]; _loot_weapons = [List of gun classes...]; _loot_ammo = [List of ammo classes...]; _posCount = 0; _max = 4; _total_loot = 0; _nearObjects = nearestObjects [[10000,10000,0], _buildings, 20000]; { while {format ["%1", _x buildingPos _posCount] != "[0,0,0]"} do { _posCount = _posCount + 1 }; _i = 0; while {_i<_max} do { _pos = floor(random _posCount); _rand_w = floor(random (count _loot_weapons-1)); _rand_a = floor(random (count _loot_ammo-1)); _gun_loot = _loot_weapons select _rand_w; _ammo_loot = _loot_ammo select _rand_a; _spawnedObject = createVehicle ["GroundWeaponHolder", [0,0,0], [], 0, "CAN_COLLIDE"]; _spawnedObject addWeaponCargoGlobal [_gun_loot,1]; _spawnedObject addMagazineCargoGlobal [_ammo_loot, 3]; //_spawnedObject setPos (_x buildingPos _i); _spawnedObject setPos (_x buildingPos _pos); _total_loot = _total_loot+1; _i = _i+1; }; sleep 0.1; }forEach _nearObjects; hintC format["Spawned %1 Loot Piles.", _total_loot]; ---------- Post added at 01:30 ---------- Previous post was at 23:38 ---------- Oops I forgot to reset _posCount to 0 each iteration of the array. Well I guess that solves that.
  7. Thanks for the response but I had already tried using player to no avail. But I did manage to fix my problem just now. Not sure if it's the correct way but it seems to have worked. So for anyone else with a similar issue here is how I got it. _me = _this select 0; _me addAction ["Check Hunger and Thirst Levels.", "check_foodwater.sqf"]; _me addaction ["Heal Self.","heal.sqf"];
  8. Hello, I'm completely new to scripting for arma games so I do apologize if this is old but I have been searching google and forums for a couple hours now with no luck. My problem is that I am trying to add action to the player with addAction. It works fine if I put addAction[] etc.. in the "init" box of the unit manually. But I am trying now to put nul = [this] execVM "respawn.sqf"; in the init box and all the code in a script. The code is executed but my player gets no additional actions like he did when I enter it in the init box manually. Any idea what I am doing wrong? Perhaps I need to reference "this" differently? Thanks to anyone who can assist. respawn.sqf titleText ["Respawn Event handled. Food and Water reset.", "PLAIN"]; hunger = 0; thirst = 0; this addAction ["Check Hunger and Thirst Levels.", "check_foodwater.sqf"]; this addaction ["Heal Self.","heal.sqf"];
×