[Mod] Gunslinger [alpha][gunslinger]

Re: [Mod] Gunslinger (WIP) [gunslinger]

Postby StarNinjas » Thu Apr 04, 2019 10:33 pm

Yay looking good I found a problem, you can keep firing the cheetah if you hold down you can keep shooting even when out of bullets.
here are some suggestions:
-optional bullet texture per gun
-optional shot partical per gun
-you can make the partical bigger smaller and faster
-when partical hits node play crack sound
-optional reload time
thats some ideas I just though up rn
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1

Re: [Mod] Gunslinger (WIP) [gunslinger]

Postby ANAND » Fri Apr 05, 2019 1:21 am

Optional bullet-texture and shot-particle is already in the plans. The bullet already travels at 500m/s (the particle too), but if you're suggesting that the speed should be definable per-gun, that's a good idea. Handling nodes is a whole new department, and that requires a lot more code. That's probably going to take a little while, I'm afraid. Reload time can already be changed per-gun by (re-)defining reload_time field.
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger (WIP) [gunslinger]

Postby StarNinjas » Fri Apr 05, 2019 3:43 am

cool!! Should work for me thous where just some ideas.
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1

Re: [Mod] Gunslinger (WIP) [gunslinger]

Postby StarNinjas » Fri Apr 05, 2019 9:18 pm

Also could you make an example mod that uses this api?
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1

Re: [Mod] Gunslinger (WIP) [gunslinger]

Postby ANAND » Sat Apr 06, 2019 12:56 am

gunslinger itself uses all these features for its builtin gun(s) :P

There's also one third-party mod which depends on gunslinger: gunslinger_rangedweapons by sparky/Elkien3. Note that this mod depends on Elkien3's own fork of gunslinger, and would have issues working with the original API.
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger (WIP) [gunslinger]

Postby Stix » Sat Apr 06, 2019 1:57 am

Ill have to read up on how this uses raycasting for my own coding ventures :P Any specific lines you can point me to?
Stix
Member
 
Posts: 1365
Joined: Fri Aug 04, 2017 2:19 pm
In-game: Stix [+alts]

Re: [Mod] Gunslinger (WIP) [gunslinger]

Postby Lone_Wolf » Sat Apr 06, 2019 3:52 am

Stix wrote:Ill have to read up on how this uses raycasting for my own coding ventures :P Any specific lines you can point me to?

fOrUmS.rAyCaStOrPoInT(oNe, ExAmPle)
Lone_Wolf
Member
 
Posts: 2151
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

Re: [Mod] Gunslinger (WIP) [gunslinger]

Postby ANAND » Sat Apr 06, 2019 7:07 am

Get two positions, and construct a raycast like so:

Code: Select all
local ray = minetest.raycast(pos1, pos2, true, false)


The following code gets first (i.e. next) node/object that the raycast intersects:

Code: Select all
local pointed_thing = ray:next()


Here are a couple of resources to get you started:
- API documentation on Raycast
- API documentation on pointed_thing (this is what Raycast:next() returns)

This mod only gets the first pointed thing, so I abstracted all the raycasting code as a separate helper function. But the result is that bullet penetration and/or multiple targets isn't supported at the moment.
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger (v0.19-pre) [gunslinger]

Postby ANAND » Sun Apr 07, 2019 6:01 am

v0.19 released!



Recoil is now a thing!

Recoil can be tuned per-gun by adjusting the recoil_mult field in the gun definition.

Check out the complete changelog here: https://github.com/ClobberXD/gunslinger ... .v0.19-pre

P.S. The list of features in the first post has been removed due to the additional maintenance burden.
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby ANAND » Tue Apr 09, 2019 7:26 am

ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby StarNinjas » Wed Apr 10, 2019 7:59 pm

How to add sounds? Just a question.
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby ANAND » Thu Apr 11, 2019 2:58 am

Look for documentation on sounds, in https://github.com/ClobberXD/gunslinger ... tion-table
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby StarNinjas » Thu Apr 11, 2019 3:43 am

Can I please have a code example nothing has worked even used code from ranged weapons by Elkien.
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby ANAND » Thu Apr 11, 2019 8:01 am

Checkout https://github.com/ClobberXD/gunslinger ... r/guns.lua to see how Cheetah is registered. Note that it doesn't register custom sounds, so the default sounds are used. To register custom sounds for events, add the following to the gun definition:

Code: Select all
sounds = {
   fire = "fire_sound",
   reload = "reload_sound",
   ooa = "sound_played_when_there's_no_ammo_in_inventory",
   load = "sound_when_manually_loading_gun"
}


The values for the four fields should be the name of the corresponding sound file (with or without the .ogg extension). Make sure the sound files are in the sounds sub-folder of the mod.

All four sounds are optional, and the mod will play the default sounds for those not defined. Also note that the load sound is used only if gun sets mode to manual.
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby niwla23 » Fri Apr 12, 2019 9:09 am

DELETED
niwla23
Member
 
Posts: 92
Joined: Sat Nov 17, 2018 5:40 pm
In-game: Niwla

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby ANAND » Fri Apr 12, 2019 10:01 am

OK
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby StarNinjas » Fri Apr 12, 2019 8:03 pm

Thanks sooo much thinking about making a mod which depends on this
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby ANAND » Sat Apr 13, 2019 5:38 am

Good to know you find this mod useful. Do let me know if anything can be improved. :)
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby StarNinjas » Sat Apr 13, 2019 9:06 pm

Ideas:
-Add texture when gun is reloading
-Some guns can slow your movement down
Issues:
-When reloading what ever slot is selected is where the reloaded gun is put
Soo the mod i'm working on adds FN like guns.
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby ANAND » Thu Apr 18, 2019 2:16 pm

StarNinjas wrote: -Add texture when gun is reloading
-Some guns can slow your movement down


I don't exactly understand the first idea, sorry. The second idea is in the works (somewhat), but I'm afraid the implementation might not be the best, as there's no straightforward and lag-free way to check player's wielded item and update stuff accordingly.

StarNinjas wrote: -When reloading what ever slot is selected is where the reloaded gun is put


Yes, that's a known bug, but thanks for reporting.

Good luck on your mod! :)
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby StarNinjas » Thu Apr 18, 2019 4:03 pm

What I mean is like in ranged weapons when your rloading the gun swaps items/texture.
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby ANAND » Thu Apr 18, 2019 4:09 pm

Ah I see. That's just a different way of handling reloading. gunslinger uses item wear and item meta instead of registering a separate item for the loaded state. But I'm curious - what are the use-cases you have in mind?
ANAND
Member
 
Posts: 329
Joined: Sun Jan 28, 2018 12:54 pm
GitHub: ClobberXD
In-game: ANAND ClobberXD [A-Za-z0-9-_]Tomato

Re: [Mod] Gunslinger [alpha][gunslinger]

Postby StarNinjas » Thu Apr 18, 2019 9:56 pm

I don't see what you mean use cases?
StarNinjas
Member
 
Posts: 288
Joined: Wed Mar 14, 2018 12:32 am
GitHub: starninjas
In-game: J1



Return to WIP Mods



Who is online

Users browsing this forum: Yandex Bot [Bot] and 0 guests