OnlineKenji
Member-
Content Count
10 -
Joined
-
Last visited
Never -
Medals
Everything posted by OnlineKenji
-
I set up a Debriefing:End1, 2, and 3 in my briefing.html. And I have a trigger in my mission that goes off when a specific person dies. The trigger is set as type End#3 I hear the music, see the text, etc. I know it's triggering. But, the mission does not end... it just keeps going... is there something else I have to do in order to make the mission actually end? I'm sure this is a topic somewhere but I couldn't find it using the search.
-
Why don't end# triggers work?
OnlineKenji replied to OnlineKenji's topic in OFP : MISSION EDITING & SCRIPTING
Thanks Muj. However, I found out that if you have 2 or more triggers that are type End# and they are the same end number, then you would HAVE to make sure ALL of those trigger's conditions are true before it will end the mission. This was my problem I had 3 triggers with different conditions that got the same ending. A work around you can use is simply make more endings and make sure that each End# is only called from one trigger. Or, you can make just ONE End# trigger for each ending, and a global variable in init.sqs. Like for instance a global variable called bEnd2. Set it equal to false in init.sqs. Then you can make it the condition of your tEnd2 trigger. Setting bEnd2 = true from any other trigger or script will make the mission end properly. -
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE"> desantnik: ... heres the code I am running this dotarget man, this setcombatmode "blue" <span id='postcolor'> dude, I think you seperate your commands with a semicolon ';' not a comma ',' as in your example. This will help that code of yours work Now, I don't understand why no one on this thread, or in the forum (I searched), has yet to ask, 'How do these new scripting functions work?' I saw this on the old dead thread, but unfortunetely no answer. There is no updated command reference. And, it takes a lot of time to trial and error through new functions, especially when you have no clue as to their context, parameters, or proper syntax. A brief explanation of the following functions and their use would be greatly appreciated. I hope the the only reason I haven't seen this question is because EVERYONE else but my dumb ass instinctively knows how to use these new functions and commands. If this is so please tell me anyway and I apologize for asking a foolish question . Thank you. 1.82 Â - New: Scripting: Functions loadFile and preprocessFile added. 1.82 Â - New: Addons and scripting: Customizable event handlers for events: Killed, Hit, Dammaged, GetIn, GetOut, Init, Engine, Gear, Fuel, Fired, IncomingMissile. 1.82 Â - New: Scripting: New functions addEventHandler, removeEventHandler, removeAllEventHandlers. 1.82 Â - New: Scripting: Function "private" introduces local variable in the innermost scope. 1.82 Â - New: Scripting: Brackets { and } can be used to enclose string constants. 1.80 Â - Added: functions missionName, missionStart, playersNumber I mean I can guess at some of these. Like maybe the preprocessFile works like the #include statement in c/c++ and maybe the add and remove event handlers...I'm thinking they might work like the message mapping in c/c++ but the error messages don't guide me in the right direction they just say expected something...or unknown operator... any help would be appreciated.
-
I must be doing something wrong...what is it? My code simply will NOT work properly. Please look at my script and comment. Thank you. Legend: InsertionChopper - the name of a West Chopper placed with the editor. server - a gamelogic placed with the editor. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> enableRadio false titleText["Petrovice....", "Black In", 7] ;CREATE THE CAMERA playMusic "7thIAmGonaFly" _camera = "camera" CamCreate [4092.81,5112.39,13.34] _camera CameraEffect ["Internal","Back"] _camera camCommit 0 @camCommitted _camera HostStartsIntro = false PublicVariable "HostStartsIntro" usedPlayers = (crew InsertionChopper); PublicVariable "usedPlayers"; ?!(local server) : goto "WaitForHost" ?(local server) : titleText["Welcome Host. Map by Kenji.", "plain", 1] _unusedPlayers = (crew InsertionChopper) "_x MoveInCargo InsertionChopper" forEach [a1,a2,a3,a4,a5,a6,a7,a8] usedPlayers = (crew InsertionChopper) - _unusedPlayers; PublicVariable "usedPlayers" _LeadGuy = (usedPlayers select 0) usedPlayers Join _leadGuy; publicVariable "usedPlayers" HostStartsIntro=true; publicVariable "HostStartsIntro"; #WaitForHost ?!(local server) : titleText["Welcome client. Map by Kenji", "plain", 1] @HostStartsIntro #IntroStart _ct = _ct + 1 ...Skipped a Crap Load of camera shots ; Tell The Insertion Chopper to Move to the landing Zone InsertionChopper flyinheight 100 InsertionChopper setPos [(getPos InsertionChopper select 0), (getPos InsertionChopper select 1), 100] InsertionChopper doMove [(getPos lzInsertion select 0), (getPos lzInsertion select 1)] InsertionChopper SetSpeedMode "NORMAL" ....Skipped Another Crap load of camera shots. No references to my player or Ai objects were made just cam scripting. All my cam commands ends with @camCommit _camera. I did them with Camera.sqs. ; EJECT EACH PLAYER ONE BY ONE enableRadio false HostFinishedEject=false; publicVariable "HostFinishedEject" ?!(local server) : goto "WaitForHostFinishedEject" _i=0 _j = count usedPlayers _LeadGuy = (usedPlayers select 0) #EjectLoop _ThisUnit = (usedPlayers select _i) unassignVehicle _ThisUnit _ThisUnit Action ["eject", vehicle InsertionChopper] _i=_i+1 @(_ThisUnit distance InsertionChopper) > 40 ?_j > _i : goto "EjectLoop" HostFinishedEject=true; publicVariable "HostFinishedEject" #WaitForHostFinishedEject @HostFinishedEject enableRadio true ; Destroy the camera _camera cameraEffect ["terminate", "back"] camDestroy _camera ; Start the timer [] Exec "TimeLimit.sqs" ; SEND THE CHOPPER TO THE WAITING POINT InsertionChopper doMove getPos ChopperWaitingPosition Exit <span id='postcolor'> It gets to the part where it's supposed to eject the guys, but it doesn't. I had a titleText that displayed the count of the usedPlayers array, but my clients always saw either 0 or scalar. I don't know what I'm doing wrong. Give me a shout if you can. Thank you.
-
Hmm...what am i doing wrong?
OnlineKenji replied to OnlineKenji's topic in OFP : MISSION EDITING & SCRIPTING
Thanks a lot bn88 . I will be able to experiment a little, now that I have a much more narrow range to experiment in. Thanks. -
Hmm...what am i doing wrong?
OnlineKenji replied to OnlineKenji's topic in OFP : MISSION EDITING & SCRIPTING
Oh.... hmm..I don't have a group reference. In the editor I have the team as one group, so that when you're choosing your role it apears as one team. Then in init.sqs I split them up, so that each person can choose their own loadout. Then I put them back together in the intro. I did not know that it couldn't pass arrays....the comref is very vague on it. - Do you have an example where you use it more than in that RadioOn.sqs RadioOff.sqs example that I saw in the threads. - Did you have to put it off in a seperate .sqs or is that just your style? - Can i enumerate a "Group" like i can an array? - Can I manipulate global objects from just the host machine? Like '?(local server) : "_x AddWeapon ""HK""" forEach <Public Group>' I know i'm asking a lot, but I couldn't find this information anywhere. I just ask for a little patience with me . Thanks. -
Online probs with triggers help plz!
OnlineKenji replied to Impavido's topic in OFP : MISSION EDITING & SCRIPTING
I must be doing something wrong...what is it? My code simply will NOT work properly. Please look at my script and comment. Thank you. Legend: InsertionChopper - the name of a West Chopper placed with the editor. server - a gamelogic placed with the editor. Script Below: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> enableRadio false titleText["Petrovice....", "Black In", 7] ;CREATE THE CAMERA playMusic "7thIAmGonaFly" _camera = "camera" CamCreate [4092.81,5112.39,13.34] _camera CameraEffect ["Internal","Back"] _camera camCommit 0 @camCommitted _camera HostStartsIntro = false PublicVariable "HostStartsIntro" usedPlayers = (crew InsertionChopper); PublicVariable "usedPlayers"; ?!(local server) : goto "WaitForHost" ?(local server) : titleText["Welcome Host. Map by Kenji.", "plain", 1] _unusedPlayers = (crew InsertionChopper) "_x MoveInCargo InsertionChopper" forEach [a1,a2,a3,a4,a5,a6,a7,a8] usedPlayers = (crew InsertionChopper) - _unusedPlayers; PublicVariable "usedPlayers" _LeadGuy = (usedPlayers select 0) usedPlayers Join _leadGuy; publicVariable "usedPlayers" HostStartsIntro=true; publicVariable "HostStartsIntro"; #WaitForHost ?!(local server) : titleText["Welcome client. Map by Kenji", "plain", 1] @HostStartsIntro #IntroStart _ct = _ct + 1 ...Skipped a Crap Load of camera shots ; Tell The Insertion Chopper to Move to the landing Zone InsertionChopper flyinheight 100 InsertionChopper setPos [(getPos InsertionChopper select 0), (getPos InsertionChopper select 1), 100] InsertionChopper doMove [(getPos lzInsertion select 0), (getPos lzInsertion select 1)] InsertionChopper SetSpeedMode "NORMAL" ....Skipped Another Crap load of camera shots. No references to my player or Ai objects were made just cam scripting. All my cam commands ends with @camCommit _camera. I did them with Camera.sqs. ; EJECT EACH PLAYER ONE BY ONE enableRadio false HostFinishedEject=false; publicVariable "HostFinishedEject" ?!(local server) : goto "WaitForHostFinishedEject" _i=0 _j = count usedPlayers _LeadGuy = (usedPlayers select 0) #EjectLoop _ThisUnit = (usedPlayers select _i) unassignVehicle _ThisUnit _ThisUnit Action ["eject", vehicle InsertionChopper] _i=_i+1 @(_ThisUnit distance InsertionChopper) > 40 ?_j > _i : goto "EjectLoop" Â Â Â Â Â Â HostFinishedEject=true; publicVariable "HostFinishedEject" #WaitForHostFinishedEject @HostFinishedEject enableRadio true ; Destroy the camera _camera cameraEffect ["terminate", "back"] camDestroy _camera ; Start the timer [] Exec "TimeLimit.sqs" ; SEND THE CHOPPER TO THE WAITING POINT InsertionChopper doMove getPos ChopperWaitingPosition Exit <span id='postcolor'> It gets to the part where it's supposed to eject the guys, but it doesn't. I had a titleText that displayed the count of the usedPlayers array, but my clients always saw either 0 or scalar. I don't know what I'm doing wrong. Give me a shout if you can. Thank you. -
First off, I did search, and I did not find anything. I need a way to determine if a "Playable" character is AI, Human, or disabled. I am making a mission, and in the mission the guys are ejected from a chopper. Now this is easily accomplished by "eject" ing them one at a time, but some times they blow up, it's the weirdest thing, people actually explode... Anyway, I did set the sleep to like 5 seconds, but this makes my intro too long, I'm trying to set it for when the ejected player is 35m away from the chopper, this is a safe distance. Another problem with the sleep is that in MP it works wrong, sometimes it ejects them like 1 second after the other. I think this has something to do with latency, and different times on client machines and whatnot, but I don't know enough about that to do anything. All I know is the sleep doesn't work all the time. So in conclusion, if you know a way to detect if the AI is disabled it would be a help, because my mission gets stuck when it waits for the distance of a non existent Ai to be above 35m. A way to detect NULL in general would be great. Thank you.
-
Does isnull ever work?
OnlineKenji replied to OnlineKenji's topic in OFP : MISSION EDITING & SCRIPTING
F'in A! I actualy never had to define both of them, I just captured them before I placed my team in them. Like this: ;script in Intro _unusedPlayers = _unusedPlayers + (crew InsertionChopper) "_x MoveInCargo InsertionChopper" forEach [a1,a2,...] usedPlayers = (crew InsertionChopper) - _unusedPlayers now my "usedPlayers" variable is a valid array of all the valid players. :-) thank you very much for the steer in the right direction whisperFFW06, and thank you Azz for the tips as well. Thanks guys Keywords: DisabledAI, Alive, IsNull -
Does isnull ever work?
OnlineKenji replied to OnlineKenji's topic in OFP : MISSION EDITING & SCRIPTING
whisperFFW06, That is a damn good Idea. It should work, but then I'll have to go through the exercise of naming the chopper pilot, and MG. Then wouldn't I have to start them seperately from the chopper? And, if I did that, wouldn't that mean that I couldn't start my chopper in the air flying? And, that would lead to problems where the chopper isn't in the right position when the camera shifts to it, and so on. Maybe I'm wrong, but I might give myself new problems doing it that way. And, Azz, how? how do I make it only execute on the host? That would solve a lot of problems and not just this one. However, I wonder, wouldn't that make the client computers think they're still in the chopper? This would be great if the "Alive" function worked.... I guess I'll have to set up another array of booleans and then use them both to determine who is used and who is unused. *sigh* I'll still look at the thread for the next few days for another idea. Please feel free to let me know.