Fireball carbine[HELP]

Mods, guides how to use and install mods go right in here.
Post Reply
Mama Mia
Posts: 5
Joined: 07 Sep 2013, 00:30

Post » 07 Sep 2013, 00:42

I want to hold my fireball button and fire fully- automatic.
I changed the max fireballs to 99, and I also changed the fireball speed to 150 so it fires almost straight.
How do you make it fully automatic?[

User avatar
HugoBDesigner
Posts: 2189
Joined: 19 Sep 2012, 02:23
Contact:

Post » 07 Sep 2013, 01:21

Add to game_load:

Code: Select all

shootingfire = false
shootingtimer = 0
shootingtimerlimit = 1
shootingplayers = {}
for i = 1, players do
        table.insert(shootingplayers, false)
end
to game_update:

Code: Select all

if shootingfire then
        while shootingtimer < shootingtimerlimit do
                shootingtimer = shootingtimer + dt
        end
        if shootingtimer >= shootingtimerlimit then
                for i = 1, players do
                        if shootingplayers[i] == true then
                                objects["player"][1]:fire()
                        end
                end
                shootingtimer = 0
        end
else
        shootingtimer = 0
end
to game_keypressed:

Code: Select all

for i = 1, players do
        if key == controls[i]["run"][1] then
                shootingfire = true
                shootingplayers[i] = true
        end
end
to game_keyreleased:

Code: Select all

for i = 1, players do
        if key == controls[i]["run"][1] then
                shootingfire = false
                shootingplayers[i] = false
        end
end
to game_joystickpressed:

Code: Select all

for i = 1, players do
        if not noupdate and objects["player"][i].controlsenabled and not objects["player"][i].vine then
                local a = controls[i]["run"]
                if a[1] == "joy" and joystick == a[2] and a[3] == "but" and button == a[4] then
                        shootingfire = true
                        shootingplayers[i] = true
                end
        end
end
to game_joystickreleased:

Code: Select all

for i = 1, players do
        if not noupdate and objects["player"][i].controlsenabled and not objects["player"][i].vine then
                local a = controls[i]["run"]
                if a[1] == "joy" and joystick == a[2] and a[3] == "but" and button == a[4] then
                        shootingfire = false
                        shootingplayers[i] = false
                end
        end
end
This may work, but I don't guarantee 100%. Also, welcome to the forums! We hope you stay in!

Mama Mia
Posts: 5
Joined: 07 Sep 2013, 00:30

Post » 07 Sep 2013, 01:32

I'm sorry and I am a total noob to this, so where are the Game_ files?

User avatar
Mari0Maker
Posts: 1348
Joined: 07 Apr 2012, 17:10
Contact:

Post » 07 Sep 2013, 01:38

Mama Mia wrote:I'm sorry and I am a total noob to this, so where are the Game_ files?
If you are using Notepad++ (and this may work on others), press CTRL + F, and type in what your looking for, and hit search.

Mama Mia
Posts: 5
Joined: 07 Sep 2013, 00:30

Post » 07 Sep 2013, 01:53

I tryed that. where is the thing he is talking about? sorry.

User avatar
Mari0Maker
Posts: 1348
Joined: 07 Apr 2012, 17:10
Contact:

Post » 07 Sep 2013, 02:00

Mama Mia wrote:I tryed that. where is the thing he is talking about? sorry.
If you are talking about which .lua file it is, it is game.lua.

User avatar
Firaga
Posts: 931
Joined: 02 Jul 2012, 16:05
Contact:

Post » 07 Sep 2013, 02:02

Mari0's source.
You'd need LOVE2D to open it and use it, if you don't have it already.
Also, what Mari0Maker said. game.lua.

Mama Mia
Posts: 5
Joined: 07 Sep 2013, 00:30

Post » 07 Sep 2013, 02:10

Wow thank you guys. But sorry, It has a error.

User avatar
alesan99
Posts: 2335
Joined: 30 May 2013, 21:42
Contact:

Post » 07 Sep 2013, 04:01

Image
kinda weird when i made the mod...

Post Reply