retrogamer97 Posted October 16, 2022 Im honestly surprised no one came up with this idea yet. Anyone knows how to go about making a mod where skyboxes are randomly chosen upon the level? I know this may make maps look weird but im planning to use cloudy/night maps to go with rain and darkdoom. Any ideas? 0 Quote Share this post Link to post
Rifleman Posted October 16, 2022 (edited) I whipped up a simple solution for that, using LOADACS to load a script: #library "SkyChanger" #include "zcommon.acs" str SkyTex[3] = {"RSKY1", "RSKY2", "RSKY3"}; script 1 OPEN { str i = Random(Skytex[0], Skytex[2]); ChangeSky(i, i); } Similar thing could be done using ZScript. Attached the test file. SkyChanger.zip Edited October 16, 2022 by Rifleman 2 Quote Share this post Link to post
retrogamer97 Posted October 17, 2022 (edited) I tried that code and it works but all the skies in game are NULL as in white/blue tiles. I am sure the sprites are spelled correctly but maybe it a file path issue? #library "SkyChanger" #Include "zcommon.acs" str SkyTex[40] = { "skytile2","skytile","WRKSKY14","8798_BK","8611_LF","WRKSKY02", "VP1SKY13_vseamless","STARSKY5","STARSKY1","STARETH3","SNSSKY16","SNSSKY14","SNOSKY08","SNOSKY06","SNOSKY05","SNOSKY01","SNOSKY02","REFSKY14","CLUDSKY12","CTYSKY02","CTYSKY05","CTYSKY09","DBSESKY1","DIMSKY4","DNEBSKY4","DNESKY10","DSKSKY02","DUSKSKY3","DUSTSKY1","FALSKY01","HCLDSKY1","HDRKSKY1","HORISKY4","LTNSKY05","MUNSKY01","MUNSKY06","NEBUSKY6","NEBUSKY4","NULSKY07","magsky_base"}; // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 script 1 OPEN { int i = Random(0,39); ChangeSky(skytex, skytex);} Edited October 17, 2022 by retrogamer97 0 Quote Share this post Link to post
ramon.dexter Posted October 17, 2022 (edited) Yeah, when copying code, copy it exactly as it is. You've defined string arrays, but in the function you refer only to strings. Then, you're making some string i, filling it with random integer 0 to 39. Than, in ChangeSky(), you're referring to undefined vars 'skytex'. Does this code even compile? I dont want to be rude, but this is not code. This is just random gibberish. Please, take a look at Rifleman made the script, copy it as it is and only change contents of the array... Edited October 17, 2022 by ramon.dexter 0 Quote Share this post Link to post
retrogamer97 Posted October 17, 2022 (edited) im sorry it does compile , thats an old version im so sorry. Ill edit it to the current version. Only issue is that every sky in game is NULL. EDIT : For some reason when I edit the code above doomworld won't let me post square brackets......., im busy rn but ill try his way later and see if it fixes the NULL skies. Edited October 17, 2022 by retrogamer97 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.