JacobJ
-
Content Count
308 -
Joined
-
Last visited
-
Medals
Posts posted by JacobJ
-
-
Okay, I remember that. I will try to make two scripts and see if I can get it to work that way around. Ill update when I have tested it.
-
Okay, so I would have to make two different scripts to be run. One for the WEST team and one for the EAST team?
-
How do I compare the output to the number of counts I would like to have for it to trigger/setdamage 1?
Do you know how to make the key that has to be pressed to primary mouse button? I can't seem to find the correct "case"/key number for it. I am afraid that it is only working with inputs from the keyboard...
-
Okay, I am now trying to make a script that can make the wirecutter be a bit more fun to play with. Take a look at my other thread and help if you can.
-
Hey
What command do you have to use, if I want to make a trigger that counts 20 mouse clicks on mouse button 1 (fire-button)?
I guess I need the count command, but what to return the mouseclick from the fire-button?
/Jacob
---------- Post added at 07:20 PM ---------- Previous post was at 05:49 PM ----------
Can I somehow use this:
http://community.bistudio.com/wiki/User_Interface_Event_Handlers
And for the actionkey use "Fire"?
---------- Post added at 07:37 PM ---------- Previous post was at 07:20 PM ----------
What about this? I just can't find the code for mousebutton 1
http://community.bistudio.com/wiki/displaySetEventHandler
---------- Post added at 08:38 PM ---------- Previous post was at 07:37 PM ----------
Okay this is what I got so far:
starter.sqf:
disableSerialization; keyspressed = compile preprocessFile "wirecutter.sqf"; _display = findDisplay 46; _display displaySetEventHandler ["KeyDown","_this call keyspressed"];
wirecutter.sqf:
private['_handled']; _handled = false; switch (_this select 1) do { //H key case 35: { round_counter = 0; player addEventHandler ["keyDown", {round_counter = round_counter + 1; hint format ["%1", round_counter]}]; _handled = true; }; }; _handled;I can get a hint to work, but this doesnt work. I know it isnt the mousebutton, but if I just can get this to work I am one step longer.
I need this script to compensate for the wirecutter not working in the current version of Arma2 AO. It works on fence that is preplaced in the maps, but not fence you put into a mission.
My idea is, that if I make a trigger that starts when a unit comes into the triggerarea (which is just around that peace of fence you want it to work for) and in the conditions put currentWeapon "wirecutter". It then checks if the current weapon of the unit is the wirecutter. If it is it runs the script. In the script there is a If command and if the unit with the wirecutter pushes his primery mousebutton like 20 times the scripts sets: fence setdamage 1.
Then the wirecutter would have to be the primary weapon, the unit must be in the triggerarea and he has to push the "fire" button 20 times to get the fence to lay down.
---------- Post added at 08:54 PM ---------- Previous post was at 08:38 PM ----------
Wouldnt I have to add this to the buttom of wirecutter.sqf to make it compare the number of keystrokes with 20 and then set the damage to 1?
waitUntill {(round_counter = 20)}; fence setdamage 1; -
The spectating script seems to be a seperate script (but proberbly the same) as the spectating script in the revive script. It must be a bug in the script, because Norrin comments in top of the script that only friendly units can be spectated and that is not true by me, I can see all units in the mission.
I just can't find out, where the problem is in the script. My best guess is in that code I have posted, but again, me a newbie spotting bugs in complex code isnt the best combo I guess...
-
That I would like to know too!
-
Okay I have now tried out Norrins Spectating script and it looks very much like the thing I need. There is just one problem. That scripts comments state that you only can see players you are friendly with, but I can see everybody. Somehow I suspect this code to be the problem, but I can't see whats the problem:
_t = createTrigger["EmptyDetector", (getPos player) ];
_t setTriggerType "NONE";
_t setTriggerStatements ["this", "NORRNAllUnits = thislist", ""];
_t setTriggerArea[50000, 50000, 0, false];
_t setTriggerActivation["ANY", "PRESENT", false];
sleep 2;
{if(side _x != sideLogic) then {_foo = _foo + [_x]}} forEach NORRNAllUnits;
{if (alive _x) then {_allUnits = _allUnits + (crew _x)}} forEach _foo;
-
Ahh okay, now I get it (the first part.) The second automated code I will try out too.
-
Can you explain a little bit more about selecting the correct value? I tried to past the code into the init.sqf file together with the classparam in the description file, but it didnt work. The time parameter works, but not the weather.
-
Could I somehow set in something like:
If (playerside == WEST) then
and so on? insteed of being able to spectate everyone?
-
Are there any other options to make this wirecutting work on placed fences in the editor?
-
That did indeed work with the editing the mission file. Thank you very much and also thanks to you lonestar, that I didnt know and will remember in the future, so I dont have to mess around in the mission file.
-
So you are both saying that it can't be done? I would have to make some unrealistic trigger countdown, that sets off a setdamage 1 to the fence? hmm does the wirecutter put out something when it goes to READY? I mean, can I somehow script it so, that when ready lights up, the trigger mentioned above triggers? That would be more realistic, but don't know if it can be done?
-
I have tried the eventhandler and I have got it to run a script. The problem is now, that I dont know what to put into the script.
I want the VIEW from the switchCamera command, but that is not an option with the cameraEffect command?
---------- Post added at 08:53 PM ---------- Previous post was at 08:43 PM ----------
Okay, didnt see all the replies..DOH
Well I have looked at those scripts, but they seem to be very complicated.
They also have some features I don't want. I only want dead players to be able to follow their own teammates and only in a first person view or in the view the player he is spectating is using at the moment (like the VIEW feature of switchCamera command).
Where do I have to change the codes for this to be done?
-
A killed eventhandler and then the createCam, camcommit, cameraeffect and setcameratarget. Should that do the job? I just read that if I just wanted the spectating to be first person with no other features I should use the switchCamera, but that I can't get to work. Any suggestions on that?
-
Okay, I will try to see if thats the problem. Thank you very much so far!
-
yes he has and thats the wierd thing. Can I somehow force him up the list?
-
I have tried with the switchCamera, but that doesnt stay on the player. How do I tell the dead player to run a script?
-
Hello all
I have put in a fence (industrial) and a unit with a wirecutter. I can select "Cut wire" and it seems to cut it, but when it has cut it it says ready, but the fence isnt gone. Whats the problem here?
/Jacob
-
I know that, but it doesnt affect the pregame menu. My teamleader is number two and a sniper is number 1 in that list.
-
Hello all
Here is what I want:
When a player in my mission dies, he has to go into first person view of the nearest friendly soldier. The only thing he will be able to do is to spectate this player. When this player dies, he and the new dead soldier has to go on to the nearest soldier and spectate from their.
Can this be made? I have looked at the spectating scripts out their and I must say they are advanced and have to many features (which I dont know how to disable to get to where I want)
Hope you can help
/Jacob
-
Thank you very much, that worked just as it should!
---------- Post added at 09:44 AM ---------- Previous post was at 09:44 AM ----------
Do you know anything about the ranking in the pregame screen and how to alter the list so the highest rank is on top?
-
Hello all
I have 10 players that are grouped together with the group-connections in the editor. How do I make them all for example shoot at one target.
The problem is, that I can't group players together. Ive tried this:
grp1 = [man1, man2, man3]
grp1 doFire target1
When I do this, only the first guy shoots at target1. The other two guys do nothing. What have I done wrong?
Another question is:
I have this group of 10 players grouped together with the group-connections in the editor. How do I assign a groupname for this group and make it apear in the pre-game screen where you can select what player you want to be? How do I arrange how the players are listed on the list in the pre-game screen?
/Jacob
---------- Post added at 04:28 PM ---------- Previous post was at 04:26 PM ----------
Okay I tried to make a group more and now I have two different groups in the pre-game screen and I can see that the team-leaders are in the top of both, but why are they not in top, when there is only one team?
What command to return mouseclick?
in ARMA 2 & OA : MISSIONS - Editing & Scripting
Posted
I have looked at that page 100 times now and I still don't get it where to put in onButtonClick and how to put in what button it should be attached to. I could do try the onMouseButtonClick, but that I still don't know how to put into the code that is in the example above. Can I just swap the KeyDown with onMouseButtonClick? That sounds a bit too easy.
---------- Post added at 10:59 PM ---------- Previous post was at 10:56 PM ----------
Okay I see, that looks like it is just swapping it. I will give that a try and see if I can get something to get triggered. Just a hint "Hey, the mousebuttonthing did what you wanted it to" would be nice to start with..hehe