Home   Help Search Login Register  

Author Topic: Addon actions  (Read 1463 times)

0 Members and 1 Guest are viewing this topic.

Offline Magnus Almqvist

  • Members
  • *
Addon actions
« on: 13 Feb 2007, 16:28:40 »
Hi I'm have pretty basic knowledge about the editor so nothing more

I am using the c130 v2 addon and it has a function that you can open the rear ramp, so my question is how do i get the pilot (AI) to open it have tried Planename action ["open ramp"] but it didnt work, have the same problem with another addon.

Any ideas?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Addon actions
« Reply #1 on: 13 Feb 2007, 17:58:16 »
It seems to be impossible to use the custom user actions (addon actions like you put it) with the action command..

The only way is to execute the script, that for example the user action "open ramp" executes, from another script (or trigger even)..
Usually the AddOn readme file has instructions for this..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Addon actions
« Reply #2 on: 13 Feb 2007, 23:31:33 »
You might have to depbo the addon to find the syntax.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Addon actions
« Reply #3 on: 25 Nov 2009, 22:39:07 »
I'm going to resurrect this thread since it pertains to my question. It involves the Mapfact Baracken addon v1.5. I have depboed the addon and discovered the commands used to animate the various doors, gates, etc. But my question has to do more with How to disable built in user actions.  I am trying to disable the user action for a fence section with a door to prevent the player from operating it without prior consent from a script.

Is this possible?

Walter_E_Kurtz

  • Guest
Re: Addon actions
« Reply #4 on: 27 Nov 2009, 12:58:14 »
I'm fairly certain not, because it's hard-coded to the conditions in the config.

One option would have been to deleteVehicle a locked gate and replace it with a setPos'd open-able version, but I don't think this is a runner in this case as the Baracken addon doesn't include both locked and open-able versions.

Consequently, I reckon you need a script to keep the door shut when the player tries to open it:

1. Name the door, I've gone for doord.

2. Create a trigger, Repeatable, named doorlock_trig
Condition: player distance doord < 10
On Activation: playernear = true; [] exec "doorlock.sqs"
On Deactivation: playernear = false

2b. For completeness' sake, add playernear = false to init.sqs

3. The door locking script
Code: (doorlock.sqs) [Select]
#loop
~0.1
? !playernear: exit
? (doord animationPhase "Component02") > 0: doord animate ["Component02", 0]; titletext ["Locked", "PLAIN"]

goto "loop"

4. Removing the lock: once the player has acquired the key, simply deleteVehicle doorlock_trig


Notes
   - The point of the doorlock_trig trigger is so that doorlock.sqs (which loops ten times a second) is only run when necessary
   - Because the player has been able to start the 'Open Door' action, the whole opening door sound will play. I suggest trying to have doord say a gate rattling sound to try and obscure it.
   - I uncovered Component02 as being the necessary animation by looking in the config. The principle should stand with other buildings and even other addons, as long as the necessary animation name can be determined.
   - I'm appending my test mission, in case anyone wants. NB. The Take Key action should ONLY be carried out away from the gate.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Addon actions
« Reply #5 on: 27 Nov 2009, 14:46:12 »
Splendid. Sounds like an excellent workaround. I'll give it a go today and see if it fits in well enough. Thanks for your obvious experimenting with this Walter. I appreciate your time very much.

UPDATE: Attempted it the way you explained with a few modifications. I ended up reducing the player distance to four meters as it seems the user action becomes visible at 3. I then increased the loop from .1 to .01 to reduce the amount of space the door actually opens before being reset. I then added my own soundfile and entry in the mission description which overwrites the addon sound. Since I am only using one gate in the mission, it works absolutely perfectly. Thanks tremendously for the help. Now....back to work on the mission. :good:
« Last Edit: 27 Nov 2009, 15:33:48 by savedbygrace »