Jump to content

[REL] Bomber script 1.0


Ace_Gambit

Recommended Posts

Bomber script 1.0 (Resource) Ace_Gambit

This resource allows you to attach bombs to any vehicle. Please take note that you can not run this resource as a stand alone script. You will have to incorporate it in a game mode.

Also be aware of the fact that the bombs are not synchronized. In other words, only you can see the bombs falling! The explosions on the other hand are synchronized for all players.

Download url: https://community.multitheftauto.com/index.php?p= ... ils&id=129

Features:

- realistic bomb dropping with real GTA world physics

- configurable bomb models

- velocity triggered bombs

- depth bombs

Controls:

- LSHIFT drop bomb

- MOUSE2 switch off depth camera

Usage (The "samples" folder includes a demo game mode that you can use as a sandbox):

1) Copy archive to resource folder and include resource in your script.

2) Register markers using one of the following export functions.

2a) Register all markers as bomb reloading spots

call(getResourceFromName("bomber"), "regBombMarkers", getElementsByType("marker", getRootElement()))

2b) Register marker as bomb reloading spot

call(getResourceFromName("bomber"), "regBombMarker", marker)

2c) Unregister marker as bomb reloading spot *

call(getResourceFromName("bomber"), "unregBombMarker", marker)

2d) Unregister all markers as bomb reloading spots *

call(getResourceFromName("bomber"), "unregBombMarkers", getElementsByType("marker", getRootElement()))

3) Play!

Settings:

Setting names **:

- andromada

- at400

- beagle

- cargobob

- cropduster

- dodo

- hunter

- hydra

- leviathan

- maverick

- nevada

- newschopper

- policemaverick

- raindance

- rustler

- seasparrow

- shamal

- skimmer

- sparrow

- stuntplane

- coastguard

- dinghy

- jetmax

- launch

- marquis

- predator

- reefer

- speeder

- squalo

- tropic

- fbirancher

- patriot

- policecar

- policeranger

- rhino

* Markers are automatically unregistered when the resource is stopped

** Setting names are just predefined tags. You can use any vehicle id in combination with a setting tag. This is more or less a design flaw since I am just starting to learn how to use the settings system.

Credits to the MTA team

Link to comment
Also be aware of the fact that the bombs are not synchronized. In other words, only you can see the bombs falling! The explosions on the other hand are synchronized for all players.

Does that mean that the others will get to know of the bomb only when it has already hit them? That kinda... isn't very ok. imo.. But else, what a nice useful snippet.. Maybe I should too learn LUA one eday ;)

Link to comment

Does that mean that the others will get to know of the bomb only when it has already hit them? That kinda... isn't very ok. imo.. But else, what a nice useful snippet.. Maybe I should too learn LUA one eday ;)

Yes, that's basically what happens. But this has to do with the fact that server side object creation is buggy. I tried to script it server side but the script doesn't work like it should (bomb remaining static, objects not being destroyed etc.). This is not my fault. You can fake it by telling all clients to create "their" version of the bomb though. But this still wouldn't be synchronized because the bomb is not following a static trajectory. One client for example may see it bounce off to the right while another one sees it as going to the left. There's nothing more I can do than to wait and hope that DP3 supports velocity changes on objects.

Link to comment
I tested it. It´s realy nice!

But one think is strange, by me it works perfectly, no crashes etc. but by a few other players, long not all, but a few, the game crashes when there drive/fly in the marker.

:(

That must be an MTA bug because nothing extraordinary happens when you hit a marker.

Link to comment

Yes, that's basically what happens. But this has to do with the fact that server side object creation is buggy. I tried to script it server side but the script doesn't work like it should (bomb remaining static, objects not being destroyed etc.). This is not my fault. You can fake it by telling all clients to create "their" version of the bomb though. But this still wouldn't be synchronized because the bomb is not following a static trajectory. One client for example may see it bounce off to the right while another one sees it as going to the left. There's nothing more I can do than to wait and hope that DP3 supports velocity changes on objects.

Huh?! For me those destroyElement bugs are always because i test scripts on my local machine but on normal servers everything should work fine with server-side created objects...

Link to comment

Huh?! For me those destroyElement bugs are always because i test scripts on my local machine but on normal servers everything should work fine with server-side created objects...

I have no idea. I don't have a remote server and I can only test scripts on my own computer.

Link to comment

i have tried to run your Bomber script with the BROPH resource but it doesnt seem to create any reload points

sorry if im being dumb but have i missed something im supposed to change or should it just work as is

i read the readme with it but i am unsure as to how to set up the reload markers :?

Thanx for any reply :D

Link to comment

What is the broph resource? And it is very easy to set it up. All you have to do is include the resource in your game mode, create some markers and register the markers as reloading spots. The Bomber resource will automatically attach the necessary event handling. You basically do not have to worry about how bomber markers work. The resource should do the dirty job for you. If you are still unsure how to make this work look at the demo game mode provided with this resource (it is in the samples folder of the bomber.zip archive). Copy demo.zip and bomber.zip to your resource folder and run it right out of the box.

Long story short. You will have to do some basic scripting in order to make this work.

Link to comment

thank u :D

i shall give it a go

Amazing script

i think i just confused myself a bit

when i said i was using the BROPH resource i meant the one that is built into mta its the freeroam gamemode by BROPHY

thanx for the help :D

EDIT : hope im not being a pain but how did u get the settings for attaching the bomb to the vehicles as i would like to include more and have no idea how u figured out where they should be :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...