Home   Help Search Login Register  

Author Topic: addAction - Use of Parameters - Solved!  (Read 1497 times)

0 Members and 1 Guest are viewing this topic.

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
addAction - Use of Parameters - Solved!
« on: 11 Jun 2008, 15:19:46 »
Hi!

This is probably a noob question but it has been years since I even touched this.

I am trying to implement a script in my mission. It a script called "mando_laser". When i run the intro of this script i get this text from the "action menu" on the middle of the screen. Example: If my action is: "Activate launcher" the text comes up in the middle of my screen. When I have selected and used "Activate launcher" it change to "Deactivate launcher". The thing is I do not want this to happen. I want the action menu to work but i dont want this text in the middle of the screen. So I have been told using the parameter "showWindow" in the addAction for this "Activate launcher" would help if i set it to be false.



I wanna use the showWindow parameter in "addAction".
unit addAction [action, script filename, (arguments, priority, showWindow, hideOnUse, shortcut)]

This is the line I want to have the showWindow parameter in. And I want it to be false.
player addAction ["Activate launcher", "activatelauncher.sqf", [true]];


I made this work and the text was gone by using this below but it gave me and error when i actually used the action "Activate launcher" in the actionmenu.
player addAction ["Activate launcher", "activatelauncher.sqf",0,0,false];

If I used it gave me an error when testing it.
player addAction ["Activate launcher", "activatelauncher.sqf",0,0,false[true]];

I think something in "activatelauncher.sqf" needs that [true] in the addAction.

The information on this topic was rather wage in Ofpec Comref. So I am turning towards all you scripters out there.

Thanks in advance.

Gomer,
« Last Edit: 11 Jun 2008, 20:41:21 by GomerPyle »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: addAction - Use of Parameters
« Reply #1 on: 11 Jun 2008, 20:07:40 »
Try
Code: [Select]
player addAction ["Activate launcher", "activatelauncher.sqf", [], 1, false];

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: addAction - Use of Parameters
« Reply #2 on: 11 Jun 2008, 20:20:39 »
the text disappeared. But then the the [true] in the end sending information to activatelauncher.sqf isnt sending the true it is waiting for. So the result is that it will not activate the launcher. Also the action's for activating and deactivating disappears from the menu.

player addAction ["Activate launcher", "activatelauncher.sqf", [true]];

[true] is needed and so I need a way to still send that [true].
« Last Edit: 11 Jun 2008, 20:34:07 by GomerPyle »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: addAction - Use of Parameters
« Reply #3 on: 11 Jun 2008, 20:35:11 »
Code: [Select]
player addAction ["Activate launcher", "activatelauncher.sqf", [true], 1, false];

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: addAction - Use of Parameters
« Reply #4 on: 11 Jun 2008, 20:40:36 »
Brilliant! That worked.. Thank you!

Is it possible to have the missiles to come from higher up? They seem to come from near the ground.
« Last Edit: 11 Jun 2008, 20:45:15 by GomerPyle »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: addAction - Use of Parameters - Solved!
« Reply #5 on: 11 Jun 2008, 21:00:19 »
It is because they are launched behind a hill nearby by a Shilka, you may modify missile parameters to create a higher arc, but then minimum effective range would be increased.

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Re: addAction - Use of Parameters - Solved!
« Reply #6 on: 11 Jun 2008, 21:48:00 »
in what file do i find these? so many files it is hard to figure out.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: addAction - Use of Parameters - Solved!
« Reply #7 on: 11 Jun 2008, 21:58:53 »
mando_missiles\units\attackers\mando_javelin.sqs
Try changing
_vangle           = 60.0
_cruisealt        = 150
_activerange    = 400

You may also copy mando_javelin.sqs to gomer_javelin.sqs, place that script just inside your mission folder, change there the parameters you want at will and in init.sqf change
blah blah blah exec"mando_missiles\units\attackers\mando_javelin.sqs";
by
blah blah blah exec "gomer_javelin.sqs";