Jump to content
Sign in to follow this  
neokika

TFS - Tire Fix Script

Recommended Posts

Name: Tire Fix Script (TFS)

Current Version: 1.01

Author: _neo_

Credits: All Tour Members for testing and feedback

Download: Tire Fix Script - Example Mission - Armaholic Mirror

HOW DOES IT WORK?

  • To wheeled vehicles can be added reserve tires to the cargo
  • Switch tires between vehicles
  • When a vehicle tire is not usable, drag a reserve tire and fix it
  • See video below...

kh10e9aQLeo

COMPATIBILITY:

  • Full JIP and Respawn Support
  • Single Player / Hosted Server / Dedicated Server
  • A2 / A2 OA / A2 CO / BAF / PMC

KNOWN ISSUES:

  • None

SUPPORTED VEHICLES LIST (IN ALL VARIANTS):

  • Jackal
  • HMMWV
  • LandRover
  • SUV
  • UAZ
  • MTVR
  • M1126
  • M1128
  • M1129
  • M1130
  • M1135
  • BRDM2
  • LAV25

CHANGELOG:

  • v1.0 Public Release

INSTALLATION:

  • Place the functions module in the editor
  • Place the folder "scripts" inside your mission root folder
  • Add the following to your init.sqf to load the main functions

//Init.sqf
[] execVM "scripts\NEO_tireFix\init_functions.sqf"; //Needs to run on all machines

  • Make a vehicle use TFS:

[_vehicle, _tiresInCargo, _maxCargoSpace] execVM "scripts\NEO_tireFix\init_vehicle.sqf";

_vehicle - OBJECT
_tiresInCargo - NUMBER (OPTIONAL)
_maxCargoSpace - NUMBER (OPTIONAL)

  • The Arguments of the above code must be local to the machine your calling from

_neo_

Edited by neokika

Share this post


Link to post
Share on other sites

Probably the most usefull addon ever released :D Hate it when they shoot of the wheels and you can't do anything about it. Also what's the music?

Share this post


Link to post
Share on other sites

very nice :yay:

a must-have and new-default script for my missions

thank u ! :)

ps. hmm i wonder if it would be hard to rework that script also for fuel-related stuff (swap fuel from one vehicle to another) hint! hint! ;)

Share this post


Link to post
Share on other sites
Lovely! Can't wait to see.

:)

Thanks a lot for the mirror, appreciated.

Very innovative. But isn't the repair animation a bit to long?

Thanks.

Well, I wouldn't call it too long, considering that it takes around 1.30 minutes to fully change the tire, which in real life would take at least 3 to 5 minutes.

Probably the most usefull addon ever released :D Hate it when they shoot of the wheels and you can't do anything about it. Also what's the music?

Thanks a lot.

The music in the video is called "We are not enemies" from the American History X Soundtrack.

very nice :yay:

a must-have and new-default script for my missions

thank u !

ps. hmm i wonder if it would be hard to rework that script also for fuel-related stuff (swap fuel from one vehicle to another) hint! hint! ;)

Thanks a lot.

Yes, that should be possible but as a stand alone script (not implemented in this one). Might take a look at your suggestion thought.

_neo_

Share this post


Link to post
Share on other sites

Good idea!

Could maybe show space number too? Something like this if possible:

tire.jpg

Funny enough it looks like it says 8/10 (8 out of 10). Perfect. :D

Thanks.

Share this post


Link to post
Share on other sites
Good idea!

Could maybe show space number too? Something like this if possible:

Funny enough it looks like it says 8/10 (8 out of 10). Perfect. :D

Thanks.

Indeed! :D

Will sort it out in next version.

_neo_

Share this post


Link to post
Share on other sites

It should be fantastic if AI can repaire the tyre from cargo reserved automatically. lol!

Edited by ffur2007slx2_5

Share this post


Link to post
Share on other sites
It should be fantastic if AI can repaire the tyre from cargo reserved automatically. lol!

Not sure of what you mean? :)

_neo_

Share this post


Link to post
Share on other sites

This is a great script. I wonder if it is possible to use R3F Arty and Logisitic scripts to hold the spare tire in cargo, but use this script to put it on?

Share this post


Link to post
Share on other sites
Guest
This is a great script. I wonder if it is possible to use R3F Arty and Logisitic scripts to hold the spare tire in cargo, but use this script to put it on?

Thats the first thing I thought of as well. Possible?

Share this post


Link to post
Share on other sites
This is a great script. I wonder if it is possible to use R3F Arty and Logisitic scripts to hold the spare tire in cargo, but use this script to put it on?
Thats the first thing I thought of as well. Possible?

Not sure about this, if the Author wants to implement it he is free to do it, but I wouldn't know where to look.

I just wonder whether AI can fix the damaged tyre on their own.

