Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Change creeper's way to work to a more classic way #509

Closed
ObaniGemini opened this issue Aug 31, 2016 · 12 comments
Closed

Change creeper's way to work to a more classic way #509

ObaniGemini opened this issue Aug 31, 2016 · 12 comments
Assignees
Labels
Modding Priority: Low Attention not required

Comments

@ObaniGemini
Copy link
Member

Actually, creeper's exploding timer is disabled if player moves away from him.

The idea would be to start the timer, and to let the creeper explode even if the player is away, as the classic creeper does, which lets the player dodge him.

@BetterToAutomateTheWorld
Copy link
Member

BetterToAutomateTheWorld commented Sep 8, 2016

To do something simple (easier to maintain), @LeMagnesium & @Crabman77 can you give me you opinion about this little tweak :

-- stop attacking if player or out of range
-- MFF 08/09/2016 (tweaked to explode even if the player is out of range after the counter start )
if not self.attack   
or not self.attack:getpos()
or self.attack:get_hp() <= 0 then

Instead of :

-- stop attacking if player or out of range
if dist > self.view_range
or not self.attack
or not self.attack:getpos()
or self.attack:get_hp() <= 0 then

The creeper explode attack is from here https://github.com/MinetestForFun/server-minetestforfun/blob/master/mods/mobs/api.lua#L1483 to here https://github.com/MinetestForFun/server-minetestforfun/blob/master/mods/mobs/api.lua#L1658

@ghost
Copy link

ghost commented Sep 8, 2016

No it's for all mobs.

if dist > self.view_range (si ne le voit plus)

creepers attack start there -> https://github.com/MinetestForFun/server-minetestforfun/blob/master/mods/mobs/api.lua#L1509

He stop attack there -> https://github.com/MinetestForFun/server-minetestforfun/blob/master/mods/mobs/api.lua#L1529

if dist > self.reach then (si n'est plus à portée)

@ObaniGemini
Copy link
Member Author

This part of the API will affect not affect any other monsters from what I see (excepted to pumpbooms maybe, which is not a problem).
Another tweak then would be to start the timer to closer to the player, for it doesn't become a non-dangerous mob

@BetterToAutomateTheWorld
Copy link
Member

BetterToAutomateTheWorld commented Sep 9, 2016

@Crabman77 If im not wrong, it's only for all monsters with the attack type 'explode', if i understand well the API
So i think it's only for Creepers and PumpBooms.

@ObaniGemini
For the distance, maybe divide by 2 the maxview before activate the counter ?
if "player" in "total_range_view" divided per 2 then "start_counter_auto_explode"

PS : We can also set a fixed value which will be used tu activate the "start_counter_auto_explode"

@ObaniGemini
Copy link
Member Author

👍 for the fixed value.

@Lymkwi
Copy link
Member

Lymkwi commented Oct 6, 2016

@Darcidride The range factor won't be hardcoded, there is one variable for that already.
Also, why would you divide the range?

@Crabman77 I did the modification, I hope I didn't butcher the code.

Lymkwi added a commit that referenced this issue Oct 6, 2016
@ghost
Copy link

ghost commented Oct 6, 2016

@LeMagnesium j'ai un doute sur la 1ere condition, c'est pour tous les mobs, peut être la remettre et ajouter

and not self.attack_type == "explode"

sinon les autre mobs risquent de ne pas s’arrêter, si un 2ème joueur passe à coté et que le 1er s’éloigne, le mobs ne changera pas de cible.
327694b#diff-1a9bf31b6ac84ce577d3d5bd5a8c2adbR1483

Lymkwi added a commit that referenced this issue Oct 6, 2016
 - ... but only for non-explosive mobs
 - #509 , following the advice of @Crabman77
@Lymkwi
Copy link
Member

Lymkwi commented Oct 11, 2016

@Crabman77 Et là?
7ddebdd

@ghost
Copy link

ghost commented Oct 12, 2016

Oui je pense que c'est bon.

@ghost
Copy link

ghost commented Feb 21, 2017

Je crois que le changement a apporté un bug, les pumboom se mettent à exploser a plusieurs nodes(10) de distance maintenant, dès qu'ils nous voient ils explosent au lieu de venir vers nous et exploser au plus près.

ghost pushed a commit that referenced this issue Feb 26, 2017
@ghost ghost assigned Lymkwi and ghost Feb 26, 2017
@ghost
Copy link

ghost commented Feb 26, 2017

Fixed 6fd2c78

@ghost ghost closed this as completed Feb 26, 2017
@BetterToAutomateTheWorld
Copy link
Member

Thank you @Crabman77

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Modding Priority: Low Attention not required
Projects
None yet
Development

No branches or pull requests

3 participants