Lower the minimum distance of push-back effect?

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1164
Joined: Wed May 18, 2016 4:55 pm
Contact:

Lower the minimum distance of push-back effect?

Post by Mooncat » Thu May 04, 2017 5:10 pm

Request: please make the new "push-back" effect to accept distances lower than 0.3, and lower its actual effective distance from 1 to the input value.

During my approach to make a proper push back effect for the discharge defense equipment by dividing the effect into multiple frames, I found out that the new "push-back" effect does not accept values lower than 0.3. No error was thrown, but it didn't do anything. Even if I input 0.3, the actual push back distance seems to be 1.

If this request is implemented, I can make a proper push back effect. :) (I would call the current effect as teleportation.)

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 1998
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz » Thu May 04, 2017 5:13 pm

Absolutely do need this. Allowing sliding effects would be great.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Rseding91
Factorio Staff
Factorio Staff
Posts: 9261
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Rseding91 » Thu May 04, 2017 5:26 pm

The distance isn't limited to any particular value code wise. It does however not work if you try to move the entity by less than half its bounding box size because it can't find a place that doesn't collide with itself and can't move the entity.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 1998
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz » Thu May 04, 2017 5:30 pm

Ah. In that case, when a push effect occurs, ignore the entities own bounding box for checking.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1164
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat » Thu May 04, 2017 5:36 pm

Rseding91 wrote:The distance isn't limited to any particular value code wise. It does however not work if you try to move the entity by less than half its bounding box size because it can't find a place that doesn't collide with itself and can't move the entity.
I think it can (partially) explain why this thing occurs:

All targets are pushed to the same direction when I set distance = 0. Looks like a bug.

Yes, as Ranakastrasz said, each target should ignore itself when being pushed. :)

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 1998
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz » Thu May 04, 2017 5:52 pm

Huh. If the distance was zero, I would expect it to go due east, due to the whole Atan2 thinggy. Always happened when I messed with Angles.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1164
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat » Thu May 04, 2017 6:08 pm

You can't expect how the aliens behave. :P
Yea, I tried a few more times. The direction is the same.

posila
Factorio Staff
Factorio Staff
Posts: 3529
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by posila » Thu May 04, 2017 6:10 pm

Hack tip ... you can teleport biters back and give them sticker with negative movement modifier. So when they try to run back toward you, they will actually move backwards :D

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1164
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat » Thu May 04, 2017 6:52 pm

posila wrote:Hack tip ... you can teleport biters back and give them sticker with negative movement modifier. So when they try to run back toward you, they will actually move backwards :D
lol! Didn't think of it.
But I think it is not very effective on spitters? Since they don't need to move before spitting on you. :lol:

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 1998
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz » Thu May 04, 2017 7:55 pm

Do those speed modification debuffs stack? If so, do they add or multiply? can you end up with negative speed if they add?
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1164
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat » Fri May 05, 2017 1:56 am

Ranakastrasz wrote:Do those speed modification debuffs stack? If so, do they add or multiply? can you end up with negative speed if they add?
Based on my Supportive Weapons mod (pending update for 0.15), 2 different stickers with slow down effect can definitely make the enemies move slower than just one sticker. I think they multiply. Addition will easily produce negative movement speed, but I didn't see that happen in my mod.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 1998
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz » Fri May 05, 2017 12:38 pm

Mooncat wrote:
Ranakastrasz wrote:Do those speed modification debuffs stack? If so, do they add or multiply? can you end up with negative speed if they add?
Based on my Supportive Weapons mod (pending update for 0.15), 2 different stickers with slow down effect can definitely make the enemies move slower than just one sticker. I think they multiply. Addition will easily produce negative movement speed, but I didn't see that happen in my mod.
Thing is, addition for modules could easily result in negative energy consumption if you stack 3 50% effectively modules. Instead, it caps at 20%. Just beccause it uses addition doesn't preclude a cap.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1164
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat » Fri May 05, 2017 1:25 pm

Ranakastrasz wrote:
Mooncat wrote:
Ranakastrasz wrote:Do those speed modification debuffs stack? If so, do they add or multiply? can you end up with negative speed if they add?
Based on my Supportive Weapons mod (pending update for 0.15), 2 different stickers with slow down effect can definitely make the enemies move slower than just one sticker. I think they multiply. Addition will easily produce negative movement speed, but I didn't see that happen in my mod.
Thing is, addition for modules could easily result in negative energy consumption if you stack 3 50% effectively modules. Instead, it caps at 20%. Just beccause it uses addition doesn't preclude a cap.
But posila said that there is no cap on movement speed effect from stickers.
Anyway, I did a small test: I changed the "target_movement_modifier" of "slowdown-sticker" to 2, and that of "stun-sticker" to -0.2

I bet the equation is something like

Code: Select all

local final_velocity = base_speed
for _, sticker in pairs(stickers) do
    final_velocity = final_velocity * sticker.target_movement_modifier
end
return final_velocity

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 1998
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz » Fri May 05, 2017 1:30 pm

Ok, test this.
2x speed tag.
-1x tag
See if they move at double speed, normal speed backwards, and double speed backwarda
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1164
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat » Fri May 05, 2017 6:23 pm

Ranakastrasz wrote:Ok, test this.
2x speed tag.
-1x tag
See if they move at double speed, normal speed backwards, and double speed backwarda
Actually you can test it yourself. :P
Image

Post Reply

Return to “Modding interface requests”

Who is online

Users browsing this forum: No registered users