Open fyflo opened 3 days ago
Nothing that's obviously wrong as far as i can see, do the elements get added within #frags at all?
Is "frags" an event that actually gets emitted in your version?
Is "frags" an event that actually gets emitted in your version?
Hi. Nothing happens when adding frags. On the mini map, a fragment just flies and disappears. Maybe I didn't add information to some file for processing.
Right, but did you implement a handler for that custom frag event in gsi.js?
Right, but did you implement a handler for that custom frag event in gsi.js?
gsi.js no I forgot about this. I will do it. thanks for the tip
It worked, but the effect lasts a long time and is duplicated after some time in a neighboring place. I will continue to compose, why is it duplicated and the effect works for so long.
gsi.js:
if (game.grenades) {
let grenades = {
smokes: [],
infernos: [],
flashbangs: [],
frags: [],
projectiles: [],
};
} else if (nade.type == "frag" && parseFloat(nade.lifetime) >= 1.4) {
let pos = nade.position.split(", ");
grenades.frags.push({
id: nadeID,
position: {
x: parseFloat(pos[0]),
y: parseFloat(pos[1]),
z: parseFloat(pos[2]),
},
});
map.html
<!-- Lowest layer: Area of effect -->
<div id="smokes"></div>
<div id="infernos"></div>
<div id="flashbangs"></div>
<div id="frags"></div>
Found the correctness. in gsi frags I put it in a separate if & corrected the timing.
if (nade.type == "frag" && parseFloat(nade.lifetime) >= 1.65) {
let pos = nade.position.split(", ");
grenades.frags.push({
id: nadeID,
position: {
x: parseFloat(pos[0]),
y: parseFloat(pos[1]),
z: parseFloat(pos[2]),
},
});
}
corrected the timing in the smokes.js file
// Play a "pop" animation after adding
setTimeout(() => {
fragElement.className = "fragEntity full";
}, 200);
// Fade out slowly
setTimeout(() => {
fragElement.className = "fragEntity full hide";
}, 2600);
// Remove element when invisible
setTimeout(() => {
fragElement.remove();
}, 5000);
If you got it working please do open a PR!
If you got it working please do open a PR!
Okay. I'll do it in a couple of hours. I'm working now.
Hello guys
I tried to add a flashbang effect to the frag grenade, but it didn't work. What I added: file: smokes.js Added and corrected the code for the noise grenade for the fragmentation grenade
file: map.css Added
Please correct me if I forgot anything or what needs to be added so that after the explosion of a fragmentation grenade there is an effect on the map
P.S. Changes in js & ccs are marked