Home   Help Search Login Register  

Author Topic: A lil help plz..List trigger. day 6....  (Read 2849 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 »

Offline ModestNovice

  • Members
  • *
Re: list trigger contents issues ><
« Reply #15 on: 03 Sep 2008, 02:35:17 »
thts what I did, after you found it once, it moved randomly to one of the 15 logics ;)

ah righto, didnt see what you had wrote.

yeh, yah could do that given that the helicrash is the name of the crashed helo (which i assume it is?).

So yes that should work fine.
« Last Edit: 03 Sep 2008, 02:38:23 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 #16 on: 03 Sep 2008, 02:53:58 »
EDIT: Ok.. I gave it a good run..lol..
I'm going to give Mandos another shot for a while..
now that I know it needed to be in an sqf and not an sqs.
that should help..lol..

but i left off.. pretty much exaclty as you left it.. I tried a lot..
nothing went well..lol.. Kept paying me at mission start.

Heya Mando..
I get what you were saying to do more now.
So I rearranged things to be what i think you intended me to do.
The 1st script below moves the trigger to the "helicrash" (which is the object uh60 wrecks) name.
It does so at the last line of the 1st script below.

The trigger is named "crash"
The trigger is activated on blufor present.
which runs the script  [] exec "foundcrash.sqf"
the foundcrash script is the 2nd script down.
wether i use your original or my edited version
they both error. :(

randomcrashsite.sqs
Code: [Select]
? !isServer: exit
_randomcrash=random 1
_randomcrashnum=round _randomcrash
_rantime = random 5
?(_rantime < 120):_rantime=_rantime+5
~_rantime
?_randomcrashnum==1:HeliCrash setdir random 360;HeliCrash setpos [((getmarkerpos "CrashSite") select 0) + random 200 - random 200 ,((getmarkerpos "CrashSite") select 1) + random 200 - random 200];CrashmarkerPOSVAR = getmarkerpos "CrashSite";publicvariable "CrashmarkerPOSVAR";"Crashmarker" setmarkerpos CrashmarkerPOSVAR;CrashflagPOSVAR = getmarkerpos "CrashSite";publicvariable "CrashflagPOSVAR";"Crashflag" setmarkerpos CrashflagPOSVAR;crash setPos getPos helicrash;

exit

The original was paying me double and erroring, so i slimmed it down to this..
foundcrash.sqs
Code: [Select]
_trigger_list = list crash     (also tried as crash = list crash)
{
    {
      if (vehicle _x != _x) then
       {
          if (isPlayer _x) then
          {
             if (alive _x) then
             {
                SPON_playerCashBalance = SPON_playerCashBalance + 5000;
                player groupchat format ["For your efforts in finding the crash site you have been rewarded $5000! $%1 total in pocket 
                cash",SPON_playerCashBalance];
             };
          } forEach crew _x;
       };
    };
} forEach _trigger_list;    (also tried as foreach crash)

exit;

but this is giving me the same errors the original was giving me..
error missing {
or
error missing }
or
} foreach _trigger_list; error missing {
or
error, type array expected object. ( when I put "crash = list crash" in the trigger).

well.. at least it's paying too...lol..
should I have something else in the trigger other than what activates it and what script to run?
do I need to do something like _trigger_list = list crash?
It's all new to me.. been digging around for info on trigger lists and thats all i could really narrow it down to.

well day idk..5? on this crap..up all nite again.....
lil help plz..  :confused:
« Last Edit: 03 Sep 2008, 21:54:31 by D007 »

Offline ModestNovice

  • Members
  • *
Re: A lil help plz..List trigger. day 6....
« Reply #17 on: 04 Sep 2008, 01:24:16 »
well D007, if ya want it to just do this quickly ya can set it in the trigger itself. So, easy as this:

Code: [Select]
Condition: (vehicle player) in thislist

OnAct: reward = 400 + ceil(random 250); (vehicle player) groupchat format ["You found the crash site and earned $%1, you now have $%2", reward, SPON_playerCashBalance]; 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);
"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: A lil help plz..List trigger. day 6....
« Reply #18 on: 04 Sep 2008, 02:49:08 »
Cool thanks Chevs :)..
I'll try that.
much appreciated.

Offline ModestNovice

  • Members
  • *
Re: A lil help plz..List trigger. day 6....
« Reply #19 on: 04 Sep 2008, 02:59:56 »
no problem  ;)

lemme know how it works out.
"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
  • *
List trigger (solved)
« Reply #20 on: 05 Sep 2008, 05:03:13 »
My bro figured out a way to make it work so we went with that.
But I do appreciate the help Chevs. thanks a bunch.
Quarantine Unleashed V1.1 will be out in a day or 2 tops now.

Topic solved :)