easy (i guess) mod request (entity clones)
how would i/could you make a mod that adds another companion cube entity, but with another sprite, i want this for my OoT mappack, to try to get rid of the portal items, but keeping it's functionality...
if someone could give me a simple explanation, if there is any, on how to "clone" entities with different sprites, it would be ideal.
if someone could give me a simple explanation, if there is any, on how to "clone" entities with different sprites, it would be ideal.
- Mr.Q.Marx?
- Posts: 849
- Joined: 15 May 2012, 18:35
Do you need the original cube in your mappack? If the answer is 'no' this is a simple spriteswap.
From way back when:
Basically do this, preferably changing "minimushroom" to "cucco" then when you make the cucco.lua copy the companion cube code into the file. That should do it.Qcode wrote:This going to be a long post so be patient. And it's going to be hard.
So now that you have your code editor installed you need unzip the source, mari0.love. You should get a folder with lots of .luas. Open the folder with your code editor. Now that that's ready you will need to edit the image in graphics/SMB/entities.png. If you want to you can just download this one that I have and use it. http://www.mediafire.com/?v08mqs9j8iffs77 You see the mushroom in the bottom left corner? You can simply use that and edit it to look like the mini mushroom. Once you have that done we can start writing our code. First you will want to look at entity.lua. There should be something that starts like thisAnd ends like thisCode: Select all
entitylist = {
You'll need to edit this to add another entity, the minimushroom. (this code assumes you're going to name everything the same way I do)Code: Select all
"checkpoint" }
So now it needs to look like thisI'm going to start using line numbers in this tutorial. There the little numbers on the left that tell you what line you're on.Code: Select all
"checkpoint", "minimushroom" }
So now go to line 207 still in entity.lua
You'll want to again press enter and add another description. So maybe like this.Now you'll need to start creating your own code. I may post something like this later, but for now you can make it up yourself. Make a new file in the mari0 folder called "minimushroom.lua" Without the quotes. I'd recommend copying in the entire mushroom code and then modifying it later.Code: Select all
"place on empty tile - checkpoint - mario will spawn there if he dies after reaching it", --"checkpoint" "place on a wall - minimushroom", }
After you've got all the code for the minimushroom go into game.lua. Go to line 920. Press enter then enter in this code.Now go to line 2053. Press Enter then enter in this codeCode: Select all
for j, w in pairs(objects["minimushroom"]) do w:draw() end
Now go to line 3803. Press enter then enter in this code.Code: Select all
objects["minimushroom"] = {}
Nows the last bit!Code: Select all
elseif i == "minimushroom" then table.insert(objects["minimushroom"], minimushroom:new(x-0.5, y-2/16))
Go to main.lua. At line 73 there should be quite a few things saying require "".
Press enter in there and put this code.After that you're done! Now if you havent modified the minimushroom.lua from the normal mushroom code then it will act just like a normal mushroom. This is expected. Now you can start actually modding stuff by playing around with code in the minimushroom.lua. If you need help with that stuff just ask.Code: Select all
require "minimushroom"
BTW this is how I made my mega mushroom mod found here viewtopic.php?f=8&t=2099
...
Last edited by Qcode on 21 Oct 2021, 09:08, edited 1 time in total.
http://dl.dropbox.com/u/17466990/mari0_1.6_2boxes.love
Use rightclick to set which graphic to use.
graphics/smb/box2.png
Use rightclick to set which graphic to use.
graphics/smb/box2.png
OMG thanks!Maurice wrote:http://dl.dropbox.com/u/17466990/mari0_1.6_2boxes.love
Use rightclick to set which graphic to use.
graphics/smb/box2.png
also, what .lua was editted, because in the final release of the mappack in question it'll use the more custom music mod...
you should put right click to change graphic in se
that would still liit the skins to whateer nuber would be added, it would be cool to be able to select what spriteset a enemy uses one by one, i mean castle, underground or overworld... but let's not derail this topic anymore, my answer has been answered, so please dont reply to this anymoreTurret Opera wrote:you should put right click to change graphic in se