Using another mods technology as a prerequisite

Place to get help with not working mods / modding interface.
Shapeshifters
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sun Nov 27, 2016 12:25 pm
Contact:

Using another mods technology as a prerequisite

Post by Shapeshifters »

Okay, so I'm trying to make a separate mod that adds an extra power armor mk4 to Rampant Arsenal, which is supposed to require the power armor MK3 from Rampant Arsenal.

However, even with Rampant Arsenal as a required dependency, the game keeps throwing up the error "power-armor-mk3" (which is the exact name of the power armor mk3 technology Rampant has in its Technologies.lua) does not exist.

What am I doing wrong? Any ideas?

Heres the mod below if anyone wants to take a look and try it with Rampant Arsenal.
Attachments
Rampant Armor MK4_0.0.1.zip
(33.07 KiB) Downloaded 74 times
Last edited by Shapeshifters on Tue Apr 28, 2020 3:44 am, edited 1 time in total.
Shapeshifters
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sun Nov 27, 2016 12:25 pm
Contact:

Re: Using another mods technology as a prerequisite

Post by Shapeshifters »

So from what I'm getting is I needed to add a require function to my data.lua for Rampant Arsenals lua files that define "power-armor-mk3". So I did this, I thought for sure that would work, and I'm still getting the same error in AssignID for some reason.. huh.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Using another mods technology as a prerequisite

Post by darkfrei »

Shapeshifters wrote: Tue Apr 28, 2020 3:43 am So from what I'm getting is I needed to add a require function to my data.lua for Rampant Arsenals lua files that define "power-armor-mk3". So I did this, I thought for sure that would work, and I'm still getting the same error in AssignID for some reason.. huh.
Rename it into the data-updates.lua
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Using another mods technology as a prerequisite

Post by steinio »

Hi,

i'm the first one who downloaded your attached file at all tolook really into it.
------------------------------------------------------------------------------------------------------------------------------

First i recognized is, you didn't named the folder right.
It has to have the same name like in the info.json, followed by an underscore and the version number.

info.json -> name: Rampant Armor MK4
zip name: Rampant Armor MK4_0.0.1
folder name: RampantArmorMK4_0.0.1 -> correct: Rampant Armor MK4_0.0.1
------------------------------------------------------------------------------------------------------------------------------

You don't need to require any file from other mods, requiring your own files can all happen in data.lua as you have set the correct dependency to RampantArsenal.
------------------------------------------------------------------------------------------------------------------------------

Now the real magic is the technology name. As you correctly found out the name in Technologies.lua. You overlooked the function in TechnologiesUtils. This function adds "rampant-arsenal-technology-" before the given name.
------------------------------------------------------------------------------------------------------------------------------

Currently i have a path error with your mod which i have to look into. Hopefully it's not because the spaces in your mod name.
I suppose you copied some code and forgot to change the image references.
prototypes\item\power-armor-mk4.lua - change

Code: Select all

icon = "__Power Armor MK4__/graphics/icons/power-armor-mk4.png",
to

Code: Select all

icon = "__Rampant Armor MK4__/graphics/icons/power-armor-mk4.png",
prototypes\technology\power-armor-mk4.lua - change

Code: Select all

icon = "__Power Armor MK4__/graphics/technology/power-armor-mk4.png",
to

Code: Select all

icon = "__Rampant Armor MK4__/graphics/technology/power-armor-mk4.png",
------------------------------------------------------------------------------------------------------------------------------

Not sure what your migration .json is for, do you like to share your intention?
------------------------------------------------------------------------------------------------------------------------------

Hint: For compatibility you could add "adv-generator" to equipment_categories in prototypes\equipment\equipment-grid2.lua
This allows to put the Nuclear Generator into the armor.
------------------------------------------------------------------------------------------------------------------------------

Tldr: Correct technology name is rampant-arsenal-technology-power-armor-mk3 instead of power-armor-mk3

Cu, steinio.
Attachments
Rampant Armor MK4_0.0.1.zip
(33.01 KiB) Downloaded 83 times
Image

Transport Belt Repair Man

View unread Posts
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Using another mods technology as a prerequisite

Post by darkfrei »

steinio wrote: Tue Apr 28, 2020 5:39 pm First i recognized is, you didn't named the folder right.
It has to have the same name like in the info.json, followed by an underscore and the version number.

info.json -> name: Rampant Armor MK4
zip name: Rampant Armor MK4_0.0.1
folder name: RampantArmorMK4_0.0.1 -> correct: Rampant Armor MK4_0.0.1
Note that mod portal doesn't accept new mods with spaces in the name.
So the name must be:
RampantArmorMK4 or Rampant-Armor-MK4 or Rampant_Armor_MK4
The same changes in folder name and zip file name.
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Using another mods technology as a prerequisite

Post by steinio »

darkfrei wrote: Tue Apr 28, 2020 7:14 pm
steinio wrote: Tue Apr 28, 2020 5:39 pm First i recognized is, you didn't named the folder right.
It has to have the same name like in the info.json, followed by an underscore and the version number.

info.json -> name: Rampant Armor MK4
zip name: Rampant Armor MK4_0.0.1
folder name: RampantArmorMK4_0.0.1 -> correct: Rampant Armor MK4_0.0.1
Note that mod portal doesn't accept new mods with spaces in the name.
So the name must be:
RampantArmorMK4 or Rampant-Armor-MK4 or Rampant_Armor_MK4
The same changes in folder name and zip file name.
How unfortunate.
Then the image references also need to be adjusted again...
Image

Transport Belt Repair Man

View unread Posts
Shapeshifters
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sun Nov 27, 2016 12:25 pm
Contact:

Re: Using another mods technology as a prerequisite

Post by Shapeshifters »

Thanks guys, I really appreciate you taking a look. I knew there was something I had to be missing in the original Rampant mod. I've got it all working now. The only thing left to do is modify some recipes and stuff to my liking.

As for the migrations: That's something I forgot to delete, I've actually just been modifying an existing mod called Power Armor MK4. Rampant actually already had some compatibility for it; except I didn't like that it ended up creating redundancies in there being two power Armor MK3's.
Post Reply

Return to “Modding help”