killbot5555678 Posted December 13, 2015 Share Posted December 13, 2015 hello today i thought to myself thinking about some of the motors i have in my game if you were to get in between the two spinning motors it will put them out of place sometimes causing the course to be impossible which got me thinking when you died from falling off the off place motors and got positioned at the start.... the map never actually reloads you just get re positioned which still makes the course impossible being that this can make a lvl impossible it makes a pretty annoying bug...... so what im saying is if you got in between two motor caused it to be out of place (not lining up with the next platform) it would be very difficult to get further so i ask is there any easy way to make the map refresh with a simple key binding or do i have to integrate my main script (which loads the lvl) into my player so when he dies it just reloads the entire thing? thank you very much for any feed back in advance (ps i haven't tried to fix this yet just wanted to hear some feed back on an easy and quick fix) Quote Link to comment Share on other sites More sharing options...
Rick Posted December 13, 2015 Share Posted December 13, 2015 In the scripts that are attached to the things that matter in the game, in the Start() function you could save off the position/rotation. Then make your own Reset() function that resets it's position/rotation and any other state you care about. Then you just need a way to callthis Reset() function on entities that have it defined. You could do this a various number of ways. I guess the easiest would be to just loop over every entity in the world and if it has a script attached and that script has a Reset function then call it. You could obviously reload the map if you like as well but that'll take longer for the player to wait depending on how large your maps are. It would be kind of nice if this reset function method is something that could be in the engine itself. Call something like World:Reset() which would trigger a Reset() function for every script. 1 Quote Link to comment Share on other sites More sharing options...
killbot5555678 Posted December 13, 2015 Author Share Posted December 13, 2015 thank you Rick the maps are small enough that it would load quickly i dont exactly know how to reset the map (that exact lvl) could you possible give an example and or an easy method this isnt exactly a big problem so its not to dire to me so an easy simple quick fix is what im after..... Quote Link to comment Share on other sites More sharing options...
reepblue Posted December 13, 2015 Share Posted December 13, 2015 It would be kind of nice if this reset function method is something that could be in the engine itself. Call something like World:Reset() which would trigger a Reset() function for every script. I can make this happen in LEX easily. Thanks for the idea. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Einlander Posted December 14, 2015 Share Posted December 14, 2015 Take a look at this. http://www.leadwerks.com/werkspace/blog/120/entry-1414-playing-around-with-near-real-time-map-edititng/ It's probably what you are talking about. There is code there to get started. Let me know if you need help. Since leadwerks no longer has an app loop it will need to be edited a bit. Quote Link to comment Share on other sites More sharing options...
Rick Posted December 14, 2015 Share Posted December 14, 2015 If easy is what you want then just reload the map by setting the changemapname variable to the map name you want to reload anywhere in your code. Quote Link to comment Share on other sites More sharing options...
killbot5555678 Posted December 30, 2015 Author Share Posted December 30, 2015 If easy is what you want then just reload the map by setting the changemapname variable to the map name you want to reload anywhere in your code. thank you for your feedback and einlander also thank you for yours both ideas are helpful im trying to make it so when the player dies the map refreshes upon his death Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.