No, not AI compatible. =(

_neo_

Share this post


Link to post
Share on other sites

I'm a noob... I've followed the installation instructions but when I place the [_vehicle, _tiresInCargo, _maxCargoSpace] execVM "scripts\NEO_tireFix\init_vehicle.sqf"; into the vehicles init line I get a "Local variables in global space" error.

Can anyone please help? And please explain in layman terms :o

Share this post


Link to post
Share on other sites
I'm a noob... I've followed the installation instructions but when I place the [_vehicle, _tiresInCargo, _maxCargoSpace] execVM "scripts\NEO_tireFix\init_vehicle.sqf"; into the vehicles init line I get a "Local variables in global space" error.

Can anyone please help? And please explain in layman terms :o

Hey Freebie,

When calling scripts inside init lines etc, you need a handler like this:

_nic = [_vehicle, _tiresInCargo, _maxCargoSpace] execVM "scripts\NEO_tireFix\init_vehicle.sqf"

Where the handler will be _nic.

Also, you will need the actual parameters like this:

_nic = [this, 2, 3] execVM "scripts\NEO_tireFix\init_vehicle.sqf"

Where this refers to the object, 2 the current tires inside the vehicle, and 3 the maximum cargo space for tires (since you will be able to share tires from vehicle to vehicle).

_neo_

Share this post


Link to post
Share on other sites

Ah thank you neokika, that did the trick. Plus what a great little script! Now I don't need to abandon vehicles that have their tyres shot out! :)

I still have a couple of questions if you don't mind please?

Firstly re the handlers. Now that you pointed it out I've noticed other scripts that I'm calling from unit's init lines do have them too. The one's I've copied/pasted before have nul, whereas you specified nic. Will any word do? or are these set words that you must use?

And secondly in your readme text file it says that the line that goes in the mission's init.sqf file [] execVM "scripts\NEO_tireFix\init_functions.sqf"; Needs to "run on all machines".

I'm not exactly sure what you mean by this? It sounds like your saying that everyone playing in the mission needs to have this line in order for them to fix the tyres too? and yet to my (very basic) knowlege it can only go in the one init.sqf file which only exists on the server host machine.

Can you please clarify this to me? thanks.

Share this post


Link to post
Share on other sites
Ah thank you neokika, that did the trick. Plus what a great little script! Now I don't need to abandon vehicles that have their tyres shot out! :)

I still have a couple of questions if you don't mind please?

Firstly re the handlers. Now that you pointed it out I've noticed other scripts that I'm calling from unit's init lines do have them too. The one's I've copied/pasted before have nul, whereas you specified nic. Will any word do? or are these set words that you must use?

And secondly in your readme text file it says that the line that goes in the mission's init.sqf file [] execVM "scripts\NEO_tireFix\init_functions.sqf"; Needs to "run on all machines".

I'm not exactly sure what you mean by this? It sounds like your saying that everyone playing in the mission needs to have this line in order for them to fix the tyres too? and yet to my (very basic) knowlege it can only go in the one init.sqf file which only exists on the server host machine.

Can you please clarify this to me? thanks.

Hi again Freebie,

Ofc, ask at will. :)

Basically, the handler is just a variable that will hold (in this situation) the script handler, for example:

_handler = [] execVM "someScript.sqf";
waitUntil { scriptDone _handler };
hint "someScript.sqf has finnished";

The above code would execute someScript.sqf, and store its ID in the local variable _handler, and waitUntil will halt it, until someScript.sqf was finnished (Not running anymore). The above is just one example.

You can also use global variables, that can be anything.

TAG_myLongGlobalVariableNameAndHandler = [] execVM "someScript.sqf";

:D

The real reason why init lines need the handler assigned, I dont know for sure, maybe its a requirement for all pre-processed code or something.

Basically, init.sqf will execute once, when joining mission.

Init.sqf

...Every machine will run this code...

if (isServer) then { ...only SERVER will run this code };
if (isDedicated) then { ...only DEDICATED SERVERS will run this code };

etc...

So, your init.sqf would look like this:

[] execVM "scripts\NEO_tireFix\init_functions.sqf";

...more code...

_neo_

Share this post


Link to post
Share on other sites

Thanks for all your help neokika, there's a lot to learn about scripting! It's very interesting though :)

Share this post


Link to post
Share on other sites

hi this is a great script, nice job, but would be nice to add this to a tire also so you can put tires on the ground people can pick up and put on their cars

Share this post


Link to post
Share on other sites
Thanks for all your help neokika, there's a lot to learn about scripting! It's very interesting though :)

No worries mate, any time...:)

hi this is a great script, nice job, but would be nice to add this to a tire also so you can put tires on the ground people can pick up and put on their cars

Hi Richard,

Do you men like a "Tire Holder", where players can take tires from there, for example in Base?

_neo_

Edited by neokika

Share this post


Link to post
Share on other sites
No worries mate, any time...:)

Hi Richard,

Do you men like a "Tire Holder", where players can take tires from there, for example in Base?

_neo_

that or say their is just a tire in the map, they can take that and put it on the hmmwv. In game they have the single tyre I think that would be cool. Or at base like you said maybe the tyre heap. But just throwing out some ideas, I love the script works great.

Share this post


Link to post
Share on other sites
that or say their is just a tire in the map, they can take that and put it on the hmmwv. In game they have the single tyre I think that would be cool. Or at base like you said maybe the tyre heap. But just throwing out some ideas, I love the script works great.

Well, I think its a very good idea indeed, will take it into account for sure.

I'll have to see what I can come up with for next version.

Thanks a lot for the feedback.

_neo_

Share this post


Link to post
Share on other sites
Well, I think its a very good idea indeed, will take it into account for sure.

I'll have to see what I can come up with for next version.

Thanks a lot for the feedback.

_neo_

Just trying to help, cannot wait to see what you come up with, keep up the good work.

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  

×