Fidooop Posted March 10, 2015 Share Posted March 10, 2015 I am a wee lil bit tired of seeing thousands of lines being put to use for some stupid Maxwell Intro!and I'm also tired of drinking the tears of the 100s that want my help to write code so they can have a custom intro! well LOOK NO FURTHER! here's the LOVELY code completely redone with some serious LOOPING magic to get the size down and writing intros will become SUPER EASY You need to place all of the code into the modmain!This is the actual intros! you can have any amount of quotes per world and it won't matter! you could have 1 or you could have 100 my loops are smart enough to handle it! here's a small example of what you should do and how it works![1] = { --SANDBOX [1] = {1, "Hi!"}, --each quote's table will have 2 values! [2] = {2, "I'm Maxwell"}, --the number is how many seconds the quote will show! [3] = {3, "You will die now!"}, --the string is the quote itself... [4] = 4 --this last piece of the world's table will be Maxwells mood! 1=tux 2=coat 3=grumpy (it goes to 5)}GLOBAL.MOD_MAXWELL_INTROS = {wod = { --replace wod with your character's name and if you have more than 1 character simply make a new table within the MOD_MAXWELL_INTROS table with all the same contents but name it the other character's prefab name! my loops can handle endless characters![1] = { --SANDBOX[1] = {0, ""},[2] = {0, ""},[3] = {0, ""},[4] = {0, ""},[5] = {0, ""},[6] = {0, ""},[7] = {0, ""},[8] = {0, ""},[9] = {0, ""},[10] = {0, ""},[11] = 1},[2] = { --ADVENTURE_1[1] = {0, ""},[2] = {0, ""},[3] = {0, ""},[4] = {0, ""},[5] = {0, ""},[6] = {0, ""},[7] = {0, ""},[8] = {0, ""},[9] = {0, ""},[10] = {0, ""},[11] = 1},[3] = { --ADVENTURE_2[1] = {0, ""},[2] = {0, ""},[3] = {0, ""},[4] = {0, ""},[5] = {0, ""},[6] = {0, ""},[7] = {0, ""},[8] = {0, ""},[9] = {0, ""},[10] = {0, ""},[11] = 1},[4] = { --ADVENTURE_3[1] = {0, ""},[2] = {0, ""},[3] = {0, ""},[4] = {0, ""},[5] = {0, ""},[6] = {0, ""},[7] = {0, ""},[8] = {0, ""},[9] = {0, ""},[10] = {0, ""},[11] = 1},[5] = { --ADVENTURE_4[1] = {0, ""},[2] = {0, ""},[3] = {0, ""},[4] = {0, ""},[5] = {0, ""},[6] = {0, ""},[7] = {0, ""},[8] = {0, ""},[9] = {0, ""},[10] = {0, ""},[11] = 1},[6] = { --ADVENTURE_TWOLANDS[1] = {0, ""},[2] = {0, ""},[3] = {0, ""},[4] = {0, ""},[5] = {0, ""},[6] = {0, ""},[7] = {0, ""},[8] = {0, ""},[9] = {0, ""},[10] = {0, ""},[11] = 1},[7] = { --ADVENTURE_5[1] = {0, ""},[2] = {0, ""},[3] = {0, ""},[4] = {0, ""},[5] = {0, ""},[6] = {0, ""},[7] = {0, ""},[8] = {0, ""},[9] = {0, ""},[10] = {0, ""},[11] = 1}}} Now you are going to want a table with each and every one of your mod's characters! oh yeah... my loop's able to handle more than 1 character! GLOBAL.ModCharacters = { "wod" } --replace wod with your character's prefab name! and add other prefab names for your other characters!local P = GLOBAL.GetPlayerlocal INT = GLOBAL.MOD_MAXWELL_INTROSlocal tonumber = GLOBAL.tonumber local function ModMaxwellIntro(inst)local Maxtalk = inst.components.maxwelltalker.speechesfor k,v in pairs(GLOBAL.ModCharacters) doif P().prefab == v thenlocal INTROS = {}for o = 1,7 dolocal S = INT[v][o][#INT[v][o]]local D = 0if o == 1 thenD = 0elseif o > 1 thenD = 2endif S == 1 thentable.insert(INTROS, {delay = D,appearsound = "dontstarve/maxwell/disappear",voice = "dontstarve/maxwell/talk_LP",appearanim = "appear",idleanim= "idle",dialogpreanim = "dialog_pre",dialoganim="dial_loop",dialogpostanim = "dialog_pst",disappearanim = "disappear",disableplayer = true,skippable = true})elseif S > 1 thentable.insert(INTROS, {delay = D,appearsound = "dontstarve/maxwell/appear_adventure",voice = "dontstarve/maxwell/talk_LP_world"..S,appearanim = "appear"..S,idleanim = "idle"..S.."_loop",dialogpreanim = "dialog"..S.."_pre",dialoganim ="dialog"..S.."_loop",dialogpostanim = "dialog"..S.."_pst",disappearanim = "disappear"..S,disableplayer = true,skippable = true})endfor i = 1,(#INT[v][o] - 1) dotable.insert(INTROS[o], {string = INT[v][o][2],wait = INT[v][o][1]})endendMaxtalk.SANDBOX_1 = INTROS[1]Maxtalk.ADVENTURE_1 = INTROS[2]Maxtalk.ADVENTURE_2 = INTROS[3]Maxtalk.ADVENTURE_3 = INTROS[4]Maxtalk.ADVENTURE_4 = INTROS[5]Maxtalk.ADVENTURE_TWOLANDS = INTROS[6]Maxtalk.ADVENTURE_5 = INTROS[7]endendend AddPrefabPostInit("maxwellintro", ModMaxwellIntro) Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted March 10, 2015 Developer Share Posted March 10, 2015 Oh thank you, this is going to help me a lot!You're amazing dude! Link to comment Share on other sites More sharing options...
Fidooop Posted March 10, 2015 Author Share Posted March 10, 2015 mah god everyone and their mother is going to have a custom intro now... what have I done? O_O Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted March 10, 2015 Developer Share Posted March 10, 2015 mah god everyone and their mother is going to have a custom intro now... what have I done? O_O A great thing to humanity. Link to comment Share on other sites More sharing options...
WalrusMan Posted March 13, 2015 Share Posted March 13, 2015 So, typing [2] will give Maxwell a coat? Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted March 14, 2015 Developer Share Posted March 14, 2015 So, typing [2] will give Maxwell a coat? Example: [1] = { --SANDBOX[1] = {1, "So, Walrus Man"},[2] = {3, "You want to learn how to make me wear a coat?"},[3] = {1, "Simple."},[4] = {2, "Do you see the first number up there?"},[5] = {2, "Before the big \"SANDBOX\" word?"},[6] = {2, "That marks the \"world\" you're currently in right now."},[7] = {2, "1, would be sandbox."},[8] = {2, "2 would be adventure world 1."},[9] = {3, "And the other numbers the other adventure worlds."},[10] = {4, "The numbers before my quote are the seconds I'll take to say my quote."},[11] = {4, "And the ones before the \"=\" define the order I'll be saying my quotes."},[12] = {5, "This is my 12th quote, I'll take 5 seconds to say it and I'll say it while wearing my dapper coat."},[13] = {3, "Now that you have learned the basics."},[14] = {3, "Allow me to teach you what you wanted to know all along."},[15] = {5, "After all my speech you should open a last speech value, like if I was actually going to speak."},[16] = {3, "That'll be my form, the \"Maxwell\" I'll appear as."},[17] = {5, "1 would be dapper me, 2 would be me wearing a coat! all you need is a plain old lonely number there and you'll be fine!"},[18] = {3, "I should end my speech here, oh, and remember!"},[19] = {3, "Find something to eat before night comes."},[20] = 2} Link to comment Share on other sites More sharing options...
Fidooop Posted March 14, 2015 Author Share Posted March 14, 2015 Example: Donuts Thanks for the example man! didn't know a real good way to explain it to people who don't know too much about code! Link to comment Share on other sites More sharing options...
Coski Posted March 14, 2015 Share Posted March 14, 2015 Maybe one day ... I will know something about codes.That day I will tr your tutorial. Link to comment Share on other sites More sharing options...
WalrusMan Posted March 14, 2015 Share Posted March 14, 2015 It didn't work for me for some reason, I guess I'll just go back to the STRINGS.MAXWELL_SANDBOXINTRO one :I Link to comment Share on other sites More sharing options...
Mobbstar Posted March 14, 2015 Share Posted March 14, 2015 Example:mind = blown That's good! Mind if I put it on the (unofficial) DS API Docs? By the way, you can register there and easily put up tutorials for everyone to see (on the respective page, or by making a new one). Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted March 14, 2015 Developer Share Posted March 14, 2015 That's good! Mind if I put it on the (unofficial) DS API Docs? By the way, you can register there and easily put up tutorials for everyone to see (on the respective page, or by making a new one). Hey, unofficial DS API? That's awesome! Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted March 14, 2015 Developer Share Posted March 14, 2015 It didn't work for me for some reason, I guess I'll just go back to the STRINGS.MAXWELL_SANDBOXINTRO one :I Didn't work? Are you sure you did exactly what the tutorial told you to do and that you've put everything in the right place? Link to comment Share on other sites More sharing options...
WalrusMan Posted March 14, 2015 Share Posted March 14, 2015 Does this go into the modmain as well?local P = GLOBAL.GetPlayerlocal INT = GLOBAL.MOD_MAXWELL_INTROSlocal tonumber = GLOBAL.tonumber local function ModMaxwellIntro(inst)local Maxtalk = inst.components.maxwelltalker.speechesfor k,v in pairs(GLOBAL.ModCharacters) doif P().prefab == v thenlocal INTROS = {}for o = 1,7 dolocal S = INT[v][o][#INT[v][o]]local D = 0if o == 1 thenD = 0elseif o > 1 thenD = 2endif S == 1 thentable.insert(INTROS, {delay = D,appearsound = "dontstarve/maxwell/disappear",voice = "dontstarve/maxwell/talk_LP",appearanim = "appear",idleanim= "idle",dialogpreanim = "dialog_pre",dialoganim="dial_loop",dialogpostanim = "dialog_pst",disappearanim = "disappear",disableplayer = true,skippable = true})elseif S > 1 thentable.insert(INTROS, {delay = D,appearsound = "dontstarve/maxwell/appear_adventure",voice = "dontstarve/maxwell/talk_LP_world"..S,appearanim = "appear"..S,idleanim = "idle"..S.."_loop",dialogpreanim = "dialog"..S.."_pre",dialoganim ="dialog"..S.."_loop",dialogpostanim = "dialog"..S.."_pst",disappearanim = "disappear"..S,disableplayer = true,skippable = true})endfor i = 1,(#INT[v][o] - 1) dotable.insert(INTROS[o], {string = INT[v][o][2],wait = INT[v][o][1]})endendMaxtalk.SANDBOX_1 = INTROS[1]Maxtalk.ADVENTURE_1 = INTROS[2]Maxtalk.ADVENTURE_2 = INTROS[3]Maxtalk.ADVENTURE_3 = INTROS[4]Maxtalk.ADVENTURE_4 = INTROS[5]Maxtalk.ADVENTURE_TWOLANDS = INTROS[6]Maxtalk.ADVENTURE_5 = INTROS[7]endendend AddPrefabPostInit("maxwellintro", ModMaxwellIntro) Link to comment Share on other sites More sharing options...
Fidooop Posted March 14, 2015 Author Share Posted March 14, 2015 yes that is very important...That's good! Mind if I put it on the (unofficial) DS API Docs? By the way, you can register there and easily put up tutorials for everyone to see (on the respective page, or by making a new one).go ahead! any type of advertisement is lovely! I hate thousand line maxwell intros! Link to comment Share on other sites More sharing options...
WalrusMan Posted March 31, 2015 Share Posted March 31, 2015 Is there a way to change the Adventure Mode Conversation at the end using this? Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted March 31, 2015 Developer Share Posted March 31, 2015 Is there a way to change the Adventure Mode Conversation at the end using this?I don't think so, no...I don't think this loop can alter those...I might be wrong, though. EDIT: Nope, I was wrong. Link to comment Share on other sites More sharing options...
Mobbstar Posted March 31, 2015 Share Posted March 31, 2015 I don't think so, no...I don't think this loop can alter those...I might be wrong, though. Well, the end speech is in STRINGS if I recall correctly, so theoretically you can alter it. Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted March 31, 2015 Developer Share Posted March 31, 2015 Well, the end speech is in STRINGS if I recall correctly, so theoretically you can alter it.Yeah, I just talked with Fidooop and realized I was wrong. Link to comment Share on other sites More sharing options...
WalrusMan Posted April 1, 2015 Share Posted April 1, 2015 So, how do you change the end speech using this? Link to comment Share on other sites More sharing options...
xIMattyyx Posted April 21, 2015 Share Posted April 21, 2015 When i tryed this it doesn't work. but where about do i put the code in the modmain? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.