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
Quote[/b] ]Perhaps some modmaker could give a suggestion.

I could make a few suggestions too... nener.gif

Share this post


Link to post
Share on other sites

I need som help here too

color - this parameter (a string) sets the color of the tracer. the color values are: "white", "red", "yellow", "green" and "side". "side" is a special value that will set default colors of the tracers depending of the side of the unit(s) that runs the script. default is "side"

How can i change the colour of the tracer?[/b]

Share this post


Link to post
Share on other sites

Try this: [player,,,,"red",,,] exec "\wbe_tracerfx\wbe_tracerfx.sqs"

My memory is a little rusty here, but if you use it this way the script should continue to use default values for everything that is not explicitly defined in the brackets.

Share this post


Link to post
Share on other sites

here is the code

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[ap1,1,1,1,"white",2,0.2,4]exec "\wbe_tracerfx\wbe_tracerfx.sqs"

where it says white you can change it to the other colours red yellow green etc. ap1 is my soldiers name ,yours maybe called different

Share this post


Link to post
Share on other sites

Thanks guys i really learned alot today.

notworthy.gif

Share this post


Link to post
Share on other sites
here is the code

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[ap1,1,1,1,"white",2,0.2,4]exec "\wbe_tracerfx\wbe_tracerfx.sqs"

where it says white you can change it to the other colours red yellow green etc. ap1 is my soldiers name ,yours maybe called different

Doesnt work confused_o.gif .

Share this post


Link to post
Share on other sites

Ok i did it yay.gifpistols.gif .

Im starting to learn here hehehe smile_o.giftounge2.gif .

Share this post


Link to post
Share on other sites

pls can you report what was wrong ?.

did you try them without changing ap1 ? or you used dring day when they wont work lol ?

Share this post


Link to post
Share on other sites
pls can you report what was wrong ?.

did you try them without changing ap1 ? or you used dring day when they wont work lol ?

Yes ofcourse i can tell you:

You said:

[ap1,1,1,1,"white",2,0.2,4]exec "\wbe_tracerfx\wbe_tracerfx.sqs"

Actually nothing was wrong i just changed playername to my own.

You got it right wink_o.gif .

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  

×