Home   Help Search Login Register  

Author Topic: Multiple scripts from fired EH-in addon config  (Read 1706 times)

0 Members and 1 Guest are viewing this topic.

rOk

  • Guest
Multiple scripts from fired EH-in addon config
« on: 03 Aug 2004, 11:21:21 »
This isn't working-why?

fired = "[_this select 0,_this select 1] exec ""\addon\Scripts\xxx.sqs"""; "_this exec ""\addon\Scripts\xxx.sqs""";

OFP doesn't start, it coughs up this
Code: [Select]
" encountered instead of =
Any ideas?
Thanks

DBR_ONIX

  • Guest
Re:Multiple scripts from fired EH-in addon config
« Reply #1 on: 03 Aug 2004, 11:47:27 »
Why not call a script, then run the code form that?
Dunno, there it the right ammount of "s in that code..
It could be something to do with the stuff after the ;...?

Not sure
- Ben

rOk

  • Guest
Re:Multiple scripts from fired EH-in addon config
« Reply #2 on: 03 Aug 2004, 12:10:13 »
You mean like integrating the second script into the first one, right?

Will see what I can cook up.  :)


#edit:
Or just "this exec xxx2.sqs" written at the bottom of the first one?

or how about this one
if xxx1.sqs is executed then exec xxx2.sqs

but syntax is needed i'm a nOOb  :-[

#edit2:

Well got it to "work", error wise at least, although I must have missed something in O2=>it's a gun recoil script, but sadly there's no recoil.

 
« Last Edit: 03 Aug 2004, 12:41:22 by rOk »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Multiple scripts from fired EH-in addon config
« Reply #3 on: 03 Aug 2004, 19:22:37 »
This isn't working-why?

fired = "[_this select 0,_this select 1] exec ""\addon\Scripts\xxx.sqs"""; "_this exec ""\addon\Scripts\xxx.sqs""";

OFP doesn't start, it coughs up this
Code: [Select]
" encountered instead of =
Any ideas?
Thanks
fired = "[_this select 0,_this select 1] exec ""\addon\Scripts\xxx.sqs""; _this exec ""\addon\Scripts\xxx.sqs""";

Quote
Why not call a script, then run the code form that?
When the fired EH is in question it is much more reliable and faster to pass all the needed variables/arguments/whatever straight from the EH rather than a separate script...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

DBR_ONIX

  • Guest
Re:Multiple scripts from fired EH-in addon config
« Reply #4 on: 03 Aug 2004, 21:22:20 »
Okay
Ah, I see what was wrong with the code now ;)
The " at the beggining
_ ben

Maximus-Sniper

  • Guest
Re:Multiple scripts from fired EH-in addon config
« Reply #5 on: 05 Aug 2004, 00:27:38 »
Hei rOk!

Hope maybe this help, its another metode :

Why dont you make a loadfile (scriptload.sqf or somthing.sqf)
In that script you but this two line:

_this call loadFile "\addon\xxx1.sqsf";
_this call loadFile "\addon\xxx2.sqs"


than you put this line in your config.cpp:


class EventHandlers
            {
         Â Â Â fired = "[_this select 0,_this select 1] exec ""\addon\scriptload.sqf""};
      };


Something like that, i'am not so good in that EventHandlers,
but you can make something to call on one script, then the script start 2 other script.
I use that in my script, but its for some FX smoke, so my code looks like this:

class EventHandlers
            {
            fired = "if ((_this select 4) == ""something here, like weapon, mag, ammo"") then {_this call loadFile ""\addon\smoke.sqf""};";
      };

I hope this help :)
« Last Edit: 05 Aug 2004, 00:31:56 by Maximus-Sniper »

rOk

  • Guest
Re:Multiple scripts from fired EH-in addon config
« Reply #6 on: 05 Aug 2004, 07:58:10 »
Hi all

Thanks for all your help i got it working and now i have tank main gun recoil coupled with a nice shock dust.

But please stay tuned, there's bound to be more problems down the way-namely i'll start working on my own anti-missile system which atm is looking to be a cross of dkm-comanche jammer and a script from some Chinese guys which actually destroys the missile and creates some drop effects with it.

Thanks again