View Full Version : Cpp exec global scripts?
jacobaby
Mar 1 2003, 23:39
For a certain project I would like to know if anybody has a workaround for the "Init" eventhandler not executing scripts globally? I have a script I would like to run on all clients as if it was being done from a units INIT line in the editor.
Interestingly "incomingmissile" does execute on all clients, but when i tried using a true "dammage" EHandler, again the effects were only seen server side.
Any help would be appreciated, I have been looking at this so long I cant see the woods for the trees.........
Cheers
TJ
Any ideas peeps? This is for YOUR benifit at the end of the day...
jacobaby
Mar 2 2003, 16:09
Update.
I would still like to hear about ideas any of you may have, but it seems that the placement of "class eventhandlers" in the CPP affects whether the scripts will work globally when executed by eventhandlers..........
anyone?
TJ
Unfortunately I mainly work with vehicles and we could use fuel maybe for that.
I am curious tho...if "getin" were used on a soldier?
Wonder if that would activate when the game starts and a player is using it?
We also know that useractions are global,but need some way of auto running them
Yes, what I did for the Addon version of CoC Network Services (coming out fairly soon) is from the inited script I toggle the fuel EH by setting fuel to 0... u can set it back also. That will trigger that Fuel EH on every machine on the network,in the fuel script you can do your actual init stuff.
I'd lke my manager script to only execute once as it cycles within itself.
I'm curious ...when does the fuel eventhandler change?
When fuel amount changes?
I wondering if you can remove eventhandlers that are added within the cpp?
Then I could have the init change the fuel to activate all the fuel eventhandler client scripts,then remove the fuel eventhandler as its not needed anymore?
When fuel changes to 0 or from 0. (from empty or to empty)
If one does
setFuel 0
~2
setFuel 0
it will only trigger once if there was actually some fuel before.
And changing the fuel with a "init" eventhandler (server) will activate all clients?
Pennywise
Jun 17 2003, 05:14
There are work arounds. Correct, the 'init' event handler is a server side handle only. However, you may use 'GetIn'. It is a server and client side handler. I use the the 'GetIn' event handler for the F18. If you place your script there, it will execute when a player gets in the vehicle. If you need to run for player only, check to see if the unit is local, ex:"?(Local _Soldier):_isLocal=true". Using a combination of the local check and the 'GetIn' event handler you should get the desired results. Otherwise, you may use the 'GetIn' event handler alone to execute the script on all clients including the server. Hope this helps.
Problem with getin tho is that it only executes when someone gets in, this is a problem as even if you start the game in a vehicle, it doesnt execute.
You think changing the fuel from the "init" will change the fuel on all clients?
Suppose I will have to test
What do you mean you have to test? I already answered your question above
Quote[/b] ]Yes, what I did for the Addon version of CoC Network Services (coming out fairly soon) is from the inited script I toggle the fuel EH by setting fuel to 0... u can set it back also. That will trigger that Fuel EH on every machine on the network,in the fuel script you can do your actual init stuff.
The reason I am talking about the fuel EH is because it solves this local init problem. http://forums.bistudio.com/oldsmileys/smile_o.gif
Pennywise
Jun 17 2003, 13:36
The 'GetIn' eventhandler does get called when you start a game with someone in a vehicle. I have tried it and it works fine for me.
LOL Sorry BN880, thats what I was asking, lol
Thankx ,thats the route I am taking then.I just didnt understand that if init only runs on server,if it would change the fuel on all clients.Just got my 2.5 year old a computer so we should be able to lan test this now anyways.Cant get my older son to play OFP hardly anymore.
Pennywise , no sorry getin doesnt.
I have events attached to my canopy (closes and locks canopy when you getin)
And when I start the game flying,guess what...canopy stays open. (my model starts with canopy open btw) No canopy action happens, otherwise it would close
http://forums.bistudio.com/oldsmileys/smile_o.gif The limitation of that is you need to have a simulation which uses fuel, like car, tank, boat, plane etc. You know what I mean.
Isnt a soldier also a vehicle? Cant you add and remove some fuel still to activate?
The problem lies with weapons it seems, no fuel there
Fired EH seems to also be global, don't know about weapons in general though. A soldier? Don't think that will work.
Pennywise
Jun 17 2003, 16:11
To my knowledge and many others, everything works on the F18 as is, server and client side. Canopy opens and closes as it should and the wings fold up and down as they should; this also works when you start the plane out flying. BTW, the canopy starts out open and will close if you start out flying. Please do download it and try it out. Its on ofpec for download now. Did you try placing your code in the 'init' event handler? Do you have conditions in the event handler? I believe I may be wrong about the 'init' eventhander. It should get called upon mission start on all clients. However if you use createVehicle the 'init' will only be called on server side. I know I used one of the two events, 'init' or 'getin', to do all the client side work. Try placing the canopy animation in the 'init' and 'getin' eventhandlers. That should allow you to start the mission with the plane flying and canopy closed, and close the canopy when a player gets in. Otherwise, my addon wouldnt work at all. Anyways, glad to hear you got a solution. Goodluck with it all!
Did you try placing your code in the 'init' event handler? Do you have conditions in the event handler? I believe I may be wrong about the 'init' eventhander. It should get called upon mission start on all clients. However if you use createVehicle the 'init' will only be called on server side. I know I used one of the two events, 'init' or 'getin', to do all the client side work.
Have a look at the original question (ie the reason for this thread). No init EH's from addons do not start on all clients at mission start, you can use getIn, fuel, fired EH's from your init EH to make a complete Multiplayer initialization.
You must have been using GetIn
Pennywise
Jun 17 2003, 23:30
Quote[/b] ]Have a look at the original question (ie the reason for this thread)
I was responding to Bratty. He claims the 'GetIn' event handler does not get called when you start a plane out flying, which I did get a change to test and it works fine. bn880, Your right, I did use the 'GetIn' EH. I dont have this stuff handy at work to check myself. I tested the 'init' as well and it does not execute on any client, only the server; I wont argue that. As for the original question:
Quote[/b] ]
For a certain project I would like to know if anybody has a workaround for the "Init" eventhandler not executing scripts globally?
I was simply stating that the 'GetIn' event handler could be used as an alternative to the 'Init' event handler. That shouldnt be to far off topic.
Still somewhat confused the fact that the "init" eventhandler only runs server side,but yet changing the fuel on the server will change all the clients,how do I determine what commands that are ran from the server will also run on the clients.
Pennywise
Jun 17 2003, 23:56
Heres one way to test the event handlers:
1st save this script to your addon folder:
"eventCalled.sqs"
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
_option = _this select 0
~1
?(option==0):player globalChat "Init Called"
?(option==1):player globalChat "GetIn Called"
?(option==2):player globalChat "GetOut Called"
?(option==3):player globalChat "IncomingMissile Called"
?(option==4):player globalChat "fired Called"
[/QUOTE]
Be sure you have the one second wait or else you wont see your messages print out.
2nd place this in your eventhandle class for your addon:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
class eventhandlers
{
***init ***= "[0] exec ""eventCalled.sqs""";
***getin = "[1] exec ""eventCalled.sqs""";
***getout= "[2] exec ""eventCalled.sqs""";
***incomingMissile = "[3] exec ""eventCalled.sqs""";
***fired = "[4] exec ""eventCalled.sqs""";
};
[/QUOTE]
I used a similar test a while back when I was learning about the event handlers. ***All you have to do is create a sample mission, preferably on desert Island. ***Run your sample mission in hosted and dedicated server modes and observe the output. ***It will tell you immediately how the behave in different modes.
[quote]I was responding to Bratty. ***He claims the 'GetIn' event handler does not get called when you start a plane out flying, which I did get a change to test and it works fine. ***[quote]
Hmm.. look at this
getin="(_this select 0) animate [""corcanopy"", 1]";
When I start the game, my canopy is still open,therefore that line did not execute,what test did you run? You must have a script running thats closing the canopy
It works after that,i am saying it doesn't appear to run because the soldier didnt getin is my guess
Pennywise
Jun 18 2003, 02:39
Bratty,
It looks like you are executing the same animation sequence for both cases, when soldier is present and not present. ***
Quote[/b] ]
When I start the game, my canopy is still open,therefore that line did not execute,what test did you run?
This is similar to my test if your interested. ***Your right about testing for a soldier. ***If a soldier is present in the vehicle when mission starts you want to call:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
(_this select 0) animate ["corcanopy", 0]
[/QUOTE]
Otherwise, if a soldier is not present call:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
(_this select 0) animate ["corcanopy", 1]
[/QUOTE]
This is of course assuming that a 0 is close and a 1 is open for your animation sequence.
Test code should look like this:
"canopyControl.sqs"
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
_obj = (_this select 0)
_Pilots=crew _obj
_Pilots_count ***= count Pilots
?(_Pilots_count ***> 0):(_this select 0) animate ["corcanopy", 0]
?(_Pilots_count ***== 0):(_this select 0) animate ["corcanopy",1]
[/QUOTE]
Then, in your event class place
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
getin = "[_this select 0] exec ""canopyControl.sqs""";
[/QUOTE]
That should handle the canopy closing when you start in mission with a soldier and open when not present.
Back to the original problem... ;)
We want to run a script for every unit in a mission right at the start, regardless of their class, without a trigger.
This counts out the fuel eh because it is dependant on simulation.
Anyway, we have concluded that it is near impossible to do this. If anyone has any ideas, plz share ;D
Pennywise
Jun 18 2003, 14:12
nm
Sounds like a job for an "obelisk". Talk to Dinger of CoC. Anyway, what you need to do is setup some limited network service through something like the CoC Server just released (this is of a simulaiton that supports fuel EH). Have each map placed unit add itself to an array (a little complicated), then use the typeOf function on each unit in the array and run their init script from the "CoC Server" fuel EH. (after some time) So you will gain access to their inits by doing exec "\TypeofUnit\init.sqs".
Otherwise if you can wait 20 seconds you can use the CoC Network services included in the CoC-Server from all the addons.
Pennywise
Jun 18 2003, 16:35
Doesnt the COC server use preprocessfiles? That would be nice, but preprocessfiles only load in the init.sqs in missions only. At least so it seems. I've tried doing that in addons and the 'loadfile' and 'preprocessfile' commands did not work. http://forums.bistudio.com/oldsmileys/sad_o.gif
That should handle the canopy closing when you start in mission with a soldier and open when not present.
LOL , ...I just told you that "getin" does NOT get called when you start the game and a soldier is in the vehicle.
The way I called it completely right,I have no typos, my canopy starts open and "getin" did NOT get called.
Don't sit here and talk theory,try it yourself and see.
But nevermind anyways,it's not important, it doesnt help
Doesnt the COC server use preprocessfiles? That would be nice, but preprocessfiles only load in the init.sqs in missions only. At least so it seems. I've tried doing that in addons and the 'loadfile' and 'preprocessfile' commands did not work. http://forums.bistudio.com/oldsmileys/sad_o.gif
The CoC Server Addon uses loadfile, it works just that the commenting syntax is different in loadfile than preprocess file, and preProcessFile has no problem with nulls, whereas loadfile does.
You do not require preProcessfile in addons as they are read into memory anyway, although I strongly suggest to BIS that they unify the syntax for preProcessed and loaded files. All the way.
jacobaby
Jun 18 2003, 19:21
soldiers cant have fuel added and removed, I have tried it
Who are you replying to jacobaby? Because I'm not assuming they can.
snypir -- I think I put the solution in the ofpec thread:
if it's every unit, and you're rewriting the config.cpp ("superconfig"), you can do it this way:
class Man
(or class Land, or whatever)
class eventhandlers
{
init = "if ({_x in [_x]} count [CoC_Obelisk] == 0) then {CoC_Obelisk = {CoC_Obelisk} createvehicle [-1000,-10000,5000]}";
};
then on the obelisk have an init EH that sets fuel to 0, and a fuel EH that kicks off your client-side scripts.
snypir -- I think I put the solution in the ofpec thread:
if it's every unit, and you're rewriting the config.cpp ("superconfig"), you can do it this way:
But the init eh is not fired at all on client in MP, no?
Pennywise
Jun 18 2003, 20:10
Quote[/b] ]
The CoC Server Addon uses loadfile, it works just that the commenting syntax is different in loadfile than preprocess file, and preProcessFile has no problem with nulls, whereas loadfile does.
Thats interesting bn880, I might have to go back and look at it again. ***BTW, awsome work on that addon. ***I downloaded it and tried it out. ***Its pretty cool.
Quote[/b] ]
LOL , ...I just told you that "getin" does NOT get called when you start the game and a soldier is in the vehicle.
Bratty, Im sorry dude. I stand with it does. ***I use it; it works fine. ***
Anyways, back to the topic.
Well I have been working on this night and day and so far this:
Changing the fuel ran from an "init" event handler does not change the fuel on the clients,therefore no fuel eventhandler is activated for the clients in the game
Getin does no execute when you start a soldier in the vehicle
(sorry pennywise)
I have lan setup and testing this and i am stumped,only way i get the scripts to run on the clients,is using like engine,fuel,getin,eventhandler ,but the client has to use them to activate.
I do not have a way of making a global script activating yet automatically
Isnt a soldier also a vehicle? Cant you add and remove some fuel still to activate?
The problem lies with weapons it seems, no fuel there
Your trying to set fuel to a soldier? A default soldier? Thas not going to work no matter what you try. The soldier class isnt coded to hold fuel. Why are you not trying something like disableUserInput or DisableAI? I dont understand what your trying to do here but thinking that your problem has anything to do with client/server side issues is crazy.
No Hudson that was only a suggestion pages back, and Jacob already answered it saying he tried and it doesnt work
I was only trying to help with the soldier solution, but I am working with a plane and am also trying to get a manager script running automatically at startup on all machines and I have a lan setup here and testing
No Hudson that was only ***a suggestion pages back, and Jacob already answered it saying he tried and it doesnt work
I was only trying to help with the soldier solution, but I am working with a plane and am also trying to get a manager script running automatically at startup on all machines and I have a lan setup here and testing
-------------------------------------------------------------
...Getin does no execute when you start a soldier in the vehicle (sorry pennywise)...
I dont understand penny sometimes either but I can promise you his code works. And even better I can prove it, even though all you have to do is download the F18 and try it in MP. Its one of the few vehicles addons with scripted animations that dosent crap out in MP games. I can save you some time though and just post it all here :-). The following is the eventhandlers from the F18 hornet (This is from soon to be released 1.2 version so might differ from yours)...
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //------------------------------------------------------------------
*** ***class eventhandlers
*** ***{
*** *** ***init ***= "if (alive (_this Select 0)) then {[_this select 0, true] exec ""\Rad_F18\scripts\messagemgr.sqs""}";
*** *** ***getin = "if (alive (_this Select 0)) then {[_this select 0, false, _this select 2] exec ""\Rad_F18\scripts\messagemgr.sqs""}";
*** *** ***getout= "[_this Select 0,true] exec ""\Rad_F18\scripts\canopyctrl.sqs""";
*** *** ***incomingMissile = "[_this select 0] exec ""\Rad_F18\scripts\inmissile.sqs""";
*** *** ***fired = "[_this Select 0, _this Select 1, _this Select 2, _this Select 3, _this Select 4] exec ""\Rad_F18\scripts\fired.sqs""";
*** ***};
***};
[/QUOTE]
Now as you can see both init and getin are executing messagemgr.sqs...
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;
;;Code by Pennywise from Radishville *** *** *** *** *** *** *** *** *** ***;;
;;Email: ***onepremise@nc.rr.com *** *** *** *** *** *** *** *** *** *** *** *** ***;;
;;Email2: [EMAIL=pennywise@radishville.com]pennywise@radishv ille.com[/EMAIL] *** *** *** *** *** *** *** *** *** ***;;
;;------------------------------------------------------;;
;;Ver. *** *** *** ***Changes *** *** *** *** *** *** *** *** Date *** *** *** *** Ini.;;
;;------------------------------------------------------;;
;;1.0.0 *** ***Initial Coding *** *** *** *** *** 03/20/03 *** *** *** JAH ***;;
;;1.3.0 *** ***New Features *** *** *** *** *** *** 05/26/03 *** *** *** JAH ***;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;
;;This script handles the aircrafts behavior in flight ***;;
;;for server, client, and AI *** *** *** *** *** *** *** *** *** *** *** *** *** ***;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;
;;Right now there is only support for single unit in *** ***;;
;;craft. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;
~1
;================================================= ========
;Variables Passed
;================================================= ========
_obj *** *** *** *** *** = _this Select 0
_doInit *** *** *** ***= _this Select 1
?((count _this)>2):_unit = _this Select 2
;================================================= ========
;Scripts - just change the path to run for another addon
;================================================= ========
_F18ScriptPath= "\Rad_F18\scripts\"
_init *** *** *** *** = _F18ScriptPath+"init.sqs"
_wingctrl *** *** = _F18ScriptPath+"wingctrl.sqs"
_canopyctrl *** = _F18ScriptPath+"canopyctrl.sqs"
_gearctrl *** *** = _F18ScriptPath+"gearctrl.sqs"
_hookctrl *** *** = _F18ScriptPath+"hookctrl.sqs"
_aleronctrl *** = _F18ScriptPath+"aleronctrl.sqs"
_SBarrierSQS ***= _F18ScriptPath+"breakSoundBarrier.sqs"
_aiSpdAdjust ***= _F18ScriptPath+"aiSpeedAdjust.sqs"
_sysctrl *** *** ***= _F18ScriptPath+"sysctrl.sqs"
_cbumenuctrl ***= _F18ScriptPath+"CBUMenuctrl.sqs"
_ejectAction ***= _F18ScriptPath+"ejectaction.sqs"
_jammerctrl *** = _F18ScriptPath+"jammer.sqs"
;================================================= ========
;Initialize Global Variables
;================================================= ========
[_obj] exec _init
?(agvRADdebugAddon):player globalChat "Debug settings on"
?(_doInit and agvRADdebugAddon):player globalChat "Init Called"
?(!_doInit and agvRADdebugAddon):player globalChat "GetIn Called"
;================================================= ========
;Set Wings and Alerons upon spawn
;================================================= ========
?(_doInit):[_obj, true, true] exec _wingctrl
;================================================= ========
;Initialize Local Variables
;================================================= ========
_soundbarrier *** ***= true
_wingCheck *** *** *** = true
_scream *** *** *** *** ***= true
_gearmove *** *** *** ***= true
_StallAlarm *** *** ***= true
_DAAlarmLvl0 *** *** = true
_DAAlarmLvl1 *** *** = true
_DAAlarmLvl2 *** *** = true
_DAAlarmLvl3 *** *** = true
_foldWingSpd *** *** = 20
_sonicBmSpd *** *** ***= 925
;================================================= ========
;Detect for Player(s)
;================================================= ========
#DetectPlayer
_sldr_present=crew _obj
_sldr_count ***= count _sldr_present
?(_sldr_count >= 1):_Soldier ***= _sldr_present select 0
?(_sldr_count >= 1):[_obj,false] exec _canopyctrl; goto "InitializeComponents"
[_obj,true] exec _canopyctrl
goto "Exit"
;================================================= ========
;Initialize Components
;================================================= ========
#InitializeComponents
_i = 0
?(!agvRADfoldwing):[_obj, true] exec _aleronctrl
?(agvRADfoldwing):[_obj, false] exec _aleronctrl
goto "CheckIfFlying"
;================================================= ========
;Determine if we started mission flying
;================================================= ========
#CheckIfFlying
_pos = GetPos _obj
_z = _pos select 2
?(speed _obj >= 50):_wingCheck=false; [_obj, false] exec _gearctrl; goto "F18SetVelocity"
?(_z >= 50):goto "CheckIfFlying"
goto "CheckUnitType"
;================================================= ========
;If flying, set the correct speed
;================================================= ========
#F18SetVelocity
_vel = velocity _obj
_obj setVelocity [(_vel select 0) * 0.5,(_vel select 1) * 0.5,(_vel select 2) * 0.5]
?(agvRADdebugAddon):player globalChat format["Your Speed = %1",(speed _obj)]
;================================================= ========
;Show Alerons
;================================================= ========
[_obj, true] exec _aleronctrl
goto "CheckUnitType"
;================================================= ========
;Unit Detected; Determine if AI, Player, Non Local
;================================================= ========
#CheckUnitType
?(agvRADdebugAddon):_Soldier globalChat "CheckUnitType"
_isInObj=false; _isPlayer = false; _isLocal=false; _isDriver=false; _isGunner=false; _isCommander=false
?(_Soldier in _obj):_isInObj=true
?(Local _Soldier):_isLocal=true
?(_Soldier == player):_isPlayer=true
?((driver _obj)==_Soldier): _isDriver=true
?((gunner _obj)==_Soldier): _isGunner=true
?((commander _obj)==_Soldier): _isCommander=true
?(_isLocal and _isPlayer and _isDriver): goto "PlayerPilotInitialize"
?(_isLocal and !_isPlayer and _isDriver):goto "AIPilotInitialize"
?(_isLocal and _isPlayer and _isGunner): goto "PlayerGunnerInitialize"
?(_isLocal and !_isPlayer and _isGunner):goto "AIGunnerInitialize"
?(_isLocal and _isPlayer and _isCommander): goto "PlayerCmdrInitialize"
?(_isLocal and !_isPlayer and _isCommander):goto "AICmdrInitialize"
?(!_isLocal and !_isPlayer and _isDriver):goto "GlobalEventsInitialize"
?(!_isLocal):goto "Exit"
;================================================= ========
;AI Pilot Message Loop
;================================================= ========
#AIPilotInitialize
_F18GearFailToken= (name (driver _obj))
?(agvRADdebugAddon):_Soldier globalChat "AIPilotMessageLoop"
avgRADAIPilot ***= avgRADAIPilot + [_Soldier]
[_obj, _Soldier] exec _aiSpdAdjust
[_obj, true] exec _jammerctrl
#AIPilotMessageLoop
_pos *** *** = GetPos _obj
_z *** *** *** = _pos select 2
_aispeed = speed _obj
?(_aispeed < _foldWingSpd and !_wingCheck):_wingCheck=true
?(_wingCheck and _aispeed >= _foldWingSpd):_wingCheck=false; [_obj, false] exec _wingctrl
?(_aispeed >= 201 and _z>= 71 and _gearmove): [_obj, false] exec _gearctrl;[_obj, false] exec _hookctrl;_gearmove=false
?(_aispeed <= 200 and _z<= 70 and !_gearmove): [_obj, true] exec _gearctrl;[_obj, true] exec _hookctrl;_gearmove=true
?(_aispeed<_sonicBmSpd and !_soundbarrier):_soundbarrier=true
?((_aispeed>=_sonicBmSpd and _soundbarrier) and agvRADdebugAddon):_Soldier globalChat "AIMachSound!"
?(_aispeed>=_sonicBmSpd and _soundbarrier):[_obj, _SBarrierSQS] call {[_this select 0] exec (_this select 1)}
?(_aispeed>=_sonicBmSpd and _soundbarrier):_obj say "mach"; _soundbarrier=false
~.1
?((_Soldier in _obj) and (alive _Soldier) and (alive _obj)):goto "AIPilotMessageLoop"
#AIPilotDeconstructor
avgRADAIPilot ***= avgRADAIPilot - [_Soldier]
avgRADGearFailList ***= avgRADGearFailList - [_F18GearFailToken]
goto "Reset"
;================================================= ========
;Player Pilot Message Loop
;================================================= ========
#PlayerPilotInitialize
?(agvRADdebugAddon):_Soldier globalChat "PlayerPilotMessageLoop"
_F18GearFailToken= (name (driver _obj))
[_obj] exec _cbumenuctrl
[_obj, true] exec _jammerctrl
_ejectActionID = _obj Addaction ["Eject",_ejectAction]
#PlayerPilotMessageLoop
_pos *** ***= GetPos _obj
_z *** *** ***= _pos select 2
_pspeed = speed _obj
?(_pspeed < _foldWingSpd and !_wingCheck):_wingCheck=true
?(_wingCheck and _pspeed >= _foldWingSpd):_wingCheck=false; [_obj, false] exec _wingctrl
?(_pspeed>=125 and !_StallAlarm):_StallAlarm=true
?((_z >= 50) and (_pspeed < 125) and _StallAlarm):[_obj,0] exec _sysctrl;_StallAlarm=false
?(_pspeed<_sonicBmSpd and !_soundbarrier):_soundbarrier=true
?((_pspeed>=_sonicBmSpd and _soundbarrier) and agvRADdebugAddon):_Soldier globalChat "PMachSound!"
?(_pspeed>=_sonicBmSpd and _soundbarrier):[_obj, _SBarrierSQS] call {[_this select 0] exec (_this select 1)}
?(_pspeed>=_sonicBmSpd and _soundbarrier):_obj say "mach"; _soundbarrier=false
?((getDammage _obj>.10) and _DAAlarmLvl0):[_obj,2] exec _sysctrl; _DAAlarmLvl0=false
?((getDammage _obj>.40) and _DAAlarmLvl1):[_obj,3] exec _sysctrl; _DAAlarmLvl1=false
?((getDammage _obj>.60) and _DAAlarmLvl2):[_obj,4] exec _sysctrl; _DAAlarmLvl2=false
?((getDammage _obj>.75) and _DAAlarmLvl3):[_obj,5] exec _sysctrl; _DAAlarmLvl3=false
?((getDammage _obj> .80) and _scream):[_obj,6] exec _sysctrl; _scream=false
~.1
?((_Soldier in _obj) and (alive _Soldier) and (alive _obj)):goto "PlayerPilotMessageLoop"
#PlayerPilotDeconstructor
_obj removeAction _ejectActionID
avgRADGearFailList = avgRADGearFailList - [_F18GearFailToken]
goto "Reset"
;================================================= ========
;Player Gunner Message Loop
;================================================= ========
#PlayerGunnerInitialize
?(agvRADdebugAddon):_Soldier globalChat "PlayerGunnerMessageLoop"
goto "Exit"
;================================================= ========
;AI Gunner Message Loop
;================================================= ========
#AIGunnerInitialize
?(agvRADdebugAddon):_Soldier globalChat "AIGunnerMessageLoop"
avgRADAIGunner ***= avgRADAIGunner - [_Soldier]
goto "Exit"
;================================================= ========
;Player Commander Message Loop
;================================================= ========
#PlayerCmdrInitialize
?(agvRADdebugAddon):_Soldier globalChat "PlayerCmdrMessageLoop"
goto "Exit"
;================================================= ========
;AI Commander Message Loop
;================================================= ========
#AICmdrInitialize
?(agvRADdebugAddon):_Soldier globalChat "AICmdrMessageLoop"
avgRADAICommander ***= avgRADAICommander - [_Soldier]
goto "Exit"
;================================================= ========
;Global Message Loop
;================================================= ========
#GlobalEventsInitialize
?(agvRADdebugAddon):_Soldier globalChat "GlobalEventsInitialize"
#GlobalEvents
_gspeed = speed _obj
?(_gspeed<_sonicBmSpd and !_soundbarrier):_soundbarrier=true
?((_gspeed>=_sonicBmSpd and _soundbarrier) and agvRADdebugAddon):_Soldier globalChat "GMachSound!"
?(_gspeed>=_sonicBmSpd and _soundbarrier):[_obj, _SBarrierSQS] call {[_this select 0] exec (_this select 1)}
?(_gspeed>=_sonicBmSpd and _soundbarrier):_obj say "mach"; _soundbarrier=false
[_obj, true, true] exec _aleronctrl
~.1
?((_Soldier in _obj) and (alive _Soldier) and (alive _obj)):goto "GlobalEvents"
?(agvRADdebugAddon):_Soldier globalChat "Exit Global Sound"
goto "Exit"
;================================================= ========
;When the plane respawns or player exits, open the canopy
;================================================= ========
#Reset
?(agvRADdebugAddon):_Soldier globalChat "Reset"
[_obj,true] exec _canopyctrl
goto "DetectPlayer"
#Exit
?(agvRADdebugAddon):_Soldier globalChat "Exit Manager"
exit[/QUOTE]
and a screenshot of the...
?(agvRADdebugAddon):player globalChat "Debug settings on"
?(_doInit and agvRADdebugAddon):player globalChat "Init Called"
?(!_doInit and agvRADdebugAddon):player globalChat "GetIn Called"
Working on my machine (playing on pennys dedicated server)...
http://mywebpages.comcast.net/HudsonTPF/pics/CBU001.jpg
As you can see "Getin" was executed (Note canopy closed at mission start). If you need more help, maybe show penny exactly what your trying to do (code) and he can figure it out. I really want you to fix your plane, really excited about it. Even more so after seeing the newest screens with those beautiful textures ***http://forums.bistudio.com/oldsmileys/wow_o.gif ***Anyhoo. Its a problem Im sure can be fixed. I havnt seen a global variable that penny cant lick yet!
Well I have been working on this night and day and so far this:
Changing the fuel ran from an "init" event handler does not change the fuel on the clients,therefore no fuel eventhandler is activated for the clients in the game
I don't know how you are doing your tests, but they seem to disagree with work I have already done and that is already available for download.
The triggering of the fuel EH anywhere will get it triggered on all machines.
Hmm, K i looked at your plane and tried it lan and the scripts are NOT executing globally,sorry I had to be the bad news bearer.
Here is a pic from the clients machine,notice the plane in front of him (among all the other planes) Do not have their hidden selections drawn,because the scripts DON'T execute on these planes on a clients machine.I had to enter the plane that I was in and then the scripts ran
http://www2.freepichosting.com/Images/38197/7.jpg
Well I have been working on this night and day and so far this:
Changing the fuel ran from an "init" event handler does not change the fuel on the clients,therefore no fuel eventhandler is activated for the clients in the game
I don't know how you are doing your tests, but they seem to disagree with work I have already done and that is already available for download.
The triggering of the fuel EH anywhere will get it triggered on all machines.
The "Fuel" handler does run on all machines,but how are you triggering it? Changing the fuel from the "init" eventhandler does not appear to change the fuel on all machines and so globally the fuel handler isnt activating on all machines
You have to be in the plane to have the GETIN event triggered. Put AI in that plane before you start the mission and it will work just fine. Its GETIN were discussing here running client side. not init. INIT isnt going to do anything for you client side in MP on local or dedicated server. We just ran a similar mission on a local server this time and I dont see how you got that pic to look that way, take another pic and leave the menu in the pic and then I can see what version F18 your running or if the event handlers are even running...
Test you mission again bratty and this time add this to anythings init line in the editor...
agvdebugCustomAddon=true
Then take a pic just like the one you did before and leave the chat messages and menu in the pic. Put an AI in the forward plane and make sure your in the rear plane at mission start. It will work as it should. The F18 was designed as a MP addon. The majority of our testing for the addon was done in MP, both DS and local. So I know the plane handles on local servers There is a possiblity that you have karrillions old RTS3Beta5c.pbo in your addons folder and that addon is messing with the flaps. That is the only problem ever reported to me about the F18s scripting in MP.
The following is a pic from penny and I a couple mins ago trying similar teast as you, local server thius time, using THIS F18 (version1) (http://www.ofpec.com/addons/addon_detail.php?ID=347) I can not reproduce the errors your having, maybe your using the wrong F18?
http://mywebpages.comcast.net/HudsonTPF/pics/local1.jpg
Pennywise
Jun 19 2003, 05:06
Here is a fine working example. ***Im on Malden, I started the mission with pilot flying. ***Be sure to have 'agvdebugCustomAddon=true' in your init line in the mission editor. ***You will get this in your message box:
Debug Messages:
http://operationflashpoint.dyndns.org/screenies/inFlying.jpg
That script is executed "globally" too, from the config.cpp! ***Every Player will see some sort of debug message. ***We have tested this thouroughly.
Hmm K, Sorry I don't have time to work on your plane, I have my own problems,lol.
You think I doctored the pics or something.I was just showing that you have the same problem.The F18 I used is version 1 and both computers hardly have any addons installed.Thing is I have more hidden selections than your F18 and it looks funny.
You even think that getin executes when you start in a vehicle,its not helping me at all to explain this to you.
But animations work globally,your init line is moving your canopy.Instead of arguing.Take any other addon (not one loaded with scripts)
And add this to the getin eventhandler
getin ="[_this select 0] exec ""\iegf4u\getin.sqs""";
And then tell me that line executes when you start in the plane is all.But this isn't helping my problem.My next post here will be the solution.
I don't know how you are doing your tests, but they seem to disagree with work I have already done and that is already available for download.
The triggering of the fuel EH anywhere will get it triggered on all machines.
The "Fuel" handler does run on all machines,but how are you triggering it? Changing the fuel from the "init" eventhandler does not appear to change the fuel on all machines and so globally the fuel handler isnt activating on all machines
That's what I'm doing, I use the script run by the init EH to trigger off the fuel EH's on all machines. Feel free to dePBO the CoC_NS.PBO and have a look. http://forums.bistudio.com/oldsmileys/smile_o.gif
Hmm K, Sorry I don't have time to work on your plane, I have my own problems,lol.
You think I doctored the pics or something.I was just showing that you have the same problem.The F18 I used is version 1 and both computers hardly have any addons installed.Thing is I have more hidden selections than your F18 and it looks funny.
You even think that getin executes when you start in a vehicle,its not helping me at all to explain this to you.
But animations work globally,your init line is moving your canopy.Instead of arguing.Take any other addon (not one loaded with scripts)
And add this to the getin eventhandler
getin ="[_this select 0] exec ""\iegf4u\getin.sqs""";
And then tell me that line executes when you start in the plane is all.But this isn't helping my problem.My next post here will be the solution.
You obviously didnt read any of the code I posted or even cared to look at the pics. Even a two year old can read the text in the pic and see "GETIN" being called.
Well since you want to be a little brat about it I will no longer try to help you. Your aircraft can remain broken for all I care now. We tried to give you the help you wanted. ANYONE can download the F18 and try your test. Local or dedicated, and will see NO problems like your reporting. ***Why you are being so big headded and stubborn on this issue I will never know. Its not that hard a problem to fix. The F18 works fine. Ask any of the hundreds of players using it nightly at karrillions server if you dont want my biased opinion. I never said you doctored any pics, your being an ass putting words in my mouth. I asked you to use a debug line that was added to the F18 for just this purpose. Your making assumptions just lost you the help that was gonna make your bird fly. Sorry about your luck.
Quote[/b] ]You even think that getin executes when you start in a vehicle,its not helping me at all to explain this to you.
Your a bugger eating moron if you think it dosent. Go ahead and remove the F18s init EH and repack the addon. GETIN STILL RUNS ON CLIENT!!!!! The only reason init kicks off messagemgr.sqs on the F18 is for server side checks later in the script. our INIT event isnt what we use to do the animation control. I really dont know how to make this more clear to you. The bottom line here is...
Mine works, yours is broke.
I beg anyone to please download the addon and try it out in your own test with a friend. You will not be able to reproduce any results close to what is shown in brats pic. I tried to help you bratty the best I could, giving you code that is proven to work in MP. Your evidently to stubborn to get it to work and are being to big an ass to accept help. So good day to you bratty and best of luck. Ill send you a fixed version of your aircraft after you release it.
Ok let's relax here a little, in all the confusion we don't need to actually fight over OFP event handlers. http://forums.bistudio.com/oldsmileys/smile_o.gif
Pennywise
Jun 19 2003, 18:08
Bratty, all you gotta do is look at the code man. ***Its posted above. ***Although the version posted is to the newer F18 thats addon compliant, hence the global debug variable is different. ***The 1.0 version still has the same kind of debug messages that output to the message box, using 'agvdebugCustomAddon'. ***I guarentee you that if you start that plane out flying in mission, you will see debug messages fly through your message box as you "start out flying". ***Try using the actions menus and more will popout. ***Sitting there and taking a screenie wont do it. Many ppl use this addon; its included in the RTS addon pack by Karrillion. ***LOL, there is nothing wrong with it.
FYI, the "hidden" messages will "appear" by placing 'agvdebugCustomAddon=true' in the init line in the mission editor (for the 1.0 F18 addon by hudson and pennywise). ***Just look at the code above. ***Its a working example. ***
No hard feelings dude. ***Really. ***I just know this stuff works. ***Its been working since before the release, which was like 4 months ago. ***Otherwise, all the many users would have let us know. ***Goodluck with your addon dude.
BTW, bn880 is right. *** The whole purpose behind COCServer is moving data between clients. ***You have to have some way to establish a listener and apparently the fuel EH does the job. ***Download and try it.
Yes instead of arguing why wont you just try what I said?
Your plane has the same problem as mine.And I clearly showed you that.I also clearly showed you getin doesnt get called when you start in a vehicle.
Yes instead of arguing why wont you just try what I said?
Your plane has the same problem as mine.And I clearly showed you that.I also clearly showed you getin doesnt get called when you start in a vehicle.
Bratty your the only person in 3 and a half months to mention this problem. Stop saying that the F18 dosent work. Nobody has ever reported this before. If it were an MP problem then it would be very well known and anyone could confirm your findings. Its not broke, yours is, we gave you the code to fix it. Its up to you weather or not you want your addon to preform in MP. We are not the ones starting "Cpp exec global script" threads asking for help here, you are. We dont need the help because ours works, anyone that has used it in MP should sit there and wonder what you did to get those results in your pic. Send me you broken addon and I guarantee Ill have it working in less time than we have been sitting bitching weather or not "Getin" execs. If you would just use the damn code you would see it works.
Better yet join my local server and I will prove to you that your eating buggers. IP is 67.162.190.157 anyone wanting to join is welcome, come see the amazing non dissapearing aileron textures and watch the scripts ALL exec localy on your machine, be sure to get THE CORRECT ADDON! (http://www.ofpec.com/addons/addon_detail.php?ID=347) before you join though...
Pennywise
Jun 20 2003, 01:57
Bratty, I'll give you one last piece of info to ponder. ***Your initial test still did not prove anything. ***We were specifically talking about starting the plane flying while occupied. ***your Just trying to bark at the first thing you see wrong, which I have never seen the alerons disappear in any of my missions.
Quote[/b] ]
I was responding to Bratty. ***He claims the 'GetIn' event handler does not get called when you start a plane out flying, which I did get a change to test and it works fine. ***
You tested the F18 sitting on the ground doing nothing. ***What do you expect to happen? ***The gear go up? ***Not on the ground. ***Why are you so afraid to try it out? ***It doesnt take but a second. ***You dont even need debugging on. ***Just keep this in mind, when you start the mission while in the plane and your in it, tell me how that loud "Boom!" is getting executed. ***Zoom out and watch the air pressure build up around the plane. ***Watch the gear fold up too. ***Just keep that in mind. ***We'll all agree its not coming from the 'init'. ***Theres your proof and there is no denying that! ***Peace.
LOL, I'm not saying anything, but you are so wrong.Your plane has same problem that I am trying to fix on mine
lol ,lol, you will be so embarrased when you realize
LOL, I'm not saying anything, but you are so wrong.Your plane has same problem that I am trying to fix on mine
lol ,lol, you will be so embarrased when you realize
And what problem is this brat? What have you donr to it that nobody else can seem to do?
LOL even nasty pvt messages.I will settle this like an adult here and now.Appears I have no choice ,but I have to explain.
First of all I didn't start this post and I was trying to help by figuring out a global way to execute a script from within an addon,because I also need to do this (so don't you)
I try not to offend,your jet is most excellent and you know I like to help.Your plane along with mine makes use of "hidden selections" I have like 39 of them at last count.I need to find a way to execute a script globally to texture some of these hidden selections at startup.
We know "init" runs from server and thats how I was doing it.And works fine for single player.However I fire up a lan game and look from the clients machine and the selections are still hidden.When I get my manager script to run from the client side ,it works then ,so nothing is wrong with the scripts. I can attach the script to other eventhandlers and get it to run then (by engine,getin,getout etc..) But not at startup
I have tried the fuel eventhandler many times and of course ,running a script automatically from server side isn't changing the fuel on all machines.I am to assume that bn880 is making it work by creating global variables within the game and broadcasting them.Thats an approach I am trying not to use yet.Which gets me to another thing.
Your plane is closing the canopy by itself when a pilot is in it because of your init and global variables you are using ,because I am testing this like crazy and I tell you getin does not activate when you start the game with a player in it.If thats the case I could attach my script to getin and getout handler and it would run whether a soldier is in it or not.It won't.
The way I checked your plane is the same way I check mine.I made quick mission that starts with 5 empty planes and 2 soldiers not in any vehicle.
Now when you look at the planes from the server ,everything is fine (init eventhandler)
But from the clients side ,none of the planes has their hidden selections drawn because no script has ran yet,now when the client gets in ***a plane,the script runs and everythings ok on that plane (but like the pic, I showed you other planes don"t)
Now this is ok for you as you only have the little flaps that I see and the script will eventually get ran ,but I have quite ***a few parts including most of my gear that doesnt get textured .
I will fix my problem , help is nice as I may resort to making some global variables,but to be honest,I want many of these planes at the same time and I would just like to find a way to run a script globally thats internal and not dependant on any network services or what have you.
But trust me,I am testing these things now and what I tell you is true.I have tried quite a bit of different stuff and still am
And on another note,its possible things work differently on a dedicated server? Nevertheless I need this to work on a lan type game.
Your so beyond help bratty, Id wish you good luck but im afraid it will be wasted.
Pennywise
Jun 20 2003, 04:37
You wouldn't know; You never started the plane out flying in the mission or tried any of the suggestions I mentioned in thread. ***Your not even trying to. ***I dont even know why I am wasting my time with you. ***Quotes like this show you dont know whats going on in my code:
Quote[/b] ]Your plane is closing the canopy by itself when a pilot is in it because of your init and global variables you are using
Believe me, there is much more going on than that. ***You cant even explain the sonic boom or the gear raising when a player starts out flying in the F18. ***Or why this is required if you start the plane out flying:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
;================================================= ========
;Unit Detected; Determine if AI, Player, Non Local
;================================================= ========
#CheckUnitType
?(agvRADdebugAddon):_Soldier globalChat "CheckUnitType"
_isInObj=false; _isPlayer = false; _isLocal=false; _isDriver=false; _isGunner=false; _isCommander=false
?(_Soldier in _obj):_isInObj=true
?(Local _Soldier):_isLocal=true
?(_Soldier == player):_isPlayer=true
?((driver _obj)==_Soldier): _isDriver=true
?((gunner _obj)==_Soldier): _isGunner=true
?((commander _obj)==_Soldier): _isCommander=true
?(_isLocal and _isPlayer and _isDriver): goto "PlayerPilotInitialize"
?(_isLocal and !_isPlayer and _isDriver):goto "AIPilotInitialize"
?(_isLocal and _isPlayer and _isGunner): goto "PlayerGunnerInitialize"
?(_isLocal and !_isPlayer and _isGunner):goto "AIGunnerInitialize"
?(_isLocal and _isPlayer and _isCommander): goto "PlayerCmdrInitialize"
?(_isLocal and !_isPlayer and _isCommander):goto "AICmdrInitialize"
?(!_isLocal and !_isPlayer and _isDriver):goto "GlobalEventsInitialize"
?(!_isLocal):goto "Exit"
[/QUOTE]
FYI, there are no global variable in my canopy script, it uses local variables:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;
;;Code by Pennywise from Radishville *** *** *** *** *** *** *** *** *** ***;;
;;Email: ***onepremise@nc.rr.com *** *** *** *** *** *** *** *** *** *** *** *** ***;;
;;Email2: pennywise@radishville.com *** *** *** *** *** *** *** *** *** ***;;
;;------------------------------------------------------;;
;;Ver. *** *** *** ***Changes *** *** *** *** *** *** *** *** Date *** *** *** *** Ini.;;
;;------------------------------------------------------;;
;;1.0.0 *** ***Initial Coding *** *** *** *** *** 03/20/03 *** *** *** JAH ***;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;
;================================================= ========
;Variables Passed
;================================================= ========
_obj *** ***= _this select 0
_status = _this select 1
;================================================= ========
;Setup sounds/animations
;================================================= ========
_sound *** *** = "canopySnd"
_canopyAnim= "CanopyAnim"
;================================================= ========
;Process
;================================================= ========
_sldr_present = crew _obj
_Pilot *** *** *** ***= _sldr_present select 0
?(_canopyAnim!="" and _obj animationPhase _canopyAnim > 0.5 and _status):goto "Exit"
?(_sound!=""):_obj say _sound
?(_status):goto "openCanopy"
?(_canopyAnim!=""):_obj animate [_canopyAnim,0]
_obj lock true
exit
#openCanopy
?(_canopyAnim!=""):_obj animate [_canopyAnim,1]
_obj lock false
#Exit
exit
[/QUOTE]
You cant possibly know until you start the plane out flying with the debug messages on. ***
Please dont make up comments about my code if you dont bother looking at it. ***The only global variable you will see in my wing, gear, and canopy scripts is the one that turns on "DEBUG MESSAGES" ('agvdebugCustomAddon=true').
I just think its important that the OFP community knows the truth. ***I dont have to send nasty messages to tell you that; I am an adult and I have no problem debating this with you. ***This was all done four months ago; Its been working fine for all that time. ***I have a home network too; its been tested Local, Hosted, and Dedicate with clients connected. ***Its not a problem. ***Peace.
Your init line is running from the server ,and checking for a player in the plane and running animations from there.Animations ran from server will run global.
Your messagemgrsqs is whats being called and from there an init.sqs
;================================================= ========
;Initialize Global Variables
;================================================= ========
?(_doInit):[_obj, _wingctrl] exec _init
and your canopycntrl.sqs is also called from there among some other things (your sonic boom)
I have looked at your scripts and I have tried the plane flying and only checked for a bit ,because I saw that it exhibited the same problem as mine and there is no fix there.
We all know that animations execute global, we all know that once you enter a vehicle its local,so by starting the game with a soldier in it that plane is local , that doesn't help the remaining vehicles that are empty .
I showed whats up,even a pic and you still don't believe me.
You think something is wrong with my machines or something.
And you still think getin executes when you start the game with a player in it.
You claim your the mp guru, so explain to Jacobbaby how you claim you are running your scripts globally? Because he is the one started this topic and was asking for an answer.Your not using the fuel event for a vehicle and this would be of interest to him.
Thing is...your not running the scripts globally,otherwise those hidden selections would get drawn on the machines that are empty on the clients.
There is nothing wrong with your plane,it has the same problem we all do and anyone that has hidden selections on their soldier or vehicle and needs to texture them at startup.
And your not helping here at all
Pennywise
Jun 20 2003, 14:19
Quote[/b] ]
and your canopycntrl.sqs is also called from there among some other things (your sonic boom)
The sonic boom gets called from the getin event because the scripts run globally. ***The command 'say' is not a globally executed command. ***If you start the plane out flying, you wil hear the sonic boom and thats enough proof as it is. There is nothing wrong with the F18 or its hidden selections. ***They display fine. ***Maybe there is something wrong with your test. ***I have no clue what your doing with it. ***I have already proven that with multiple screenshots including debugging installed. ***None of the things your saying are consistant with what other players say that actually use the addon. *** The fuel event is a useable alternative to getting scripts to execute globally. ***COCServer is a fine working example of this. ***Anyways, Im done with this thread.
If your start the plane out flying...its local to you,geez.I didn't wanna sit here and explain the basics of eventhandlers and global to you.Please tell the Bas team how you are running scripts globally then genius.Apparantly your F18 is so advanced they can't see how you are doing it (cause your not!!!!!)
Anyone that plays with eventhandlers and sees that getin doesnt execute when you are already in and will understand your just been talking crap.
Why didn't you just try what I said? Take all your other eventhandlers out and use just the getin and start your plane out flying and you will see that I have been 100% correct in what I have been telling you.This is not something I tested months ago.This is something I been testing now.
I am done with this thread too, you ruined it.Just wasting peoples time is all.
On another note I have had some success activating my gear event : _plane action ["Gear Land",_plane]
Possiblility to make local players activate scripts on their end (without them doing it or their knowledge).
But I am encountering lockups running my manager scripts from the gear event and hasn't been tested multiplayer.But thats where I am at.There is hope
Actually its more like this:
player action ["Land Gear", _plane]
get what I mean?
Make me laugh harder bratty. Mine works, your is broke. Use the code! Stop making excuses for your inability to code properly.
soldier1 setFuel 1 LMAO!
And in my opinion BAS is not the do all be all gods of scripting, they are good but Rasta at DKM is much more advanced in my opinion. There are alot better scripters out there then those working on BAS addons.
??
NOBODY has the solution for this !!
You need a ban after calling me bugger picker and such,you are doing nothing in this topic but slamming people.
I would give some input on your plane on some of the other things wrong,but you don't take critisism well.
I have my own stuff to worry about and I hope to release it bug free.
Or I could just sit here like you and claim its perfect
??
NOBODY has the solution for this !!
We gave you the solution. There are actually a few addons out there bratty that run scripts global. You just being to bigheaded to look at the way its done, or maybe you just cant figure it out.
Quote[/b] ]You need a ban after calling me bugger picker and such,you are doing nothing in this topic but slamming people.
Who am I slamming? I called you a bugger eating moron. Your not people, your a person. I tried being nice untill you started trying to make crap ass comments about some bug that still to date only YOU have noticed on your setup.
Quote[/b] ]
I would give some input on your plane on some of the other things wrong,but you don't take critisism well.
I have my own stuff to worry about and I hope to release it bug free.
Or I could just sit here like you and claim its perfect
LMAO who said it was perfect, I said your talking crap about it not running everything its supposed local in MP. I know it has problems. Why do you think were releasing a v1.2? You need to grow up and learn to accept help when its offered to you bratty, your name says it all. You get a bighead thinking you know it all when if fact your running around these forums still trying to learn O2 an BASIC cpp/code skills. Th
We gave you the solution. There are actually a few addons out there bratty that run scripts global. You just being to bigheaded to look at the way its done, or maybe you just cant figure it out.
LOL you don't have the solution and your plane has the same problem. OMG grow up.
I thought we were done here bratty? PM arnt good enuf? need to waste more harddrive space? Still waitng for you to show me your so called bug in MP.
Instead of having a huge fight... Bratty, why don't you simply make a step by step description on how to test the F18 for the bug you mention. The shortest possible test, but fully described. http://forums.bistudio.com/oldsmileys/rock.gif You people wouldn't be fighting if you went about this in a slightly more "scientific" manner. (not trying to sound like a snob, but it's true)
That wont work, he cant even show me in MP game. How can I trust his test if he wont even show me myself? You know you could just end this right now by downloading the F18 trying it with a friend in MP on local or dedicated server. use the agvdebugcustomaddon=true in an init and watch all the scripts run local on your machine. Then if thats not good enuf dePbo it and look at the scripting, its all commented for easy reading. It works. Its worked for 4 months and now all the sudden bratty seems to have a bug that only runs on his system for some strange reason.
The way I checked your plane is the same way I check mine.I made quick mission that starts with 5 empty planes and 2 soldiers not in any vehicle.
Now when you look at the planes from the server ,everything is fine (init eventhandler)
But from the clients side ,none of the planes has their hidden selections drawn because no script has ran yet,now when the client gets in ***a plane,the script runs and everythings ok on that plane (but like the pic, I showed you other planes don"t)
Step by step? Like this from messages ago.That is how I checked for the problem
SelectThis
Jun 22 2003, 17:12
Quote[/b] ]And in my opinion BAS is not the do all be all gods of scripting, they are good but Rasta at DKM is much more advanced in my opinion. There are alot better scripters out there then those working on BAS addons.
Hudson...I don't think anyone from BAS has ever said they are the best.. in fact this topic is started by a BAS scripter looking for help...why the attitude?
SelectThis
You became the best by doing your best.I don't compare people like that and it doesn't matter to me as each has their own unique skills,mine are mostly mechanical and I do have a good understanding on how things work.Dont let it get to you STT that statemant came from a pesron that doesnt even know how to do landing gear.
My current status of this running a client script problem:
I am getting very discouraged at some of OFPs limitations...Appears the mission maker has most control in a mp game and the only way I can see so far is using a trigger.I may have to include a trigger that a mp mission maker would have to insert.
Could also initilizing all the planes for a client when at least one gets used by them,but that wouldnt help the visuals for the enemy
I also notice useractions are NOT global,animations are but the scripts aren't.
Getting very discouraged.......!!
K I have SUCCESS!! I didn't use a trigger and the best way I have is by calling my manager script from the init line (only needed for mp)
Unless someone has a better solution? If the "init" eventhandler were called from every computer I wouldnt have to even do the init line.
But anyways, it all tests out good now ,just tweaking stuff and plane will be done soon.I have days into this and ended up doing an init line which is not really want I wanted.But I am happy with the results
whisperFFW06
Jul 4 2003, 14:28
Hmmm...
Little question to experts, to continue on Bratty's init line idea : would an init line from a "createdUnit" be called on every computer? Like : in the init EH of your addon vehicle, call createUnit on anything, like for example SoldierWB, adding to the init line :
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierWB" createUnit [[0,0,0], group _veh, {[] exec "myScriptExecutedEverywhere.sqs", MYTAGDummy=this}]; deleteVehicle MYTAGDummy[/QUOTE]
Where _veh is the _this select 0 from init EH.
Whis'
Yes I think when I was playing around with this init stuff around 7 months ago, the init for createUnit did execute everywhere. It is part of the implementation in CoC's EnemyStack.
Tactician
Jul 4 2003, 19:48
The only thing keeping you from using createUnit to disperse public init events on vehicles is the need for an existing group name. You can camCreate and createVehicle game logics all day long, but none will return a group name. Can't be done without mission editor intervention. Boo. They were just teasing us when they made init EHs private.
However, this is a decent way to make arrays and strings public on a mission-by-mission basis.
Yes you can create new groups http://forums.bistudio.com/oldsmileys/smile_o.gif createUnit then let it join itself or grpNull, it will the return a brand new group (if you did this to the last one in list).
Anyway, I think BIS will be working on group limitations a little.
Tactician
Jul 4 2003, 19:54
Can you create groups without an known existing group name, though? If you were using createUnit from a plane's init field, for example. If so, why aren't we using createUnit as the universal answer to public init EH?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.