Page 1 of 1

movement_bonus into other equipment type?

Posted: Tue Jul 12, 2016 7:34 pm
by AutoMcD
I'm hoping to add a movement modifier to equipment items.
First is a "active-defense-equipment" type, I want to make the defense gun in my mod slow you down since it should be sorta heavy.

Other thing I want to do is make "extra plating" that occupies a 1x1 grid space and adds defensive bonus but also slows you a bit.

API says it only works if the equipment type is "movement-bonus-equipment". And I can confirm that just willy-nilly adding the line causes an error.

Is this hard-coded? Is there a way to add it?
Also the API doesn't list all the types.. how do we know what they all are?

Re: movement_bonus into other equipment type?

Posted: Wed Jul 13, 2016 2:39 pm
by DedlySpyder
Yes, it's hardcoded in. The prototypes aren't in the API, you can look them up on the wiki or check the base factorio files.

As for how to do this, I think the only way is to separate it into two pieces and use scripting to force the player to use both if them (like the automated defenses won't work until the player had a stabilizer or something)

Re: movement_bonus into other equipment type?

Posted: Thu Jul 14, 2016 2:30 pm
by AutoMcD
Interesting.
Is there a way to make the movement modifier as an "invisible" paired second object that automatically follows the main object when equipped?

Re: movement_bonus into other equipment type?

Posted: Thu Jul 14, 2016 2:33 pm
by DedlySpyder
Not sure. I've not tried doing much with equipment. You can try to make a 0x0 equipment and spawn it in the grid. Or maybe try making them not use whole numbers (like the player places a 0.9x1, and you spawn in a 0.1x1 next to it)

Re: movement_bonus into other equipment type?

Posted: Fri Aug 26, 2016 1:50 pm
by AutoMcD
With the changes in 0.14 that just hit, do you guys think this is possible now?

Re: movement_bonus into other equipment type?

Posted: Fri Aug 26, 2016 2:40 pm
by DedlySpyder
AutoMcD wrote:With the changes in 0.14 that just hit, do you guys think this is possible now?
Not at home to check, but it sounds like they just added restrictions to the equipment. Kinda like how crafting categories make it so that engines can only be crafted in assemblers.

Re: movement_bonus into other equipment type?

Posted: Fri Aug 26, 2016 6:45 pm
by orzelek
Acording to FF'f it is.
Someone needs to make a mod and test it out :D

Re: movement_bonus into other equipment type?

Posted: Fri Aug 26, 2016 6:58 pm
by DedlySpyder
orzelek wrote:Acording to FF'f it is.
Someone needs to make a mod and test it out :D
No? This thread was asking if you could combine equipment effects (shooting and speed modifier), which the fff doesn't really say

Re: movement_bonus into other equipment type?

Posted: Fri Aug 26, 2016 7:15 pm
by orzelek
DedlySpyder wrote:
orzelek wrote:Acording to FF'f it is.
Someone needs to make a mod and test it out :D
No? This thread was asking if you could combine equipment effects (shooting and speed modifier), which the fff doesn't really say
Ahh sorry I misunderstood the question.
Looking at prototypes nothing changed there so not possible most likely.

Re: movement_bonus into other equipment type?

Posted: Thu Sep 01, 2016 9:36 am
by ShinyAfro
Why not make two items and have control.lua remove/add the other half, one being movement equipment and the other whatever you need? If you wanted to make it seamless you would need 3 items, though. A placement item, which gets converted into 2 items that look like one.

Basically you would insert for example a 4x8 item, the control.lua would replace it with 2 4x4's in the same area and when you remove one of the two it replaces the cursor item with the original item which is just a dummy. For the 1x1 plating that could be an issue, however.

Re: movement_bonus into other equipment type?

Posted: Thu Sep 01, 2016 4:31 pm
by AutoMcD
ShinyAfro wrote:Why not make two items and have control.lua remove/add the other half, one being movement equipment and the other whatever you need? If you wanted to make it seamless you would need 3 items, though. A placement item, which gets converted into 2 items that look like one.

Basically you would insert for example a 4x8 item, the control.lua would replace it with 2 4x4's in the same area and when you remove one of the two it replaces the cursor item with the original item which is just a dummy. For the 1x1 plating that could be an issue, however.
Interesting idea. If you think it's possible to do that, then there's just a few other things to need to check:
That a negative movement modifier will work (to slow you down),
That the piggyback equipment could be made a 0x0 invisible part,
And for the armor idea, I'm not sure it's even possible as none of the current equipment modifies the physical durability. But perhaps it can be some type of non-powered shield or something.

Re: movement_bonus into other equipment type?

Posted: Wed Jan 27, 2021 10:46 pm
by adamwong246
I'm trying to do something similar- a reverse exoskeleton, that slows you down but charges your pack.

The problem is the prototypes don't easily allow for this. You have MovementBonusEquipment with the movement_bonus field and GeneratorEquipment with its power field.

So either you have to make a slow-exoskeleton with some extra scripting to charge the pack OR you can make a generator with some extra scripting to slow the player down.

I'm not sure which is more palatable.