OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: D007 on 01 Sep 2008, 20:27:47
-
EDIT:
please see page 2 for accurate details
-
You might just use a trigger and then, for its corresponding list:
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;
-
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. :)
-
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.
-
junk
-
well it seem you are mixing sqf and sqs in this script.
also what is this:
exit unit _x (player out of vehicle)
-
junk
-
rofl ok.
Try...?
Not sure if it works right.
check.sqf
//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;
-
junk
-
script updated, look at previous post.
-
more junk
-
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
:)
-
lots more junk..
-
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 ;)
-
and...all things that did not matter anymore are gone..
-
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.
-
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
? !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
_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:
-
well D007, if ya want it to just do this quickly ya can set it in the trigger itself. So, easy as this:
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);
-
Cool thanks Chevs :)..
I'll try that.
much appreciated.
-
no problem ;)
lemme know how it works out.
-
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 :)