quantum69
Member-
Content Count
8 -
Joined
-
Last visited
Never -
Medals
Community Reputation
0 NeutralAbout quantum69
-
Rank
Private
-
?(!searchresults):ask big boys addEventHandler is not explained very well in any docs I've read. Â Search for it gives 0 results. Â In using the BAS addon it says to use a line including this command, ok, it works, but what is the exact nature of this new command? The syntax is given in the comref, but can anyone elaborate clearly what the parameters are and especially how the second parameter can be used? The first parameter in the comref shows an action (type) that occurs and the second parameter is what to do when it happens. Â Ok, that's simple enough (if anyone knows where to find a complete list of actions old and new I would appreciate a link/list). Â The line from BAS says to put it in the init.sqs, done, it performs as expected. Â The question arose because in the init.sqs it's listed as </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this addEventHandler ["GetIn", {_this select 2 animate ["Goggles", 1]}] <span id='postcolor'> Q1) if it's listed as "this" in init.sqs, is it refering to the whole map? Â So if ANY unit performs the "GETIN" action this would run? Q2) the second param, {_this select 2 .... Â , I presume that _this is set equal to the object performing the action, but why the "select 2" then? Â What parameters does an object contain? Q3) anyone have solid, clear answers to these questions and suppositions that would make understanding this apparently cool function less of a headache? Any help from the gallery is appreciated. Thanks Quantum69
-
?(!searchresults):ask big boys
-
Does anyone know where to find an exploding chicken addon? Why, because we like you, Quantum69
-
Custom "hq" radio callsigns!
quantum69 replied to toadlife's topic in OFP : MISSION EDITING & SCRIPTING
I see that using init.sqs with rearming scripts solves the problem of arming a person (typ player) with a GL based rifle. This is cool! You are the [due to PC constraints recently invoked, Auto-Edited] person! Quantum69 -
Custom "hq" radio callsigns!
quantum69 replied to toadlife's topic in OFP : MISSION EDITING & SCRIPTING
This looks just like standard sqs scripting as opposed to the briefing html or the description.ext (which looks more like the mission.sqm)... So any standard scripting can be placed in it, no special formating? Like in description.ext (braces and all that C-ish stuff)? thanks, Quantum69 -
_obj in my usage is any object.  Whether it's a helo, plane..etc I need to know before the script section runs if the object actually exists.  In this particular case, it's a reference to a helo. The section before this needs to check if _obj exists first, if it does then it'll run the rest of the sections, if not, just exit out.  Here's one section that uses this; </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #m2s9 qSubMenu = 21 _src = tbone ; -- need to add _src object existence check -- ; -- need to ask the big boys at OFP forum :) -- _pw = weapons _src _pwc = count _pw ?(_pwc == 0):goto "myexit" _srcnm = format["Name: %1\n",_src] _twpns = format["Total Wpns: %1\n",_pwc] _schold = 0 _wpnstr = "" _mgstr = "" #loophere1 _ares = _pw select _schold _wpnno = format["No %1:",_schold + 1] _wpnnm = format["%1\n",_ares] _wpnstr = _wpnstr + _wpnno + _wpnnm _schold = _schold + 1 ?(_schold >= _pwc):goto "noloop1" goto "loophere1" #noloop1 _pw = magazines _src _pwc = count _pw _tmags = format["Total Mags: %1\n",_pwc] _schold = 0 #loophere2 _ares = _pw select _schold _mgno = format["No %1:",_schold + 1] _mgnm = format["%1\n",_ares] _mgstr = _mgstr + _mgno + _mgnm _schold = _schold + 1 ?(_schold >= _pwc):goto "noloop2" goto "loophere2" #noloop2 _fullstr = format["%1%2%3%4%5",_srcnm,_twpns,_wpnstr,_tmags,_mgstr] hint _fullstr goto "myexit" <span id='postcolor'> As you can see, it'll generate an error right off  because doing "weapons <null object>" isn't a nice thing to do.  Since this fragment belongs to a huge menu system, I need to ensure that the object exists. Thanks for the clip, _obj == _obj, nice and simple.  Now why didn't I think of that?  Oh yeah, I'm still learning  (winks hard) Quantum69 -DELTA- Just implemented the change and here's the way it works, </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #m2s9 qSubMenu = 21 _src = tbone if (_src == _src) then {[_src,0] exec "vehicleinfo.sqs"} else {goto "myexit"} goto "myexit" <span id='postcolor'> whip a charm baby! thanks
-
Custom "hq" radio callsigns!
quantum69 replied to toadlife's topic in OFP : MISSION EDITING & SCRIPTING
You're timing  with this (as well as your other helpful tuts) is impecable! I just got done doing a search for the whole [west,"HQ"] <x>chat stuff and no result set. Great info. My sister is in the mail  As a side question: Do you have, know where to find a good tut on init.sqs? Noone seems to have written a comprehensive doc on this esoteric script. Thanks. Quantum69 -
before you ask: Â ?(!search me):goto "boboville" Ok, I've looked through hoardes of docs and checked numerous threads in the forums, here and OFPEC to name a couple. What good is the objNull and the function isNull? In my script I try to test it using the various functions that deal with objNull; ?(_obj == objNull): ?(isNull _obj): ?(!alive _obj): Â Â ..... I need to know if _obj exists at all on the map. Â So if for an artillery script _obj = arty1 but arty1 has not been placed yet, I want to skip that part of the script so it doesn't do the infinite loop (which is noticeable). What is the proper way to test for the existance of an object, or more to the point, the absence of an object? </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _src = tbone <here the check for object existance, exit if it doesn't> _pw = weapons _src _pwc = count _pw ?(_pwc == 0):goto "myexit" <span id='postcolor'> After _src = tbone I've tried the various methods above. Of course, getting a count of 0 doesn't catch the problem because "weapons _src" on a nonexistant object returns thanks gang,any help is appreciated. Quantum69