Home   Help Search Login Register  

Author Topic: Help with a script.  (Read 1092 times)

0 Members and 1 Guest are viewing this topic.

Sogekihei

  • Guest
Help with a script.
« on: 28 Nov 2003, 20:29:18 »
I need a little help making a script for a mission I'm working on.  It's kind of a Sci-Fi mission and I don't have a clue how to do this on my own.  I need an init.sqs file that'll add a few options to my mission.  Here's what I'm after:

Add option to Action Menu for "Activate/Deactivate Shields" (invincibility for player or vehicle player is in)

Add option to for use while in map for "Teleportation" (left shift+left mouse click on map warps selected unit(s) to that location, select unit from drop down menu)

Add option to Action Menu for "Tracker Unit" (displays the selected unit's position on the map, select unit from drop down menu)

If anyone can help make this script I'll be sure to include your name in the Briefing & Overview.

m21man

  • Guest
Re:Help with a script.
« Reply #1 on: 28 Nov 2003, 20:59:33 »
For the Unit Tracker, which units do you want to track?

Sogekihei

  • Guest
Re:Help with a script.
« Reply #2 on: 28 Nov 2003, 21:07:27 »
Which information do you need?  The names of all the units?

WestAlphaLeader
WestBravoLeader
WestCharlieLeader
WestDeltaLeader
WestEchoLeader
WestFoxtrotLeader
WestCommander

&

EastAlphaLeader
EastBravoLeader
EastCharlieLeader
EastDeltaLeader
EastEchoLeader
EastFoxtrotLeader
EastCommander

I was wanting to select them from a menu and have them show up as a blinking blue dot on the map.  Having it update the position every 2 seconds.  Either that or something similar to the lojack from Toadlife's mission Operation Lojack, but with the unit showing up on the map as well.


Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Help with a script.
« Reply #3 on: 28 Nov 2003, 21:19:37 »
Quote
Which information do you need?

Everything you have to offer would help to help you here.

I mean:

Your first post looks like you need somebody to create
a whole MOD, honored by a mentioning in briefing and overview

 ::)

If somebody would solve all you asked for in post nr. 1, i would
suggest you name your OFP-mod after him  ;)

Now seriously:

What do you want to do, how do you want to get it to work,
how far are you, how much effort do you want to spend into
that, and so on, are you aware about:

arrays
dialogues
scripting
official com-ref
unofficial com-ref
radio-calls
addon creating
tutorials

e.g: how do you want to get the invincibility to work, once
you got the right answer for how to make the custom action

I could now list a few pages more, of all that stuff, required
for your sci-fi mission, but at the moment it's kinda worthless,
as i don't know how far you are?

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Sogekihei

  • Guest
Re:Help with a script.
« Reply #4 on: 28 Nov 2003, 22:14:25 »
I really just wanted to add those 3 options to an init.sqs file, what other files am I gonna need to make these 3 options work properly.  I'm trying to keep it as simple as possible.  Here's the basics of what I'm wanting.

Activate/Deactivate Shields
Want this option to show up in the Action Menu, when activated the player and/or the vehicle he is riding in is protected from damage by either having the game reset his health/armor to 100% or if he took damage over 100% resurecting him inplace immedietly.  I don't know how many ways to do this there are.  Whatever works to get that effect.

Teleportation
Want this option to show up in the Action Menu, when selected opens a little menu with all the East & West units I listed (West down the Left and East down the Right) and opens the map.  Either by left shift+left mouse clicking on the map or just left clicking on the map moves the selected unit to that location.

Tracking Unit ON/OFF
Want this option to show up in the Action Menu, when activated opens a little menu just like the one listed for the Teleportation.  When a unit from that list is selected his position is displayed on the map by a flashing blue dot updating his position every 2 seconds.

I know this is a lot to work on, the tracking unit will probably be the easiest.  I been checking around for these sorts of scripts and havn't quite found what I'm looking for yet.  If someone creates a script for this I'll be sure to give him credit for it.  Thanks for any help you can offer.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Help with a script.
« Reply #5 on: 28 Nov 2003, 23:30:18 »
Learn about the following commands from the official and unofficial command references.    If you haven't already, read snYpir's Friendly Intro to Code Snippets and Johan Gustafsson's Scripting tutorial.

Start with:-

addAction
removeAction

Shields part

getDammage
setDammage

You should also learn about eventHandlers, particularly eventHandler "hit".  Search the forums for more on invincibility scripts, which is what you're talking about here.  There is no way to create a "shield" directly.


Teleporting

getPos
setPos
onMapSingleClick

Also learn about different array formats from the official command ref.

To show a clear list of all units you're probably going to have to learn about dialogues.


Tracking

setMarkerType and other setMarker commands


That is not a comprehensive list, but it's a start.    

And, as Chris Death, said, the more you tell us about what you know, the easier it is for us to help you.

Plenty of reviewed ArmA missions for you to play