movement_bonus into other equipment type?

Place to get help with not working mods / modding interface.
Post Reply
AutoMcD
Fast Inserter
Fast Inserter
Posts: 214
Joined: Wed Apr 27, 2016 5:53 pm
Contact:

movement_bonus into other equipment type?

Post 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?

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: movement_bonus into other equipment type?

Post 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)

AutoMcD
Fast Inserter
Fast Inserter
Posts: 214
Joined: Wed Apr 27, 2016 5:53 pm
Contact:

Re: movement_bonus into other equipment type?

Post 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?

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: movement_bonus into other equipment type?

Post 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)

AutoMcD
Fast Inserter
Fast Inserter
Posts: 214
Joined: Wed Apr 27, 2016 5:53 pm
Contact:

Re: movement_bonus into other equipment type?

Post by AutoMcD »

With the changes in 0.14 that just hit, do you guys think this is possible now?

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: movement_bonus into other equipment type?

Post 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.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: movement_bonus into other equipment type?

Post by orzelek »

Acording to FF'f it is.
Someone needs to make a mod and test it out :D

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: movement_bonus into other equipment type?

Post 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

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: movement_bonus into other equipment type?

Post 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.

ShinyAfro
Inserter
Inserter
Posts: 27
Joined: Mon Jan 04, 2016 1:27 pm
Contact:

Re: movement_bonus into other equipment type?

Post 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.

AutoMcD
Fast Inserter
Fast Inserter
Posts: 214
Joined: Wed Apr 27, 2016 5:53 pm
Contact:

Re: movement_bonus into other equipment type?

Post 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.

User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Re: movement_bonus into other equipment type?

Post 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.

Post Reply

Return to “Modding help”