![]() |
Weather System - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Weather System (/showthread.php?tid=817) Pages:
1
2
|
Weather System - Matt2 - 09-03-2007 Always wanted weather for your game? Always thought you could do it yourself? Tried the weather from the old forms and aren't happy with it's results? You've come to the right place! This is from Konfuze's source, or whatever they wanna call it now..(Elysium... Diamond..?) Anyways... Don't add this unless you've saved your code. Level of Dificulty: 1/5(Just C&P and Understand...) First, and foremost, back up your code. Second, Open the Server. This is the only thing you have to add. Change Code: ' Lets change the weather if its time to To read Code: ' Lets change the weather if its time to That just checks for half a day(12 hours, irl) and changes the weather randomly. Also, uncomment this line Code: WeatherSeconds = WeatherSeconds + 1 That's important. Keeps the time for weather. Now, close the server. You're done with it. (AHMAGAWD, THAT WAS EASY!!1) Next, open the client. Open modDirectX. Put this in there Code: Sub BltWeather() And that should be it. If you have any problems whatsoever, or if I'm missing anything, please tell me. This is as easy as I could get it, ripped from Elysium to work for MSE. Sorry I can't explain what any of it does. I don't understand DirectX too well to do so. Maybe someone else could explain? - Coke - 09-03-2007 Err, i may be wrong but is there not a weather editing interface missing? - Matt2 - 09-03-2007 Nah. If they want more weather, they can build off this one. - Aleano - 10-03-2007 Isn't this DragoonsMaster's weather system which he released ages ago on the old forums. - Matt2 - 10-03-2007 No idea. Came from Konfuze. xD - GodSentDeath - 10-03-2007 In that case, yes, the rain it was based off of DragoonsMaster's code a while back =P He just had rain and I added other shit... But yeah, credit goes to him ![]() - Xlithan - 10-03-2007 Also if you add the weather command from Konfuze, don't forget to fix the security hole ![]() - Erik - 12-03-2007 You forgot to include the DropRainRec... Code: Type DropRainRec - Matt2 - 12-03-2007 Erik Wrote:You forgot to include the DropRainRec... Thank you. I edited and updated the tutorial. Heheh, nice catch. - GodSentDeath - 13-03-2007 GameBoy Wrote:Also if you add the weather command from Konfuze, don't forget to fix the security holelol yeah xD It's not really that bad though.... > - Ramsey - 13-03-2007 what the security hole? never hear about it would'nt this make a weather on every map even in a house? - Xlithan - 13-03-2007 You can extend this easily. Add a new type to maps (indoor), if the map is indoor don't use weather. I think this was in Deloria Source. The weather security hole was quite easy to fix. If you check the packet handler on the server you'll notice it doesn't properly check to see if a moderator is changing the weather, there's only a check on the client to see if a moderator has entered the command which means with a simple packet editor, anybody can change the weather. So make sure you do server checks as well as client checks. Very important - Sephiroth187 - 14-03-2007 What I dont like is how you are using a timer for the raindrop/snow drop. Use a function like GetTickCount Code: Public Declare Function GetTickCount lib "Kernel32" as long() Code: Global SnowDropTimer1 as long 'Our Tick based timer Put it somewhere Code: SnowDropTimer1 = GetTickCount + SnowDropTimer2 Code: If GetTickCount => SnowDropTimer1 Then ...Use the rest for your imagination ![]() [/code] - Matt2 - 15-03-2007 Not my code. xD This is just a straigt rip. ![]() - Sephiroth187 - 15-03-2007 Ooohhh ok. Anwyays timers arent that good to use, because they work on depending the computer speed not by..pure seconds. Dont want to cause any seizures now do we? ![]() - Dragoons Master - 17-03-2007 Lol, yeah, that's mine xD I'm not reading forums that frequently now... I just got into college and I don't have my computer here >< Omg , that's OLD xD Good luck with it. I still use it on my game and it works pretty good. - Slevin - 23-04-2007 Variable not Defined ![]() - Da Undead - 23-04-2007 Slevin, make sure that u have Function FileName and/or it defined in modTypes. (look at another blank source and compare/contrast) ---------- EDIT: Lmao when i just tried to add this i get samething rofl! ------------ EDIT AGAIN: Add this: Code: Dim FileName As String Under: Code: Dim DidWalk As Boolean Which is in the Sub GameAI() - Da Undead - 23-04-2007 In the Weather Packet, im having an error on AddText Says: Wrong number of arguments or invalid property assignment. Any idea? Heres my whole packet: Code: ' :::::::::::::::::::: ------------ Oh and the link for snow isn't working ![]() - Reece - 24-04-2007 Its because you don't "Add text" in MS. I'm not to sure but I think you need to change it to Code: Call globalmsg Check for other subs, maybe the attack one, and see how the broadcast a global message. And for the snow, make your own in paint. - Dragoons Master - 24-04-2007 Sry about all the bugs. That's very old but it was developed for my game, witch is quite different. - Da Undead - 25-04-2007 Update it xD. And for the GlobalMsg, already tried that and it gives me an error on it and says.. Wrong number of arguments or invalid property assignments ![]() ----------- EDIT: MAJOR FIX FOR IT! I fixed it, it just wansn't registering straight so i had compared it to a previous call add text, well heres the correct packet ![]() Code: If (LCase(Parse(0)) = "weather") Then - Styre - 30-04-2007 This doesn't really fix it,, I used your packet and I still have the error. --------------------------------------------------------------------------------- EDIT: I have a RTE 5: Invalid Procedure call or Argument at Line: Code: Call DD_BackBuffer.BltFast(DropSnow(i).x + DropSnow(i).Speed, DropSnow(i).y + DropSnow(i).Speed, DD_SnowSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) In Sub: [code] Sub BltWeather() Dim i As Long Call DD_BackBuffer.SetForeColor(RGB(0, 0, 200)) If GameWeather = WEATHER_RAINING Then For i = 1 To MAX_RAINDROPS If DropRain(i).Randomized = False Then If frmMirage.tmrRainDrop.Enabled = False Then BLT_RAIN_DROPS = 1 frmMirage.tmrRainDrop.Enabled = True If frmMirage.tmrRainDrop.Tag = "" Then frmMirage.tmrRainDrop.Interval = 200 frmMirage.tmrRainDrop.Tag = "123" End If End If End If Next i ElseIf GameWeather = WEATHER_SNOWING Then For i = 1 To MAX_RAINDROPS If DropSnow(i).Randomized = False Then If frmMirage.tmrSnowDrop.Enabled = False Then BLT_SNOW_DROPS = 1 frmMirage.tmrSnowDrop.Enabled = True If frmMirage.tmrSnowDrop.Tag = "" Then frmMirage.tmrSnowDrop.Interval = 200 frmMirage.tmrSnowDrop.Tag = "123" End If End If End If Next i Else If BLT_RAIN_DROPS > 0 And BLT_RAIN_DROPS - Da Undead - 30-04-2007 idk o-O, but i was just stating that the fix i posted was for the error on that packet cuz he uses a different way of adding text. - Matt - 30-04-2007 MS does use the addtext sub. Just search for it. Anything added without the addtext sub, is serverside. |