Guest Posted October 15, 2002 The updated v1.85 scripting reference is available for download here or for online browsing here. Share this post Link to post Share on other sites
MacDuco 0 Posted October 15, 2002 loadFile filename Operand types: filename: String Compatibility: Version 1.82 required. Type of returned value: String Description: Return content of given file. Example: loadFile "myFunction.sqf" , result is "if a>b then {a} else {b}" -------------------------------------------------------------------------------- Share this post Link to post Share on other sites
GAMEER_77 0 Posted October 16, 2002 Yes....What's your point? Share this post Link to post Share on other sites
Shabadu 0 Posted October 16, 2002 I'd have thought it was obvious. Share this post Link to post Share on other sites
GAMEER_77 0 Posted October 16, 2002 Nope...I don't get it. He may be happy at the fact that there is a loadfile command, but just pasting what it says in the comref ain't much of an indication. PEACE Share this post Link to post Share on other sites
RED 0 Posted October 16, 2002 I don't understand either, good work on the command ref BIS. RED Share this post Link to post Share on other sites
thePhreak 0 Posted October 16, 2002 I think its to execute a sqf (2GL Flashpoint script) and fetch the variables into local sqs variables. In the example they just check witch of _a and _b ist the greater and fetch thisone. (excuse my english I speak swissgerman Share this post Link to post Share on other sites
RED 0 Posted October 17, 2002 I didn't mean I don't understand the script, I mean i didn't understand why he pasted it into this thread RED Share this post Link to post Share on other sites
bn880 5 Posted October 18, 2002 Question: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">friendly Compatibility: Version 1.78 required. Type of returned value: Side Description: Friendly side (friendly to all units). <span id='postcolor'> also enemy.... what is this? I don't know, I don't understand how friendly and enemy is used. Also, for event handler, anyone here know a really good way of checking if a vehicle has been destroyed by using eventHandler? I have some stuff going but it's not 100% reliable. Thanks in advance Share this post Link to post Share on other sites
GAMEER_77 0 Posted October 18, 2002 I'm guessing it's just checking the rating of a unit. You know, when a units rating goes below 0 he's a rebel. Either that, or you could use it to check if one unit is friendly towards the other: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">Sovman friendly Westman<span id='postcolor'> Dunno about that though, can't check cause i haven't D/L 1.87. PEACE Share this post Link to post Share on other sites
bn880 5 Posted October 18, 2002 Gameer maybe you are right, actually I never used rating before... all the 2 years of OFP and no rating. Anyway, if anyone knows for sure what friendly and enemy are used for, let us know. (probably simple) The eventHandler question I should not have asked that way, let me ask one of the developers like Suma: If I install an eventHandler "hit" on (T72) and inside do </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!(canMove _vehicle):_vehicle removeAllEventHandlers "getIn";_vehicle removeAllEventHandlers "Hit";[_vehType] exec "removeEastUnit.sqs";hint format ["VEHICLE DESTROYED\nvehicle %1\noffender %2\namount %3",_vehicle,_by,_amount];<span id='postcolor'> Is there any chance of another "hit" event being triggered even if the vehicle can not move? I seem to have this problem, sometimes 2 hits are processed for the vehicle when the first hit already removes all Handlers. Share this post Link to post Share on other sites
bn880 5 Posted October 18, 2002 I have answered my question and I am posting the answer in hope people searching for this months from now will use the damn SEARCH feature. To make sure your event Handler is removed promptly and not triggered again for handlers like "hit" or "dammaged" or multiple handlers on one vehicle use something like: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_handler = format ["[_this select 0,_this select 1,_this select 2, %1] call loadFile ""eastVehicleDammaged.sqf""", _tryUnit] _newVehicle addEventHandler ["Dammaged", _handler]<span id='postcolor'> for your handlers... what's different? use .sqf which is atomic and will prevent the event (any event) to be triggered again before you do removeHandler. It really works. Share this post Link to post Share on other sites
madmedic 0 Posted October 20, 2002 I can NEVER get those comand references to download from the Flashpoint 1985 website. Share this post Link to post Share on other sites
Placebo 29 Posted October 20, 2002 I've mirrored it on OFPN here, try that Share this post Link to post Share on other sites
Doolittle 0 Posted November 23, 2002 Is it necessary to remove event handlers on objects that are no longer needed (they are dead)?? What if I added a "killed" event to each player as they respawn. Â A game might have people spawning in maybe 500 times. Â Will this cause problems? If I delete an object does that remove it's event handler?? Â Or is the event still checked on some table? As long as whomever is reading this, I am still wondering, even though I've seen discussions about this, which is "fastest", which is the CPU hog: Trigger or @ I assume @ is faster than Trigger and Trigger is about equal to a loop like #loop ~0.01 goto "loop" ?? Â And @ is probably a loop with ~0.0001?? And what if I have a script that calls out other scripts that go into loops themselves (I see this as like running threads). Â How crazy can we get with doing this??? Â What if I have something firing bullets & each bullet is running its own little script in a loop....I mean, how crazy can we get here? Doolittle Share this post Link to post Share on other sites
madmedic 0 Posted December 4, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (placebo @ Oct. 21 2002,00:03)</td></tr><tr><td id="QUOTE">I've mirrored it on OFPN here, try that <span id='postcolor'> Thanks, that worked....I wonder why I can never download it from "Flashpoint 1985"...I have at one time or another, tried to download all of the different versions, and it NEVER worked. I actually resorted to viewing the "online reference"...and printing the whole thing from there ....that took quite a while Share this post Link to post Share on other sites
DragoFire 0 Posted December 8, 2002 Hi all, I'm not the best when it comes to scripting, so I'd like to ask the following question. Can you add a new event to the event Handler, and if so how? DragoFire Share this post Link to post Share on other sites
Panda-PL- 0 Posted May 2, 2005 How crazy can we get with doing this??? Â What if I have something firing bullets & each bullet is running its own little script in a loop....I mean, how crazy can we get here? I don't get your point... That's quite a normal thing to do - happens all the time. What's wrong with that? Share this post Link to post Share on other sites
Placebo 29 Posted May 3, 2005 I appreciate this topic is pinned but there seemed no real point to reply to that post from nearly 3 years ago? Share this post Link to post Share on other sites
TYsiEK 0 Posted May 6, 2006 I have an interesting reply LINK IS OFFLINE !!!!!!!!!!!!!!!!!!!!!!!!!!! :):) Share this post Link to post Share on other sites
redpride 0 Posted June 4, 2007 Comref link is outdated Share this post Link to post Share on other sites
Macser_old 0 Posted June 4, 2007 (edited) The BIS wiki should have all or most of the scripting reference you need. BIS Wiki Or the ComRef at OFPEC. OFPEC ComRef :) Edited June 15, 2009 by Macser Share this post Link to post Share on other sites
redpride 0 Posted June 4, 2007 Ah thank you very much Mr. Macser! Share this post Link to post Share on other sites