| |
UM engine lag fix, a code by hello
The Damizean |
|

Standard Member

Group: Members
Posts: 73
Member No.: 3744
Joined: 8-May 07
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
Hello there, fellow MFGGers:
There's a better way to handle the object activation. On my engines, I use a parent object called objParentDeactivable, wich is set as the parents for all the other parent kinds (Solid, Items, etc). This way, I only need to deactivate all objParentDeactivable, and then activate the region again.
Solves the problem of deactivating objects that the controller shouldn't and is a heck lot less of checks for the GM engine.
Here's the code:
| CODE | instance_deactivate_object(objParentDeactivable); instance_activate_region(view_xview-64, view_yview-64, view_wview+128, view_hview+128, true); |
Hope this helps. Just try it out and decide wich works better.
-See ya!
Edit: Little typo on height activation area.
This post has been edited by The Damizean on May 8 2007, 07:33 PM
--------------------
Signature prototype
|
|
|
Grant |
|

John Freeman said
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (2) [*]](https://archive.mfgg.net/html/badges/scg2.gif) ![Sprite Comp Top 5 Badge (2) [*]](https://archive.mfgg.net/html/badges/sct2.gif) ![Drawing Comp Winner Badge (2) [*]](https://archive.mfgg.net/html/badges/dcg2.gif) ![Drawing Comp Top 5 Badge (1) [*]](https://archive.mfgg.net/html/badges/dct1.gif)
![Minigame Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/mcg1.gif) ![Minigame Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/mcr1.gif) ![Secret Santa Badge [*]](https://archive.mfgg.net/html/badges/present.gif)

Group: Members
Posts: 8260
Member No.: 2900
Joined: 31-October 06
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
| QUOTE (The Damizean @ May 8 2007, 08:04 PM) | Hello there, fellow MFGGers:
There's a better way to handle the object activation. On my engines, I use a parent object called objParentDeactivable, wich is set as the parents for all the other parent kinds (Solid, Items, etc). This way, I only need to deactivate all objParentDeactivable, and then activate the region again.
Solves the problem of deactivating objects that the controller shouldn't and is a heck lot less of checks for the GM engine.
Here's the code:
| CODE | instance_deactivate_object(objParentDeactivable); instance_activate_region(view_xview-64, view_yview-64, view_wview+128, view_hview+64, true); |
Hope this helps. Just try it out and decide wich works better.
-See ya!
|
That sounds like a really good idea. Seriously.
Welcome to MFGG! And great first post.
--------------------
| QUOTE (oh youtube trolls) | | u guys r retarded hippocrates |
| QUOTE (Piemanthe3rd) | | Pie is not random. I wish people would realize this. |
|
|
|
Morshu McPhereson |
|

Who's got the sweetest disposition?
![Sprite Comp Top 5 Badge (2) [*]](https://archive.mfgg.net/html/badges/sct2.gif)

Group: Members
Posts: 20184
Member No.: 685
Joined: 23-November 04
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
| QUOTE (The Damizean @ May 8 2007, 07:04 PM) | Hello there, fellow MFGGers:
There's a better way to handle the object activation. On my engines, I use a parent object called objParentDeactivable, wich is set as the parents for all the other parent kinds (Solid, Items, etc). This way, I only need to deactivate all objParentDeactivable, and then activate the region again.
Solves the problem of deactivating objects that the controller shouldn't and is a heck lot less of checks for the GM engine.
Here's the code:
| CODE | instance_deactivate_object(objParentDeactivable); instance_activate_region(view_xview-64, view_yview-64, view_wview+128, view_hview+64, true); |
Hope this helps. Just try it out and decide wich works better.
-See ya!
|
Haha, I'm an idiot for not thinking of that. Great idea.
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
[ Script Execution time: 0.0998 ] [ 14 queries used ] [ GZIP Enabled ] [ Server Load: 1.68 ]
| |