| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| Switching ROOMS!; Here's the solution that works | |
|---|---|
| Topic Started: Nov 30 2007, 01:04 AM (2,426 Views) | |
| Links | Nov 30 2007, 01:04 AM Post #1 |
|
Member
![]() ![]() ![]() ![]()
|
This is old as the world, PLEASE SOMEONE FINALLY CLEARLY explain how to make room switching work without U3D crashing the game. Because all that was supposed to work led to a crash: with(all){ if(persistent==false) instance_destroy();} room_goto_next(); ==> CRASH external_call(global.u3d_cleanup); room_goto_next(); ==> CRASH room_goto_next(); ==> CRASH I don't have another Control object in the next room, I know it's persistent, anyone who has a clear idea please finally make it clear for everyone. |
![]() |
|
| Synexn-Prime | Nov 30 2007, 05:58 AM Post #2 |
|
Sierra Prime GF32 : Unit 7
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Do you have a camera? Could you describe the crashes for each code? Sometimes it's an "Unexpected Error", sometimes a freeze, and sometimes a 'non-render'. |
|
Synexn-Prime, the Bigger Sister. Prepare to watch her fly. Watch that tear shatter the steel. 2012. ![]() ![]() Current Stone: Water : Prepare to help her survive. June 2010. formerly known as skarik | |
![]() |
|
| Links | Nov 30 2007, 10:21 AM Post #3 |
|
Member
![]() ![]() ![]() ![]()
|
I have a camera. It's just a crash, no messages, game just stops responding. Did anyone ever maned to switch rooms while using U3D?? I've actually never seen it done. |
![]() |
|
| Dr. Best | Nov 30 2007, 05:55 PM Post #4 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I'll try to make this as clear and understandable as possible. Therefore two different problems need to be looked at. Problem 1, Switching from one room to another where both rooms use Ultimate 3D: First you have to make sure that both rooms have views enabled, that the primary view is enabled and that this view has the same dimensions in both rooms (e.g.: if it's 640*480 in the first room it has to be 640*480 in the second one too). The control object should be persistent, there shouldn't be a second control object in the second room and the camera should either be persistent too, or there should be one in both rooms. Then this piece of code can be placed in the room end event of the control object to get everything working correctly:
Switching rooms should be working without any problems then. Problem 2, switching from a room, which uses Ultimate 3D to a room which doesn't: Solution 1, recommended if Ultimate 3D needs to be used again lateron: This solution just disables the rendering output of Ultimate 3D temporarily and makes sure that all objects get destroyed correctly. Again the control object should be persistent! This code can be used in the room end event of the control object then:
If you want to switch Ultimate 3D back to enabled lateron just create a new camera object in a room that has views set up as described above and call SwitchView() again. Solution 2, if you don't want to use Ultimate 3D again before the game shuts down, usually not appreciated: This solution deinitializes Ultimate 3D completely, with all of it's objects. It doesn't matter whether the control object is persistent or not, it will destroy itself anyway. Use this code in the room end event of the control object:
I have tried none of the above solutions but in principle they should be working fine. If they don't please let me know, I'll fix the mistakes then. |
![]() |
|
| Links | Nov 30 2007, 06:39 PM Post #5 |
|
Member
![]() ![]() ![]() ![]()
|
Different room size - yes they had different sizes, now they're the same size, still crashes. Control is persistent, no two controls meeting, camera isn't, but there is one in the next room, still crashing. Added the code, it's working now. Thanks for the help. Great job on U3D. |
![]() |
|
| Linkin | Nov 30 2007, 09:41 PM Post #6 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That last one works fine except if i exit to menu and then play again 3 times it comes up with and error on not being able to create a Direct3d hardware device? |
![]() Want something done in Photoshop, make a request Here Formerly known as DS-Development. | |
![]() |
|
| Despellanion | Jan 5 2008, 09:54 PM Post #7 |
|
The Black Curtain
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I think I will pin this topic because I think it contains the best explanation on how to switch rooms. Now we maybe can avoid new room switching topics. |
![]() It's an MMORPG, you rtard! | |
![]() |
|
| ninja | Feb 11 2008, 04:30 AM Post #8 |
|
Elite Member
![]() ![]() ![]() ![]() ![]() ![]()
|
Thank Dr. Best, I wasn't having too much trouble with it stalling, but at least now I won't have work as hard. I hated having to add a room end event most of the objects in my game or telling the control object each specific thing to destroy when the player is leaving a room. :ph43r: |
![]() |
|
| daimenworrall | Feb 12 2008, 08:57 PM Post #9 |
|
Creator of The Dark Dimension
![]() ![]() ![]() ![]() ![]()
|
Doesnt work with the fire and water demo..... errors in the reflection cams and with the water (from the cam) |
![]() Dimension Five Server Programmer | |
![]() |
|
| Dr. Best | Feb 12 2008, 09:24 PM Post #10 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Well, if you take these objects out of the context they are supposed to be in it is not very surprising that you cause errors. Just look at the contents of the messages and see whether you can get them fixed. It most likely doesn't have to do with the room switching code itself. |
![]() |
|
| daimenworrall | Feb 13 2008, 07:36 PM Post #11 |
|
Creator of The Dark Dimension
![]() ![]() ![]() ![]() ![]()
|
Will do
|
![]() Dimension Five Server Programmer | |
![]() |
|
| detuhooja | May 5 2008, 10:01 PM Post #12 |
|
Advanced Killer
![]() ![]() ![]() ![]() ![]() ![]()
|
This doesn't work in u3d 2.1? I tried that in newest sdk and other examples. Of course i got this work older version of u3d. Get error: ___________________________________________ ERROR in action number 1 of Other Event: Room End for object control: Error in code at line 2: if(!persistent && u3d_type!=0){ at position 23: Unknown variable u3d_type |
| <-> | |
![]() |
|
| Dr. Best | May 6 2008, 04:43 PM Post #13 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
This solution requires that the option "Treat uninitialized variables as value zero" of Game Maker is enabled in the options of the Game Maker project. In Ultimate 3D 2.0 RC and earlier this was the case by default. You can either enable this option yourself now or you can use this modified code:
|
![]() |
|
| detuhooja | May 6 2008, 06:45 PM Post #14 |
|
Advanced Killer
![]() ![]() ![]() ![]() ![]() ![]()
|
Ok. Thanks, this new code work well |
| <-> | |
![]() |
|
| Gandalf20000 | Jul 5 2008, 08:49 PM Post #15 |
![]()
Enormous DirectX Newbie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I can't get this code to work:
I have uninitialized variables equal 0, so that's not the problem. When I try this, the game just crashes. |
![]() |
|
| Go to Next Page | |
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://209.85.48.18/static/1/pip_r.png)









10:10 PM Mar 20