Home   Help Search Login Register  

Author Topic: A lil help plz..List trigger. day 6....  (Read 3434 times)

0 Members and 1 Guest are viewing this topic.

Offline D007

  • Members
  • *
A lil help plz..List trigger. day 6....
« on: 01 Sep 2008, 20:27:47 »
EDIT:
please see page 2 for accurate details
« Last Edit: 03 Sep 2008, 19:53:24 by D007 »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Nearestobjects/object/target/unit/player?
« Reply #1 on: 01 Sep 2008, 21:24:47 »
You might just use a trigger and then, for its corresponding list:
Code: [Select]
your_trigger setPos getPos area;
_trigger_list = list your_trigger;

{
   if (isPlayer _x) then
   {
      if (alive _x) then
      {
         // Reward here to unit _x (player outside vehicle)
      };
   }
   else
   {
      if (vehicle _x != _x) then
      {
         {
            if (isPlayer _x) then
            {
               if (alive _x) then
               {
                  // Reward here to unit _x (player inside vehicle)
               };
            };
         } forEach crew _x;
      };
   };
} forEach _trigger_list;


Offline D007

  • Members
  • *
Re: Nearestobjects/object/target/unit/player?
« Reply #2 on: 01 Sep 2008, 21:32:42 »
I wonder.. does this matter that the area is mobile and random?
didnt realize you could move a trigger around.
there are about 20 random positions it can spawn in.

Thanks a ton Mando.. I'll try that out right now.. your help is most welcome..lol..
will let ya know how it turns out. :)

« Last Edit: 01 Sep 2008, 21:34:35 by D007 »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Nearestobjects/object/target/unit/player?
« Reply #3 on: 01 Sep 2008, 21:38:01 »
You may move area object at will, just make sure you setPos the trigger at your area position each time, also, for security reasons (to make sure the list of the trigger is correctly updated), wait a second after changing the position, size or angle or your trigger.

Offline D007

  • Members
  • *
Re: Nearestobjects/object/target/unit/player?
« Reply #4 on: 01 Sep 2008, 21:52:22 »
junk
« Last Edit: 03 Sep 2008, 06:21:39 by D007 »

Offline ModestNovice

  • Members
  • *
Re: list trigger contents issues ><
« Reply #5 on: 03 Sep 2008, 01:21:25 »
well it seem you are mixing sqf and sqs in this script.

also what is this:
Code: [Select]
exit unit _x (player out of vehicle)
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline D007

  • Members
  • *
Re: list trigger contents issues ><
« Reply #6 on: 03 Sep 2008, 01:29:29 »
junk
« Last Edit: 03 Sep 2008, 06:22:04 by D007 »

Offline ModestNovice

  • Members
  • *
Re: list trigger contents issues ><
« Reply #7 on: 03 Sep 2008, 01:44:44 »
rofl ok.


Try...?
Not sure if it works right.

check.sqf
Code: [Select]
//Check distance
//----
//ADD IN A NEW GAME-LOGIC named: v_spawn
//----

found = false;

while {!found} do
{
if (player distance (getMarkerPos "crash_site") <= 10) then
{
found = true;
}
else
{
//Changed this to prevent the person moving away, and back and spawning multiple helos
};
Sleep 5;
};


waitUntil {found};
_v = "UH60" createVehicle (getPos v_spawn);
_v setPos [ getPos _v select 0, getPos _v select 1, (getPos _v select 2) + 5];
_v setDammage 1;
Sleep 1;
_v setPos (getMarkerPos "crash_site_marker");
hint "You found the crash site, search the area for any survivors";
_rew = 1100 + ceil(random 750);
SPON_playerCashBalance = SPON_playerCashBalance + _rew;
player groupchat format ["You found the crash-site and were rewarded $%1. You now have $%2", _rew, SPON_playerCashBalance];
//Name 15 game logics logic1-logic15 and place them where you want the marker to randomly spawn.
//if you need more, just add them in ;)


Sleep 55;
deletevehicle _v;
hint "Crash-Site cleared.";
new_m_pos = ["logic1","logic2","logic3","logic4","logic5","logic6","logic7","logic8","logic9","logic10","logic11","logic12","logic13","logic14","logic15"];
ran_select = new_m_pos select (floor(random(count new_m_pos)));
move_m = crash_site_marker setMarkerPos (getPos ran_select);
publicvariable "new_m_pos";
publicvariable "ran_select";
publicvariable "move_m";
found = false;
« Last Edit: 03 Sep 2008, 02:13:27 by DaChevs »
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline D007

  • Members
  • *
Re: list trigger contents issues ><
« Reply #8 on: 03 Sep 2008, 01:54:22 »
junk
« Last Edit: 03 Sep 2008, 06:22:25 by D007 »

Offline ModestNovice

  • Members
  • *
Re: list trigger contents issues ><
« Reply #9 on: 03 Sep 2008, 02:04:07 »
script updated, look at previous post.
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline D007

  • Members
  • *
Re: list trigger contents issues ><
« Reply #10 on: 03 Sep 2008, 02:06:19 »
more junk
« Last Edit: 03 Sep 2008, 06:23:00 by D007 »

Offline ModestNovice

  • Members
  • *
Re: list trigger contents issues ><
« Reply #11 on: 03 Sep 2008, 02:07:54 »
hehe np.

Bear in mind I can't test this, so I don't know if it works properly, but tell me what happens either-way. ;)


Also, check again the scrip, I updated again lol, I found a mistake i made.

*EDiT*
Updated a bit, try it too rofl
:)
« Last Edit: 03 Sep 2008, 02:14:20 by DaChevs »
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline D007

  • Members
  • *
Re: list trigger contents issues ><
« Reply #12 on: 03 Sep 2008, 02:19:13 »
lots more junk..
« Last Edit: 03 Sep 2008, 06:23:29 by D007 »

Offline ModestNovice

  • Members
  • *
Re: list trigger contents issues ><
« Reply #13 on: 03 Sep 2008, 02:27:54 »
Quote
EDIT: ok i see your edit and will raise you two edits and a mars bar.

J/k i see the edit though and will use the updated version..
ROFLZ

Yeh, it looked as you just delete some things ya didnt need?

In that case yeh it should work fine ;)

"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline D007

  • Members
  • *
Re: list trigger contents issues ><
« Reply #14 on: 03 Sep 2008, 02:32:29 »
and...all things that did not matter anymore are gone..
« Last Edit: 03 Sep 2008, 06:24:01 by D007 »