JacobJ
-
Content Count
308 -
Joined
-
Last visited
-
Medals
Posts posted by JacobJ
-
-
That simple... hmm I doesnt seem to have understood what refers to what. Thank you very much!
-
Okay the two different type result in this: Shuko's version doesnt give the number, but "scalar" and Celery, yours give "any" instead of the number. How can this be?
-
I get and error: Error 1 elements provided, 1 expected.
What does this mean?
-
Hey all
I have a script that returs a number and that number is put to a variable called mst.
mst = 10;
How would I get that number into a task? This doesnt seem to work:
tskMST = player createSimpleTask ["Step"]; tskMST setSimpleTaskDescription ["Step: mst", "Step: mst", "Step: mst"];
/Jacob
-
Hey all
I have a point/rating system in my mission and it can be set to "Off" or "On" in the parameters in the lobby. Off does nothing and On runs a script that activates the point-system.
Now, I want to check if this was On or Off at the end of the game. If it was off there would not be created a task saying what points you have got. If it was set to ON I would like to display the points in the debriefing screen.
Can I somehow check if a script has been executed or can I refer to the "On"/"Off" or maybe their values 1/2?
/Jacob
//Til Pointsystem switch (paramsarray select 5) do { case 1: { nul = [] execVM "points.sqf"}; case 2: {}; };class pntsystem { title = "Point-system"; values[] = {1,2}; default = 2; texts[] = {"On", "Off"}; }; -
Okay, that is one cool script you got there. Very nice! I will defenetly use this in my mission now. Thank you very much!
-
Hey all
I have made a trigger with civilians present and repeatable. This trigger covers a village. I have ALICE placed in the village and only in that village.
When I make a call for how many civilians there is present in the trigger I get 71, but there is only 35 civilians, 5 wreaks and some SLIVE cars.
This is what I use to call the count:
_pop = civilian countSide list countzone;
hint str _pop;
I have found a script that seems to do what I want, but it only works on civilians you place in the editor and not the once generated by ALICE.
Here is the script(s):
civ_init.sqf
/* trigger act by Civilians Present nul = [thisList, side] execVM "nokillciv\civ_Init.sqf"; side = WEST, EAST */ private [ "_civLista" ]; _civLista = _this select 0; // list of all civilians RAF_KilledBySide = _this select 1; // side which count the kills { if (_x isKindOf "civilian") then { _x AddEventHandler ["killed", {nul= _this execVM "nokillciv\CountKilledCiv.sqf";}]; }; } forEach _civLista; cyw = 0;Countkilledciv.sqf:
private [ "_killerSide", "_side" ]; _side = RAF_KilledBySide; _killerSide = side (_this select 1); if (_side == _killerSide) then { cyw = cyw + 1; };Is there another way to display how many civilians there is in the town or even in the whole map (because I have no other civilians in the mission and I dont have ALICE in other towns)?
/Jacob
-
No I dont have anyone to captive. I think it has something to do with my triggers that makes the lists that I count. Ill have a look at this when I get that with the ALICE sorted.
I have a question about the townlist in ALICE. My town is called Shukukalay and I have added that to the BIS_fnc_locations, so that the city gets populated. How would I make a townlist only for this city. I dont understand the example that is given in the link you send me:
this setvariable ["townlist",[bis_loc_acityc_mogilevka,[position this,3000],trigger1]];
---------- Post added at 19:24 ---------- Previous post was at 19:01 ----------
I have tried this:
this setVariable ["townlist",[[],Shukurkalay]];
But it doesnt work. All other cities gets populated too.
-
Okay thank you very much, now I have something to work with.
I think it is to complicated using the rating-system as is. I think I will make my own.
I will have a look at that link and see if I can find what I need.
---------- Post added at 18:23 ---------- Previous post was at 17:55 ----------
I have a very weird problem.
_allunits = count allunits;
hint str _allunits;
that displays one less than it should!
I have counted and counted and I have 70 units and it displays 69.
What can be the problem?
-
Okay, what about the rating values? Can I change them? like when a civilian gets killed you lose 200 points instead of 400 points?
I know this sounds a bit newbish but how do I put units into a group and how do I set the groups name?
---------- Post added at 05:34 PM ---------- Previous post was at 05:30 PM ----------
Can I somehow make the civilians that gets added to a mission with ALICE a permanent number, so that when the game starts, civilians gets placed only in one definded city and there is not spawning anymore civilians, also not if they die or there is no-one around to look at them (the player is outside the placement radius of ALICE)?
-
Hey all
I am looking for a point/rating-system.
I want team west to start out with let say 1600 points.
When something happens, lets say a tower gets destroyed, 200 points is being added to their points.
I was looking at the addrating and I can make it work, but how do I define the starting rating for the whole team and how to I disable the standard rating values or how do I redefine them? Hope I made myself clear enough.
/Jacob
-
yeah thats true, I get the concept. Thanks for the help!
-
Okay I got it working. The _x in the call command needs to be _this
---------- Post added at 10:28 ---------- Previous post was at 10:25 ----------
Okay else the script would start every second?
So the loop is only there to remove the weapons, and the other spawn starts the spectator and runs the config script right?
-
yes that did work. There needs an A in removeallweApons, just for information. Thank you again my fellow skandinavian friend.
---------- Post added at 10:21 ---------- Previous post was at 10:08 ----------
Can I somehow make more things that the script does? Like starting the spectator-mode and run a script?
I can't seem to get this to work:
[] spawn { while {sleep 1; true} do { {removeallweapons _x} foreach (list trigName); {_x call ace_fnc_startSpectator} foreach (list trigName); {nul = [] execVM "spectator.sqf"} foreach (list trigName); }; };The idea would then be to force the dead players into spectating mode and run the additional configurations of the spectating-mode with that script.
When I try this code out, the player won't even remove his weapon.
-
Hey all
How would I make a trigger that has an area and if anybody is present inside this area all weapons of each unit gets removed?
Ive tried to make a trigger with: anybody present, repeatable, condition: this, OnAct: {removeallweapons _x} foreach thislist;
But it doesnt work for people that respawn or gets teleported into the area, only on people inside the area the first time the trigger gets triggered.
How can I make it repeatable, so all that every comes into the area looses their guns?
/Jacob
-
will this only kill the units in the area or will that kill all units in the map?
-
Of course! I just have to remove the players in that area from the target list of the spectating script. Nice one.. I will try that out.
---------- Post added at 17:40 ---------- Previous post was at 17:29 ----------
How do I am a trigger that when someone enters it, he gets killed. I tried using player setdamage 1, but when I order an AI to go into the area I get killed and not the AI.
I want the opposite of the zone restriction module, because this module kills everything outside it.
-
Oh yeah.. eh well I know how to move the respawn_west marker, but the problem is, that when the dead players respawn, they can be spectated, but I guess that is no problem. If you look at it this way; what do you want, to be locked in an remote area with nothing to do or do you want to spectate the other players that are alive.
Havnt thought of it that way. I will try it out and see how it works out for this mission.
-
Indeed indeed! that did the trick.
Thank you very much for your help. Now I am a big step closer to finishing my first 10on10 mission. I think there are a lot of people out there wanting a script like this.
ps. you don't know how to change the respawntype on the fly with a script? Or am I locked with the respawntype I choose in the description.ext?
-
Hmm can I just make a script with respawn = 1; ect and then run the script and it will override the respawn = "BIRD"; I have in the description.ext? I have tried that and it doesnt seem to work.
-
Hey all
I got my spectating to work and to get this to work I have to put respawn = "BIRD"; in the description.ext.
The first 20mins tho I want to respawn at base. I have a marker called respawn_west and all, but I can't find any command in wiki, that can change the respawntype. What can I do?
/Jacob
-
Is this how you meant it? It doesnt work this way for me. I can pick up the crate but then I get no further options.
//Attach script SHK_CarriedObject = objNull; SHK_loadAmmobox = { private ["_veh","_pos"]; _veh = cursorTarget; switch true do { case (_veh iskindof "MH60S"): {_pos = [0,-0.2,0.4]}; case (_veh iskindof "MH6J_EP1"): {_pos = [0,0.7,0.25]}; case (_veh iskindof "Ural_CDF"): {_pos = [0.5,0.3,0.7]}; case (_veh iskindof "HMMWV_Armored"): {_pos = [0,-1.5,-0.5]}; case (_veh iskindof "HMMWV_M2"): {_pos = [0,-1.5,-0.5]}; case (_veh iskindof "ACE_HC130_N"): {_pos = [0,0,-3.5]}; case (_veh iskindof "BAF_Merlin_HC3_D"): {_pos = [0,0,-0.5]}; default {_pos = []}; }; if (count _pos == 0) then { private "_name"; _name = getText (configFile >> "CfgVehicles" >> typeof _veh >> "displayName"); hint format ["You are not allowed to load the box on to:\n%1",_name]; } else { detach SHK_CarriedObject; SHK_CarriedObject attachto [_veh,_pos]; _veh setvariable ["SHK_LoadedObject",SHK_CarriedObject,true]; SHK_CarriedObject = objNull; }; }; SHK_unloadAmmobox = { private ["_box","_veh","_pos"]; _veh = _this select 0; _box = _veh getvariable "SHK_LoadedObject"; detach _box; _pos = _veh modelToWorld [-5,0,0]; _box setPos [_pos select 0, _pos select 1, 0]; _veh setvariable ["SHK_LoadedObject",objNull,true]; }; SHK_dropAirAmmobox = { private ["_box","_veh","_pos"]; _veh = _this select 0; _box = _veh getvariable "SHK_LoadedObject"; detach _box; _pos = _veh modelToWorld [0,-20,-5]; _box setPos _pos; sleep 0.1; parachute = "ParachuteWest" createVehicle position _box; parachute setPos [(getPos _box select 0),(getPos _box select 1),(getpos _box select 2)]; _box attachto [parachute,[0,0,-1.5]]; _veh setvariable ["SHK_LoadedObject",objNull,true]; if (playerside == WEST) then { hint "Supply dropped!"; }; waituntil {(getPos _box select 2) < 2}; deTach _box; _box setPos [(getPos _box select 0),(getPos _box select 1),0.001]; if (playerside == WEST) then { hint "Supply landed!"; }; if (playerside == WEST) then { Sleep 3; dropmark = createMarker ["dropmark", _box]; dropmark setMarkerShape "ICON"; dropmark setMarkerType "warning"; dropmark setMarkerText "Supplies"; hint "Supplies marked on map"; }; }; SHK_pickupAmmobox = { private ["_box"]; _box = _this select 0; _box attachto [player,[0,1,1.8]]; SHK_CarriedObject = _box; deletemarker "dropmark"; }; SHK_dropAmmobox = { private ["_pos"]; detach SHK_CarriedObject; _pos = player modelToWorld [0,1,0]; SHK_CarriedObject setPos [_pos select 0, _pos select 1, 0]; SHK_CarriedObject = objNull; }; { _x addaction ["Pickup box","action.sqf",SHK_pickupAmmobox,1,true,true,"","isnull SHK_CarriedObject && [color="red"]!(_target getvariable ['SHK_IsLoaded',false])[/color]"]; } foreach [mhq1_ammobox,mhq1_ammobox1]; { _x addaction ["Unload box","action.sqf",SHK_unloadAmmobox,1,true,true,"","!isnull (_target getvariable ['SHK_LoadedObject',objNull]) && (!isEngineOn _Target) && (((getPosATL _Target) select 2) < 1) && [color="red"](_box setvariable ["SHK_IsLoaded",false,true])[/color]"]; } foreach [heli1,heli2,heli3,heli4,hum1,hum2,hum3,humrescue,truck1,truck2,her1]; { _x addaction ["Drop box","action.sqf",SHK_dropAirAmmobox,1,true,true,"","!isnull (_target getvariable ['SHK_LoadedObject',objNull]) && (((getPosATL _Target) select 2) > 100)"]; } foreach [heli1,heli2,heli3,heli4,her1]; // Add actions to player, not tested for respawn mission. if !isdedicated then { [] spawn { waituntil {!isnull player}; player addaction ["Put box down","action.sqf",SHK_dropAmmobox,1,true,true,"","!isnull SHK_CarriedObject"]; player addaction ["Load box","action.sqf",SHK_loadAmmobox,2,true,true,"","!isnull SHK_CarriedObject && cursorTarget distance player < 10 && isnull (cursorTarget getvariable ['SHK_LoadedObject',objNull]) && (!isEngineOn cursorTarget) && (((getPosATL cursorTarget) select 2) < 1) && [color="Red"](SHK_CarriedObject setvariable ["SHK_IsLoaded",true,true])"];[/color] }; };---------- Post added at 16:00 ---------- Previous post was at 15:58 ----------
Another minnor problem is that you can take the ammobox from another player. And if you do so, then the other player still has the option to "Put box down" and that puts the ammobox right at the feet of the first guy that had the ammobox picked up.
-
Okay yes that with the more conditions did work as it should.
I will try to put in my drop scripts conditions and see if I can get it to work.
I can report that the script works on multiplayer just as it should! Again thank you very much for your help so far!
---------- Post added at 14:41 ---------- Previous post was at 13:22 ----------
Another problem I have discovered is, that you can "Pickup box" when it is loaded. I guess some conditions need to be added to the "Pickup box" addaction, but I can't figure out how to code it. If it could check if the box has been loaded, then it wouldnt show the addaction "Pickup box".
---------- Post added at 15:00 ---------- Previous post was at 14:41 ----------
Ive got the parachute to work. Here is how I did:
SHK_CarriedObject = objNull; SHK_loadAmmobox = { private ["_veh","_pos"]; _veh = cursorTarget; switch true do { case (_veh iskindof "MH60S"): {_pos = [0,-0.2,0.4]}; case (_veh iskindof "MH6J_EP1"): {_pos = [0,0.7,0.25]}; case (_veh iskindof "Ural_CDF"): {_pos = [0.5,0.3,0.7]}; case (_veh iskindof "HMMWV_Armored"): {_pos = [0,-1.5,-0.5]}; case (_veh iskindof "HMMWV_M2"): {_pos = [0,-1.5,-0.5]}; case (_veh iskindof "ACE_HC130_N"): {_pos = [0,0,-3.5]}; case (_veh iskindof "BAF_Merlin_HC3_D"): {_pos = [0,0,-0.5]}; default {_pos = []}; }; if (count _pos == 0) then { private "_name"; _name = getText (configFile >> "CfgVehicles" >> typeof _veh >> "displayName"); hint format ["You are not allowed to load the box on to:\n%1",_name]; } else { detach SHK_CarriedObject; SHK_CarriedObject attachto [_veh,_pos]; _veh setvariable ["SHK_LoadedObject",SHK_CarriedObject,true]; SHK_CarriedObject = objNull; }; }; SHK_unloadAmmobox = { private ["_box","_veh","_pos"]; _veh = _this select 0; _box = _veh getvariable "SHK_LoadedObject"; detach _box; _pos = _veh modelToWorld [-5,0,0]; _box setPos [_pos select 0, _pos select 1, 0]; _veh setvariable ["SHK_LoadedObject",objNull,true]; }; SHK_dropAirAmmobox = { private ["_box","_veh","_pos"]; _veh = _this select 0; _box = _veh getvariable "SHK_LoadedObject"; detach _box; _pos = _veh modelToWorld [0,-20,-5]; _box setPos _pos; sleep 0.1; parachute = "ParachuteWest" createVehicle position _box; parachute setPos [(getPos _box select 0),(getPos _box select 1),(getpos _box select 2)]; _box attachto [parachute,[0,0,-1.5]]; _veh setvariable ["SHK_LoadedObject",objNull,true]; if (playerside == WEST) then { hint "Supply dropped!"; }; waituntil {(getPos _box select 2) < 2}; deTach _box; _box setPos [(getPos _box select 0),(getPos _box select 1),0.001]; if (playerside == WEST) then { hint "Supply landed!"; }; if (playerside == WEST) then { Sleep 3; dropmark = createMarker ["dropmark", _box]; dropmark setMarkerShape "ICON"; dropmark setMarkerType "warning"; dropmark setMarkerText "Supplies"; hint "Supplies marked on map"; }; }; SHK_pickupAmmobox = { private ["_box"]; _box = _this select 0; _box attachto [player,[0,1,1.8]]; SHK_CarriedObject = _box; deletemarker "dropmark"; }; SHK_dropAmmobox = { private ["_pos"]; detach SHK_CarriedObject; _pos = player modelToWorld [0,1,0]; SHK_CarriedObject setPos [_pos select 0, _pos select 1, 0]; SHK_CarriedObject = objNull; }; { _x addaction ["Pickup box","action.sqf",SHK_pickupAmmobox,1,true,true,"","isnull SHK_CarriedObject"]; } foreach [mhq1_ammobox,mhq1_ammobox1]; { _x addaction ["Unload box","action.sqf",SHK_unloadAmmobox,1,true,true,"","!isnull (_target getvariable ['SHK_LoadedObject',objNull]) && (!isEngineOn _Target) && (((getPosATL _Target) select 2) < 1)"]; } foreach [heli1,heli2,heli3,heli4,hum1,hum2,hum3,humrescue,truck1,truck2,her1]; { _x addaction ["Drop box","action.sqf",SHK_dropAirAmmobox,1,true,true,"","!isnull (_target getvariable ['SHK_LoadedObject',objNull]) && (((getPosATL _Target) select 2) > 100)"]; } foreach [heli1,heli2,heli3,heli4,her1]; // Add actions to player, not tested for respawn mission. if !isdedicated then { [] spawn { waituntil {!isnull player}; player addaction ["Put box down","action.sqf",SHK_dropAmmobox,1,true,true,"","!isnull SHK_CarriedObject"]; player addaction ["Load box","action.sqf",SHK_loadAmmobox,2,true,true,"","!isnull SHK_CarriedObject && cursorTarget distance player < 10 && isnull (cursorTarget getvariable ['SHK_LoadedObject',objNull]) && (!isEngineOn cursorTarget) && (((getPosATL cursorTarget) select 2) < 1)"]; }; }; -
wow, that indeed is a very nice script. Simple to use (harder to understand;D). I will test it now with my mate and see if it works as it should in multiplayer.
How would I implement a parashute dropping script? I have the script and it is working, but I am not sure how to put it into the code of yours.
Earlier I put this into the attach_ammoboxheli1.sqf file:
dropbox1 = heli1 addaction ["Drop ammobox", "dropsupplyheli1.sqf"];
Here is the code I have in the dropsupplyheli1.sqf:
if (((getPosATL heli1) select 2) > 100) then { deTach mhq1_ammobox; worldpos = heli1 modeltoworld [0,-20,-5]; mhq1_ammobox setPos worldpos; sleep 0.1; parachute = "ParachuteWest" createVehicle position mhq1_ammobox; parachute setPos [(getPos mhq1_ammobox select 0),(getPos mhq1_ammobox select 1),(getpos mhq1_ammobox select 2)]; mhq1_ammobox attachTo [parachute,[0,0,-1.5]]; heli1 removeAction dropbox1; heli1 removeAction heli1unload; if (playerside == WEST) then { hint "Supply dropped!"; }; waituntil {(getPos mhq1_ammobox select 2) < 2}; deTach mhq1_ammobox; mhq1_ammobox setPos [(getPos mhq1_ammobox select 0),(getPos mhq1_ammobox select 1),0.001]; if (playerside == WEST) then { hint "Supply landed!"; }; addactionW = execVM "addActionW.sqf"; waitUntil {scriptDone addactionW}; dropmsg = execVM "dropmsg.sqf"; waitUntil {scriptDone dropmsg}; } else { // If the engine was running, warn the user. hint "You have to be above 100 meters to drop"; }; //};---------- Post added at 12:52 ---------- Previous post was at 12:46 ----------
Another problem ive got now, is that I can unload the ammobox while the engine is running and I can unload while in the air with the heli. How would I restrict the options to only work when on the ground and the engine is off?
How to display a variable in a task?
in ARMA 2 & OA : MISSIONS - Editing & Scripting
Posted
Yes but mst isnt defined. It was just an example. Through the mission numbers gets added to mst, so I want to display the current number mst represents. The mst variable is comming from another script. It doesnt seem to work to put this to publicVariable. Still I get the scalar output and not the number that mst represents.