-
Content Count
1304 -
Joined
-
Last visited
-
Medals
Everything posted by twirly
-
File description.ext, line 90: /RscTitles/LDDK/: Missing '}'
twirly replied to Stones's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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[] = {}; }; -
Determine What side vehicle the player is in?
twirly replied to Kolmain's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Not sure how you might implement this is your case but maybe _veh setvariable ["side","CIV"]; ... and then do the check. -
Spawning Enemies at different specific locations.
twirly replied to Easelm's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This post here might help you http://forums.bistudio.com/showthread.php?t=117220 -
File description.ext, line 90: /RscTitles/LDDK/: Missing '}'
twirly replied to Stones's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well... that code snippet looks fine... so your error seems to be somewhere else. -
Random Building, and Random Position
twirly replied to Kolmain's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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; -
Createvehicle with random "Classname";
twirly replied to daimyo21's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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]; -
Impossible "undefined variable" error?
twirly replied to galzohar's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Actually yes...you're right! Lol! ....and I use that all the time. It just looked strange there for some reason. Sorry! -
Createvehicle with random "Classname";
twirly replied to daimyo21's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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! -
Impossible "undefined variable" error?
twirly replied to galzohar's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
for [ { _i = 0 }, { _i < count(paramsArray) }, { _i = _i + 1 } ] do The square brackets shouldn't be there! -
Createvehicle with random "Classname";
twirly replied to daimyo21's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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?? -
Createvehicle with random "Classname";
twirly replied to daimyo21's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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); -
Createvehicle with random "Classname";
twirly replied to daimyo21's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This post will help you a lot... http://forums.bistudio.com/showthread.php?t=100559 -
Performance Profiling your Functions
twirly replied to wolffy.au's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks for posting this. Will surely help see what's going on. -
Createvehicle with random "Classname";
twirly replied to daimyo21's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try this... _genfood = _randfood select floor (random (count _randfood)) createvehicle getpos _nobject; -
Automatically attacking to enemy units
twirly replied to Warpo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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! -
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");
-
Impossible "undefined variable" error?
twirly replied to galzohar's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
Scene.sqs help please
twirly replied to Steaksauce1337's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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; -
Trigger BLUFOR To Attack Civilian?
twirly replied to Yopoman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You can also try this to make CIVILIAN's hostile to BLUFOR's and vice versa. CIVILIAN setFriend [WEST, 0]; -
Maybe make them friendly to the Zombies until you need them to shoot.
-
Scene.sqs help please
twirly replied to Steaksauce1337's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
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";
-
Looking for a carry script
twirly replied to carlostex's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Not sure if this will help but seems to be a different one here http://forums.bistudio.com/showthread.php?t=92349&highlight=drag -
Spawning Enemies at different specific locations.
twirly replied to Easelm's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
-
Spawning Enemies at different specific locations.
twirly replied to Easelm's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
_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";