|
Post by mx on Jun 5, 2016 2:53:51 GMT
Question; i'm interested in trying my hand at modding but i have no programming experience apart from some small year 12 experience with visual basic. Is this a challenge that would require a college course in programming to do or are there some websites i could hit up for the basic modding knowledge that i can experiment with? (I put this here as i didn't want to start a whole knew thread for such a newbie question)
Modnote: Moved thread out of goodness of heart
TIPS I'VE LEARNED SO FAR! - Actually having the Lua program helps a lot over trying to mod the code through notepad - You can add new microbes in the latest version by looking at the scripts/microbe_stage/configs.lua file. * Organelles are placed via this grid i.imgur.com/kTxHFMC.png * Extra hexagons on organelles larger than 1 hex big rotate counterclockwise with the rotate value. Each hex counterclockwise = 60 * Incorrectly placing organelles may cause crashing on startup eg. placing a 2 hex organelle over another organelle (to be confirmed) + Nucli q,r coordinates placed at 0,0 (-1,-1; 1,-0; -1,1; 0,-2; 0,-1; 0,0; 0,1; 1,-2; 1,-1; 1,0) + Mitocondria extra hex is one above placement ie placed at 0,0 the coodinates would be (0,0; 0,1) - Microbe Ai is messy and predator behavior is controlled via microbe name. You can make your microbe hunt the player by modifying the microbe_ai file inserting; or microbe.microbe.speciesName == "yournamehere" * next to microbe.microbe.speciesName == "predator" if your microbe shoots oxy or next to microbe.microbe.speciesName == "gluttonus" if it devours things. * You will need to add this code next to all spots with this code 2 or 3 depending on if its an oxy or devourerer * Remember to replace yournamehere with the name of your microbe from the config file - There is a lot of junk code to do with emitters which which have been taken out of the latest version to be replaced with clouds- The processing of chemicals from chemical clouds cannot be programmed through editing lua files, recompiling the source is required for this (Personally i don't know whats involved in recompiling yet)
|
|
|
Post by Moopli on Jun 5, 2016 5:26:30 GMT
A college course in programming would certainly help, as it is useful to know how to program if you want to modify any scripts, but there is a lot you can do even if you're not that confident in your skill.
I don't quite recall if this was put in yet (someone will have to correct me if I'm wrong), but I think that you can add new microbes in the latest version by looking at the scripts/microbe_stage/configs.lua file. It's a script written in Lua, a programming language which we use for our game scripting. If you scroll down there, you can take a look at the definitions for the default AI microbes and modify those if you like. You can also define new compounds and processes, though I'm not sure if that version has that stuff totally working, but if you want to create new organelles there's quite a bit more you would have to do.
You can mod certain parts of the graphics easily -- for example, edit gui/layouts/MainMenu.layout to modify where the main menu buttons are placed, or edit gui/imagesets/ThriveGeneric.png to change how various elements of the interface look. You can do more complicated things by learning more about CEGUI (the system that Thrive uses for handling the interface). To edit what happens when you interact with a button, you would have to modify some more scripts.
|
|
namoon
Sentient
Dead
Posts: 53
|
Post by namoon on Jun 5, 2016 6:13:21 GMT
When I try coding a microbe, it crashes upon opening the game. Is there anything I'm doing wrong?
|
|
|
Post by Moopli on Jun 5, 2016 15:32:22 GMT
Well, it's either that you're doing something wrong or we have a bug, so first you'll have to say what changes you made and we can go from there.
|
|
|
Post by mx on Jul 16, 2016 10:46:17 GMT
Finally got around to trying this out. Here is what I have been able to do so far via mooplis instructions; >Turn off and on predators with the frequency regulator >Edit the predator so it has a flagellum where the oxytoxy was (hilarious as they still chase you down to lick you with their front tentacle) >Make a new cell with only nucli and vacuole namoon the first two times I added organisms my game crashed same as yours but I decided to go to the super simple for my 3rd and it worked. I'm thinking that colliding organelles in new organisms cause the crash as I know some organelles are more than 1 hex but don't know how to determine which way 'extra hexs' will sprout. Questions; Are tips or "where to begin" to deciphering the ai code? Is there a piece of code somewhere that says organism X is predator that can be switched on and off?(I had assumed that behavior was linked to the organelles and it seemed like it in the microbe ai file but the way the predators still came for me would beg to differ) Also for the microbe modding how do you know the orientation of extra hexs in organelles more than 1 hex large eg mitochondria or the nucli?Thank you
|
|
|
Post by Moopli on Jul 20, 2016 14:29:01 GMT
github.com/Revolutionary-Games/Thrive/blob/master/scripts/microbe_stage/microbe_ai.lua#L153The AI code is currently very ugly, since we don't actually have any sort of state stored in the microbe that determines what AI behaviour it will use; and instead we just check the microbe's species' name. There's also a lot of code in that function which is designed to search for emitters, since we have not updated it to work with the compound clouds yet. As for extra hex orientation, right now I'm not sure if there's any easy way to do it.
|
|
|
Post by mx on Jul 21, 2016 12:46:34 GMT
Haha i think i figured out how the first multi cellular organisms came into being - a newbie programmer gave it a couple hours tonight trying to give the microbes a stored behavior state and switching the ai code over to use it. basically I; looked for wherever speciesName = "" and put another line for predatortype = "" in the microbe file Put another field in for predatortype in each microbes registry in the same format as the organelles in the config file and then switched microbe.microbe.speciesName = "" with microbe.microbe.predatortype = "" in the microbe ai file I was happily suprised that my game kept working all the way through but I couldnt get the preds to lock on or attack me with that system. All the microbs kinda just formed a big ball and slowly starved to death (even the non preds) I think most probable cause would be 1. in my 2nd step having copied the organelle type field in the same area as the organelles means that microbe.microbe.predatortype = "" isint looking in the right place for the string in the "" 2. ive waaaayy underestimated how deeply you have to go into the code to create a stored state Questions;Assuming 1. is correct How would i tell the microbe ai file to pull the string from the microbes organelle string? (If i get that i can just change it to predatortype as its in the same spot) Any ideas or tips? Also thank you for the help so far, I know my curious mind is probably harder to satisfy then just putting a state in yourself but I appreciate you indulging it as i'm finding it very interesting to play around in the code. EDIT; Rethought this and i'll try just adding the names of the microbes I want as predators to the ai file instead of trying to make a new predator state
|
|
|
Post by mx on Jul 23, 2016 23:44:01 GMT
I have this problem when I try uploading microbe ai file. I've check that the file is the right size and Oliveriver has told me in shouts there should be no restrictions to the files themselves.. any ideas? Thank you (Also my first mod is now up in the "post your mods here" section
|
|
|
Post by Narotiza on Jul 24, 2016 1:36:07 GMT
I have this problem when I try uploading microbe ai file. I've check that the file is the right size and Oliveriver has told me in shouts there should be no restrictions to the files themselves.. any ideas? Thank you (Also my first mod is now up in the "post your mods here" section Perhaps it doesn't allow that type of file? Try hosting it on Dropbox or something like that.
|
|
|
Post by mx on Jul 24, 2016 1:54:56 GMT
Perhaps it doesn't allow that type of file? Try hosting it on Dropbox or something like that. I will thanks , but I think that is not the problem because I managed to upload the config file which was also a .lua file just fine.
|
|
|
Post by Oliveriver on Jul 24, 2016 7:44:10 GMT
Is it larger than 1MB by any chance? It also certainly isn't, but that would be the first thing to check.
|
|
|
Post by mx on Jul 24, 2016 7:47:58 GMT
Only 11KB i've dropboxed it in the add mods section so you can see the file
|
|
|
Post by Oliveriver on Jul 24, 2016 14:33:42 GMT
I thought it could have been a problem with having an underscore in the file name, but no, trying it myself all the other files work except microbe_ai.lua. I've no idea what the problem is.
|
|
|
Post by ThreeCubed on Aug 3, 2016 7:38:51 GMT
Hey Mx, I was looking around on youtube for lua tutorials (like you wanted), theres a guy called Spastic Kangaroo, he also makes a simple game with lua aswell, so it's a good Segway series, I'm following it too so I just recommended him
|
|
|
Post by mx on Aug 27, 2016 6:55:49 GMT
So im trying to mod in some poison clouds (ill think of an element bad for cells later i just wat to see if i can do it). I have successfully created a compound cloud which will allow you to collect compound 'xxx' but run into a wall as far as making the cell process the compound or having the compound cause damage. Firstly; Any tips to get the process working? even without causing damage would help my understanding. Secondly how would you script damage, possibly in the output of the process? this code is from the config file, i couldn't find any other code for processes, i've called the process 'poison' configs.lua (10.65 KB)
|
|
|
Post by TheCreator on Aug 27, 2016 19:00:14 GMT
Lol, I spent 2 weeks working on that. Since it's not an in game functionality at the moment, moding Lua scripts will get you nowhere. You actually need to recompile the source to add a system that does that for you.
|
|
|
Post by mx on Aug 27, 2016 22:10:56 GMT
wow, that sounds way out of my scope. Thanks for the heads up thou
|
|