Jump to content

twirly

Member
  • Content Count

    1304
  • Joined

  • Last visited

  • Medals

Everything posted by twirly

  1. This is a snippet from my .ext... works fine without the quotes! class heshistory { name = "heshistory"; sound[] = {\sounds\enemy_killed_3.ogg, 1, 1.0}; titles[] = {}; };
  2. Not sure how you might implement this is your case but maybe _veh setvariable ["side","CIV"]; ... and then do the check.
  3. This post here might help you http://forums.bistudio.com/showthread.php?t=117220
  4. Well... that code snippet looks fine... so your error seems to be somewhere else.
  5. Something along these lines maybe... _house = position leader wsqd1 nearestObject "Building"; _posarray = []; _rndpos = []; _pos = []; _cnt = 0; while {format ["%1", _house buildingPos _cnt] != "[0,0,0]" } do { _pos = _house buildingPos _cnt; _posarray = _posarray + [_pos]; _cnt = _cnt + 1; sleep 0.01; }; _rndpos = _posarray select (floor (random (count (_posarray)))); targetdude setpos _rndpos;
  6. You should be able to replace these two lines with one.... _genfood = _randfood select floor (random (count _randfood)) createvehicle getpos _build; _genfood setPos (_build buildingPos _rndpos); Instead of creating _genfood and moving it just create it at _rndpos... so... _genfood = _randfood select floor (random (count _randfood)) createvehicle _rndpos; Also... you need to initialise some things before you use them. That's probably why you aren't getting results. _baskets = []; _pos =[]; _posarray = [];_rndpos = []; _cnt = 0; Use hint or hintsilent to output stuff to the screen along the way to see what's going on. For example add this line after the while loop to see if _posarray actually contains any positions. hint format ["_posarray: %1",_posarray]; EDIT: Added this.... The reason squint is telling you about Private variables is that it is good practice to declare all the variables you use in your script as private to the script using a Private declaration. This is supposed to stop variables from bouncing heads when running multiple versions of the script or scripts that use the same variable names. Look at other peoples scripts to see how they have used it. private ["_randfood","_ranbuilds","_build","_baskets.... etc];
  7. Actually yes...you're right! Lol! ....and I use that all the time. It just looked strange there for some reason. Sorry!
  8. I can give you the code to fix this.... but you will not learn anything that way. Look at what I posted...then look at what you wrote.... see any difference? You really need to understand the basics before taking on a project mate!
  9. for [ { _i = 0 }, { _i < count(paramsArray) }, { _i = _i + 1 } ] do The square brackets shouldn't be there!
  10. Well... as it is:- _randbuilds is the array containing ["bt25", "bt35", etc... ] _build is one random building selected from _randbuilds. The while loop finds the available positions in _build and adds them to an array called _posarray _rndpos is one random position selected from _posarray _genwater is then setpos'd to _rndpos Still confused??
  11. It looks like you are trying to select a random point in a random building. Try breaking the code down into separate bits. I changed things here a little. To select a random item from the array _randbuilds... _randbuilds = ["bt25", "bt35", "bt45"]; _build = _randbuilds select (floor (random (count _randbuilds))); The problem will be knowing how many positions are available in the chosen building. I don't know offhand how to find this out. Maybe someone working with buildings at the moment can help there. SOLVED! To get the available positions in the chosen building.... while {format ["%1", _build buildingpos _cnt] != "[0,0,0]" } do { _pos = _build buildingPos _cnt; _posarray = _posarray + [_pos]; _cnt = _cnt + 1; sleep 0.02; }; _rndpos = _posarray select (floor (random (count (_posarray)))); Finally... _genwater setPos (_build buildingPos _rndpos);
  12. This post will help you a lot... http://forums.bistudio.com/showthread.php?t=100559
  13. Thanks for posting this. Will surely help see what's going on.
  14. Try this... _genfood = _randfood select floor (random (count _randfood)) createvehicle getpos _nobject;
  15. Some help... nearestObjects returns an array (list of men in this case). The list might contain only one man...but it is still a list. To get the nearest man from the list select the first element like this.... _man = _enemy select 0; You also have "Man" there twice...no need for that. You also need to understand how to use side. There are a lot of errors in your script....not just one or two!
  16. If the marker is named "mkr_spawnhere" then the code should be.... _car = "Skoda" [url="http://community.bistudio.com/wiki/createVehicle"]createVehicle[/url] (getMarkerPos "mkr_spawnhere");
  17. My experience with errors like this would make me think it's some kind of timing issue. Something (probably an array) is not being initialised completely before being referenced.
  18. twirly

    Scene.sqs help please

    It was an example for you to learn from! If you can't get the spelling and syntax right you can forget about trying to center the camera. That's the least of your problems! EDIT: Added this.... all I did was move the camera without changing the target. The target now stays centered. showcinemaborder false; titlecut [" ","BLACK IN",1]; _camera = "camera" camcreate [0,0,0]; _camera cameraeffect ["internal", "back"]; //comment "0:19:57" _camera camSetTarget whelo1; _camera camSetRelPos [5,5,2]; _camera camSetFOV 0.700; _camera camCommit 0; waituntil {camCommitted _camera}; sleep 5; _camera camSetRelPos [-5,-5,2]; _camera camCommit 5; waituntil {camCommitted _camera}; sleep 5; _camera cameraeffect ["terminate","back"]; camdestroy _camera;
  19. You can also try this to make CIVILIAN's hostile to BLUFOR's and vice versa. CIVILIAN setFriend [WEST, 0];
  20. twirly

    Quarantine

    Maybe make them friendly to the Zombies until you need them to shoot.
  21. twirly

    Scene.sqs help please

    I see quite a few errors there man. showcinenaborder false (spelling error) @camCommitted_camera should be @ camCommited _camera Here is a little snippet in sqf format.... hope it helps you. 1. In the mission editor place a helicopter....call it helo1 2. Then place a UAV..... call it uav1 3. In your mission folder create init.sqf and put this code in it.... sleep 5; showcinemaborder false; titlecut [" ","BLACK IN",1]; _camera = "camera" camcreate [0,0,0]; _camera cameraeffect ["internal", "back"]; //comment "0:19:57" _camera camSetTarget helo1; _camera camSetRelPos [5,5,2]; _camera camSetFOV 0.700; _camera camCommit 0; waituntil {camCommitted _camera}; sleep 5; //comment "0:16:27"; _camera camSetTarget uav1; _camera camSetRelPos [5,5,2]; _camera camSetFOV 0.700; _camera camCommit 5; waituntil {camCommitted _camera}; sleep 5; _camera cameraeffect ["terminate","back"]; camdestroy _camera; Run the mission.
  22. twirly

    Quarantine

    I tried this... giving them a "HOLD" waypoint at their current location. They run in the direction of the contact but don't seem to go very far. Your mileage might vary. I didn't do a whole lot of testing. I also tried "SENTRY"..... but "HOLD" seems to work a little better. Put this in the init of one unit in each group. nul = group this addWayPoint [position leader group this,10]; [group this,1] setWayPointType "HOLD";
  23. Not sure if this will help but seems to be a different one here http://forums.bistudio.com/showthread.php?t=92349&highlight=drag
  24. _bomb = "Bo_GBU12_LGB" createVehicle getPos leader westgrp1; EDIT: Added some more..... This is probably what you need. For "bomb.sqf"..... _unit = _this select 0; _bomb = "Bo_GBU12_LGB" createVehicle getpos _unit ; For the trigger.... nul = [thislist select 0] execVM "bomb.sqf";
×