-
Notifications
You must be signed in to change notification settings - Fork 94
Add the grenades mod #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the grenades mod #279
Conversation
|
I'm not sure how to fix the deathlist HUD bug. Could someone point me to the file where the shooter grenade was set to show up as a grenade img and not a sword? |
|
Embarrassingly, this is hard-coded in if player:get_hp() - damage <= 0 then
dead_players[player:get_player_name()] = true
local wielded = hitter:get_wielded_item()
local wname = wielded:get_name()
print(wname)
local type = "sword"
if wname:sub(1, 8) == "shooter:" then
if wname == "shooter:grenade" then
type = "grenade"
else
type = "bullet"
end
end
if tool_capabilities.damage_groups.grenade then
type = "grenade"
end
for i = 1, #ctf.registered_on_killedplayer do
ctf.registered_on_killedplayer[i](player:get_player_name(), hitter:get_player_name(), type)
end
return false
end |
|
I've attempted at making the kill type a little more generic: MT-CTF/ctf_pvp_engine#26 However, that is irrelevant to this PR, as that is a completely different issue. Once the aforementioned PR gets merged, |
ClobberXD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor issues need addressing. Also, please convert indents from regular spaces to tabs. I'll test this soon and provide further feedback. Thanks.
|
Please describe features, that you expect to introduce with grenades. |
Good point. Preferably, this should be added to the first post... |
|
Tested. Here are my thoughts, from the most important to the least important:
|
My throwing code was basically copied from the shooter mod's grenade and modified.
I increased the radius of regular grenades. They already do one less hp point per node away the player is
You need lots of particles for it to do anything. I lessened the amount. (Now 15. IIRC I had put 100 before)
I've made some changes to the flashbang. It uses a single texture now, opacity changes may still need some help, and I also set it up so it's enabled by default now |
Just mention anything you think I did wrong or you don't like. My 'intended behavior' is grenades that almost everyone likes |
|
@ClobberXD Could you review/test again? |
… the crafting page
|
The latest commit only fixes the markdown in API.md, and does not add flashbangs to treasure chests and crafting.lua. Also, re-tested after incorporating the latest changes.
For the issue of non-varying trajectories, I'll experiment with the code and see what's to be done. |
|
A |
|
Here are my deductions on acceleration and it's components:
Velocity on the other hand is quite simple. All three components are set to I just realized grenades actually do change trajectory depending on how high they're thrown, but the strong "gravity" and low velocity confused me into thinking that wasn't the case. |
|
More testing: Thanks to I also experimented with velocity and acceleration. The following seems to be one of the most optimal combinations: obj:set_velocity({x = dir.x * 40, y = dir.y * 40, z = dir.z * 40})
obj:set_acceleration({x = dir.x * -4, y = -10, z = dir.z * -4})If this feels a tad too fast, the velocity multiplier can be changed to 35. |
|
We don't want the grenade's throwing range to be too great or players could 'bomb' the enemy base without risking confrontation |
|
@ClobberXD I think it's ready for another 'checkup' |
|
That's fixed. How are the new grenade physics? @ClobberXD |
|
So. What needs to be done before this can be merged? @ClobberXD |
As of now, I don't see any other issues. |
Ok Ok. I set them to have the same rarity as the current grenade. These grenades are craftable too. Unlike the current grenade. I will also need some help figuring out what all the arguments in the treasure registration do lol Ok. I'll increase it slightly |
|
Taken from ==== This function does some basic parameter checking to catch the most obvious Rarity does not imply preciousness. A rare treasure may not neccessarily a ===== Parameters =====
===== Return value ===== === data formats ===
==== |
|
I think the flashbangs could still use a little touching up regarding the blindness. If someone could take a look at that when they test... |
|
Sounds would make these grenades more enjoyable to use. Would you be able to add the appropriate sounds for each grenade? Also, this PR needs to be rebased. |
heh. I just finished those. I added them to the non-CTF mod though. So I'll have to copy them over. Will do |
|
I like this. I would be great to see #356 added to this too, but this can be later
This is no longer hard coded, so it may just work
Maybe decrease speed too? This would beg for a physics resolver too. I suggest just ignoring this issue for now |
#289 :) Merge conflicts, btw. |
|
Ok. I'll get to work on this again lol |
|
Ok. Using |
|
heh. I may need to make a new PR. Messed up the rebase... |
|
Moving to #357 |
#264
Could probably use testing by someone other than me. These grenades are also craftable (5 steel ingots + 1-2 coal lumps)
Todo: