Jump to content
Sign in to follow this  
OIK

How can i edit init

Recommended Posts

Hi

Im just wondering how i can edit scripts or inits so i can make weapons work.

Im sure its something simple but first time is always hard to understand.

I give an example of the thing i would like to have help with

Usage

The simplest way to run this script is to put this line in the init field of the unit you want to fire tracers:

[unitname]exec "\wbe_tracerfx\wbe_tracerfx.sqs"

That line will run the script with the default settings.

Since all the parameters but the first one of the script have default values you don´t need to provide them all for the script to run. However if you just need to alter say the last parameter you have to provide the other parameters too.

Heres the syntax for the script with all the parameters provided:

[unitname,tracers,ricochet,glow,color,rounds,size,speedmod]exec "\wbe_tracerfx\wbe_tracerfx.sqs"

unitname - this is the name of the unit that the script will run on band.gif

Share this post


Link to post
Share on other sites

First, this belongs in Mission Editing.

To run the script in question, first make sure that your map editor is set to "Advanced" mode. Then, press F1 and double-click on the map to bring up the unit field. Find the Initialization box (A large, empty box in the middle of the box) and paste in the following: [player] exec "\wbe_tracerfx\wbe_tracerfx.sqs". Press OK and preview the mission, the script should now be running.

Edit: Here's a pic of the unit editor. The field marked "Iniciacion" is the initialization field.

Edit2: Another thing. The way that a OFP script works is that the script's array (Whatever is in the set of brackets before the exec command) is passed on to the script. For example, your script example requires a named unit ( [unitname] ). Therefore, if you've named a unit, you can type that name in instead of the generic "player" (In SP, your character is automatically named "player"). If you do this, the script will be carried out with that named unit as subject. By the way, to name a unit, you give it a short, specific name like "helo1" or "abrams3" and type that name into the field in the unit editor marked "name".

Edit3: To edit a script and change how it functions, you simply open the script in Notepad or Wordpad and change it as desired. You should be able to find tutorials on this at OFPEC.

Share this post


Link to post
Share on other sites

Thanks mate i will take look at it at once. smile_o.gif

Share this post


Link to post
Share on other sites

I don't think that he's making a mission but trying to "install" the script so that it would automaticly add the tracers for all missions and units without editing them. Of course this is not what script is made for but I'm quite certain that it's possible. Perhaps some modmaker could give a suggestion.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×