Forum Jump :

Author Message


Posts: 8
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2012-09-12 03:39        
     
Ok I have searched all over the forums so please excuse my question. I have been able to find a ton of information but nothing to answer this situation. Here is the idea. This is based on what is currently going on over seas. As many of you may know there have been a lot of attacks called "Green on blue" Meaning that the ANP's have been changing and attacking the us soldiers. Not only that but vbied as well at checkpoints and on convoy MSR's

The idea is first NOT to poke fun or insult any soldiers BUT instead to try and convey in a game/sim/movie just what we are facing overseas. To show that you can NOT become complacent and consider things as routine.

I'm trying to make a unit VBIED, an old junker car or cycle spawn and dry around the MSR and even approach the front gate of a checkpoint. I have set the car prob to 50% and written a trigger for it to explode on approx 0-10 sec delay when blufor comes close to it. The problem is that the way this is written it will be too easy to just "know" the car is the bomber. I actually need the trigger to be at the 50% prob. That way just because you see the car doesn't mean it will explode. It could ride around and be fine the whole mission or it could detonate next to your convoy or you main gate. I have tried several ways but can only set the prob of the unit and not the trigger. I'm sure im missing something easy.

The second scenario is one that is becoming WAY to common and we train each day to counter. There is really no way to put the fear into the game that the soldier faces on a daily basis. That is having a ANP with a loaded rifle turn on your team members. The idea again is to use a trigger and find a way to set the prob of the trigger at 50%. That way the units will always be present in the mission but there is no way of knowing if they will turn after a set time or condition. Forcing you to act quick and take them out before your team goes down.

Please let me know what i need or a missing to make this work as intended. Again I am NOT trying to poke fun at anything that occurs overseas. I respect and honor ALL the US soldiers. Soon I will be taking the place of and MP unit over there.

Hoping to use this as a battle simulator for my squad. Show them in real time and go ever drills of what we would do in that situation.

Bill
153rd MP Co


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#2 Posted at 2012-09-12 05:05        
     
My Market Day demo mission has an example similar to your second request. A random percentage that some civie will end up being a bomber, or maybe not. The sound playing is not properly multiplayer yet, I keep meaning to fix that, but the rest of it works. You could probably adapt that to your liking.

For the first thing I think this would work for a 50% change of a trigger going off:

this && ceil random 2 > 1

At least in a quick test a hint was going off some of the time with that. :) It was a real fast repeat though, so if you want this looping somehow you might wanna add in a timeout timer too.


Advertisement


Author Message


Posts: 8
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2012-09-12 19:13        
     
I'm assuming that code would be placed in the on act part of the trigger or the box just above it? Sorry. Also is ceil a name in one of your missions ie a trigger or part of an ARMA2 command?
Thanks again, i will take a look at your mission and see if i can play with some of the stuff.
Bill


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#4 Posted at 2012-09-12 20:00        
     
ceil is a default command.

This command:
random 2
will result in a value between 0 and 1.999999... but never 2 itself, so you'll get a bunch of variables with 0.34234 or 1.9343 or 0.1324124 or whatever. By using the ceil command in front of it you'll get either 1 or 2 exactly, it rounds up to the next highest integer. So that's why the ceil random 2 > 1 should get you a 50% chance in that condition.

In the first example on my website there I use this to randomly select a single unit in a Civilian PRESENT ONCE trigger:

thislist select floor(random count thislist)

You could run this from the init.sqf actually. The trigger example is great for the demo, but in MP you might end up with multiple bombers. So run from the init.sqf inside an isserver wrapper.

Here's what that select code is doing:

Since arrays count up from 0 to whatever, I use the floor command. It's the same as ceil but rounds down so a floor random 2 would result in 0 or 1. So what that codes says is "count the units in this trigger and pick one randomly".

It's basically 4 commands in one:

First we count how many units activate the trigger, lets say we end up with 5 units. This means thislist is an array with 5 units: [bob, joe, tom, moe, larry] or the numbers that represent each would be [0,1,2,3,4]
count thislist

Next we pick a random number from that count so the code would be:
random 5

That gives us a number between 0 and 4.9999 so we next use floor to bring it down to a useable number:
floor 4.993413

Which results in 4, so next we select the 4 value (which is actually the 5th unit) from the array:
thislist select 4

Which in this example means that "larry", our 5th unit or the select 4 of the thislist array would be our bomber.


Author Message


Posts: 8
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2012-09-13 04:01        
     
Ok quick update.... and a few more things I found.
I tried to update my trigger as mentioned above
I placed the code
this && ceil random 2 > 1
in the box of the trigger that states "this" normally. I'm assuming thats correct. I had also tried to place it on in the "on activation" box but it wouls not allow it. Told me it was expecting something else. I tried the mission several times and not once did it explode. I never got the "hint" that i typed in either to show the trigger trip. I'm not sure what im doing wrong. I thought maybe it was spelled wrong but when i checked the editor manual for arma i saw that random items can be called using just that "ceil" so i know that not the problem.
Durring the mission testing i also noticed that my IED object was correctly working. Sometimes it would be there other times it would not, however the trigger would continue to explode no matter what. If the trigger is using the setpos command to find the object "IED" but "IED" is not in the mission then how does the trigger fire? I'm assuming that i have messed something up on this.
The last thing is not related to triggers but it is related to this mission. How do you find the exact possition of an object ie a guard tower and place an enemy or friendly unit in the tower. I know it is something to do with the setpos command but i dont know how to find the X,Y,Z cord. of the object. If you could clue me in on this it would be great too. Thanks again forall your help.
Bill


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#6 Posted at 2012-09-13 04:18        
     
What are the rest of the settings for the trigger? Also the this && ceil stuff is a condition something that returns true or false, so won't work in onAct.

Can you upload your mission perhaps? It'll make troubleshooting a lot easier.

For putting units in buildings you can try this link but for things like towers it's best to start them on the ground and give them a waypoint to the specific buildingPos, it'll be a dropdown when you place a movement waypoint ON a building on the map.


Author Message


Posts: 8
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2012-09-13 04:35        
     
I will see if i can upload it later. Its honestly a bunch of test right now and as i figure the things out they get placed into an actual mission. I'm on my phone at the moment and not near the computer. If mem. serves me correct the trigger is as follows.
the bomber is driving an old beatup hatchback, unit is masked as civ.
bomber1 is the name
He is given a bunch a waypoints with a cycle command at the end to keep him moving down the roads.
a trigger then was created with a diameter of approx 10m.
Set to be tripped by blufor only
Random timer set at 0, 5, 15 (if the veh is to explode there is a pos that the unit can get far enough away to cause minor to major damage but not death.
The trigger is then attached to the unit with the setpos command or getpos command.
Again the trigger works perfect 100% of the time but I cant get it to be random without getting rid of the unit by making the unit prob. 50% Other then that i cant get it work with a random posibility.
I will keep playing with it and see what else i can do when i get some more time.
Bill