Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Deactivating objects out of view.[SOLVED], GM6 Help.
United States
frosty
  Posted: Oct 28 2006, 07:35 PM
Quote Post


Regular


Group Icon
Group: Members
Posts: 120
Member No.: 2605
Joined: 1-September 06

Status: (0d) [--]


Like there is a goomba outside Mario's view. How do you deactivate the goombas outside Mario's view. Like not make the goomba move until you get to them..know what i'm saying? biggrin.gif [SOLVED]

This post has been edited by frosty on Oct 29 2006, 10:32 AM


--------------------
user posted image
PM
Top
United States
Captain Jeff Silvers
Posted: Oct 28 2006, 07:43 PM
Quote Post


Admins Can Do That!™
[A][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Admins
Posts: 30098
Member No.: 9
Joined: 13-October 03

Status: (0d) [--]


What program are you using?

Either way, it's probably as simple as just having them not move when they're so many pixels away from Mario's X position in either direction.


--------------------
user posted image user posted image
PMEmail Poster
Top
Unspecified
Hatman
Posted: Oct 28 2006, 07:53 PM
Quote Post


The astro craaag
[*][*][*][*][*]
[*][*][*][*][*]
[*]

Group Icon
Group: Members
Posts: 10223
Member No.: 2510
Joined: 16-August 06

Status: (0d) [--]


QUOTE (Captain Jeff Silvers @ Oct 28 2006, 07:43 PM)
What program are you using?

Either way, it's probably as simple as just having them not move when they're so many pixels away from Mario's X position in either direction.

Ehhh... that could work. Or you could try this...

CODE
{
 instance_activate_all();
 instance_deactivate_region(view_xview[0],view_yview[0],
                       view_wview[0],view_hview[0],false,true);
}


Under your character's step event.
PMEmail PosterUsers WebsiteIntegrity Messenger IMAOLYahooMSN
Top
United States
frosty
Posted: Oct 28 2006, 09:56 PM
Quote Post


Regular


Group Icon
Group: Members
Posts: 120
Member No.: 2605
Joined: 1-September 06

Status: (0d) [--]


Gotta sleep i'll try it tommarow. smile.gif


--------------------
user posted image
PM
Top
Belgium
flipiberke
Posted: Oct 29 2006, 03:30 AM
Quote Post


Filiberke+Flip=Flipiberke!
[*][*][*]

Group Icon
Group: Members
Posts: 700
Member No.: 2132
Joined: 28-May 06

Status: (0d) [--]


I don't like those deactivate events. Usually I use this

I make a script called

script_inscreen

/// Check if inscreen
if (x+sprite_width > view_xview[0]) && (x-sprite_width < view_xview[0]+view_wview[0]) return true; else return false;

/// Then in the goomba

if (script_inscreen() == true) && (hspeed == 0)
{
if (obj_mario.x < x) then hspeed := -2; else hspeed := 2;
}
else
{
hspeed := 0;
}

PS this could be wrong.


--------------------
New Super Mario Kart: Nominated for the MFGG awards for game with highest replay value.
user posted image
PMEmail PosterMSN
Top
Finland
Ultramario
Posted: Oct 29 2006, 04:26 AM
Quote Post


Dan Dan Dan!
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 11240
Member No.: 2164
Joined: 9-June 06

Status: (0d) [--]


This is my code
CODE
If x is smaller than view_xview+view_width+sprite_width
If x is larger than view_xview-sprite_width*2
If y is smaller than view_yview+view_height+sprite_height
If y is larger than view_yview-sprite_height*2
set speed to something
else
set speed to 0


--------------------
PMEmail PosterUsers WebsiteAOL
Top
United States
Captain Jeff Silvers
Posted: Oct 29 2006, 09:27 AM
Quote Post


Admins Can Do That!™
[A][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Admins
Posts: 30098
Member No.: 9
Joined: 13-October 03

Status: (0d) [--]


QUOTE (Hatman @ Oct 28 2006, 07:53 PM)
Ehhh... that could work. Or you could try this...

CODE
{
 instance_activate_all();
 instance_deactivate_region(view_xview[0],view_yview[0],
                       view_wview[0],view_hview[0],false,true);
}


Under your character's step event.

Ah. So he's using GameMaker. Nevermind, then.


--------------------
user posted image user posted image
PMEmail Poster
Top
United States
frosty
  Posted: Oct 29 2006, 10:26 AM
Quote Post


Regular


Group Icon
Group: Members
Posts: 120
Member No.: 2605
Joined: 1-September 06

Status: (0d) [--]


Ok i'm awake let me try your methods.

EDIT:Solved, I tryed Hatmans code and it worked. Thanks to the people who helped me.

This post has been edited by frosty on Oct 29 2006, 10:31 AM


--------------------
user posted image
PM
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0630 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.39 ]