Jump to content
Sign in to follow this  
Scud

Couple of ques ??

Recommended Posts

Ok days days on this and really getting cheesed off so its time to ask the forum again.

1st question

with my model plane when drop tanks are released the overall fuel cap is reduce - dah.

Lets say from 300 to 150

setting in cpp is fuelCapacity=300;

then in sqs file when tanks released I want to change that to

fuelCapacity=150; but I keep getting an err saying it doesn't recon fuelCapacity or _fuelCapacity or (fuelCapacity _vehicle)

any helpers?

2nd ques

Have made up a set of number.paa's 0-9

and want them at random on plane.

ie sqs

_number=(random 10)

?_number<=1: _plane setobjecttexture [17,"\scud_p38\1.paa"]

etc etc

I know the random numbers work coz I check with chat in game.

and I know the hidden selection works for same reason

but I put both together and get err unknown whatsimajig.

have tried _number1=(random 10)

?_number<=0: [_plane] setobjecttexture [17,"\scud_p38\1.paa"]

Any helpers again?

Share this post


Link to post
Share on other sites

Scud, the commands you want are:

fuel _object - Returns current fuel amount between 0 and 1

_object setfuel level - Sets the fuel level (between 0 and 1)

You can't change properties of the class (such as fuelCapacity

or maneuvarability) in sqs files. They are 'parameters' rather

than 'variables'. So when the drop tanks go:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(fuel _plane > 0.5): _plane setfuel 0.5

IIRC all vehicles use fuel at the same rate, so fuelCapacity

tells you how long the engine can be run between re-fuellings.

The random function returns a _real_ value (rather than an

integer) between 0 and N. So you want something like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_num = random 10

?(_num < 1) : setobjecttexture[17, "\quackquack\1.num"]

?(_num < 2) : setobjecttexture[17, "\quackquack\2.num"]

?(_num < 3) : setobjecttexture[17, "\quackquack\3.num"]

.

.

.

?(_num < 9) : setobjecttexture[17, "\quackquack\9.num"]

?(_num < 10) : setobjecttexture[17, "\quackquack\0.num"]

So, the selection will get re-textured until the number wanted

is reached.

(BTW Both of these things are done in my F-16 - you can take

that to bits and see how it works, if you like).

Share this post


Link to post
Share on other sites

Thanx Footmunch

I already have the set fuel working it is the "properties of the class (such as fuelCapacity)" that I wanted to alter but looks like I wont be doing that.

Quote[/b] ]Code Sample

_num = random 10

?(_num < 1) : setobjecttexture[17, "\quackquack\1.num"]

?(_num < 2) : setobjecttexture[17, "\quackquack\2.num"]

?(_num < 3) : setobjecttexture[17, "\quackquack\3.num"]

.

.

.

?(_num < 9) : setobjecttexture[17, "\quackquack\9.num"]

?(_num < 10) : setobjecttexture[17, "\quackquack\0.num"]

So, the selection will get re-textured until the number wanted

is reached.

(BTW Both of these things are done in my F-16 - you can take

that to bits and see how it works, if you like).

I will give this ago - dunno why I haven't tried before.

If it doesn't work I will check out your F16.

Thanx

Share this post


Link to post
Share on other sites

have a question on that, if i got this right (and this is how i made it)..

the script start from a init eventhandler and the random number isn't seen for anyone else then the local host in MP games?

Share this post


Link to post
Share on other sites

It should be seen on all machines ,as the "init" now runs globally since one of the last patches

The problem that could happen is if the scripts are running independantly on each machine,they each could end up with a different random number

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  

×