Powered by Invision Power Board

 
  Pages: (2) 1 [2]  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> Game Maker Help: Enemies activating on screen.
Unspecified
Miaxis
Posted: Jun 13 2008, 06:11 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


Setting hspeed to 0 isnīt deactivating.


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Unspecified
Yoshi 3000
Posted: Jun 13 2008, 06:36 AM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 20
Member No.: 4832
Joined: 12-December 07

Status: (0d) [--]


No, but won't it prevent them from moving?
PMEmail Poster
Top
Spain
Sergeant DeeY
Posted: Jun 13 2008, 06:48 AM
Quote Post


~Heh Heh~
[*][*][*]

Group Icon
Group: Members
Posts: 1344
Member No.: 4730
Joined: 17-November 07

Status: (0d) [--]


Put this in the step event of the object:

if x > view_xview-16
if x < view_xview+336
if y > view_yview-16
if y < view_yview+256
{
hspeed = 0
}
else
{
move_towards_point(obj_player.x,self.y,0.5)
}

I think this can help you!



--------------------
The signature will not be available when the new forums shows up.
~~DeeY~~
PMUsers Website
Top
Unspecified
Miaxis
Posted: Jun 13 2008, 07:45 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


Preventing from moving LAGS INCREDIBLY. DYīs code could work for deactivating too, though, but I think mineīs faster.


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Unspecified
jhsoft
Posted: Jun 13 2008, 12:04 PM
Quote Post


This grimmace is not the McDonalds kind.


Group Icon
Group: Members
Posts: 78
Member No.: 2850
Joined: 24-October 06

Status: (0d) [--]


@Yoshi 3000: Nice try.
@DarkYosh: I'll try that in a little. Got something to do.
@Latia: Hmmm...what do you mean by that?
obj_activater
Create
CODE
persistent=true

Step
CODE
instance_activate_region(view_xview[0]-32,view_yview[0]-32,view_wview[0]+32,view_hview[0]+32,true)


This post has been edited by jhsoft on Jun 13 2008, 12:06 PM


--------------------
Current Projects:
Bony Beetle Strikes Back: Working Title
Coding:|||||||||
Level Design:|||||||||
Sprites and Graphics:|||||||||
Sounds:||||||||||
In Total:||||||||||



Which Neglected Mario Character Are You?

CODE
Thwomp Master says (5:59 AM):
I'm not crying
Thwomp Master says (6:00 AM):
And I never complained
Thwomp Master says (6:00 AM):
I just said I have 56 complaints
PMEmail PosterUsers WebsiteMSN
Top
Japan
Soiyeruda
Posted: Jun 13 2008, 12:13 PM
Quote Post


Because retarded looking women is fun. :S
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3589
Member No.: 5004
Joined: 6-March 08

Status: (0d) [--]


Sorry it took a bit, but I found the problem.

In your goomba, you had this:

CODE
instance_deactivate_object(Goomba)


This code means it deactivates ANY object with the given name. That caused each goomba to be deactivated like 10 times, which caused glitches.

On your activater, set the above code under a Room Start Event. This can be found under "Other". This way, all enemies will only be deactivated once (Upon room start), and no problems will be caused.
PMEmail Poster
Top
Unspecified
Miaxis
Posted: Jun 13 2008, 12:21 PM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


QUOTE (jhsoft @ Jun 13 2008, 07:04 PM)
@Latia: Hmmm...what do you mean by that?

Because the objects donīt get deactivated, so they would still be active in the room. And calculating things for many instances of an object type could lag, depending on the roomīs dimensions and the number of goomba instances.


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Unspecified
jhsoft
Posted: Jun 13 2008, 05:41 PM
Quote Post


This grimmace is not the McDonalds kind.


Group Icon
Group: Members
Posts: 78
Member No.: 2850
Joined: 24-October 06

Status: (0d) [--]


QUOTE (Soiyeruda @ Jun 13 2008, 12:13 PM)
Sorry it took a bit, but I found the problem.

In your goomba, you had this:

CODE
instance_deactivate_object(Goomba)


This code means it deactivates ANY object with the given name. That caused each goomba to be deactivated like 10 times, which caused glitches.

On your activater, set the above code under a Room Start Event. This can be found under "Other". This way, all enemies will only be deactivated once (Upon room start), and no problems will be caused.

This worked! Yay! Thanks a bunch!
@Everyone: Thanks so much everyone for helping! I am about ready to close this thread, but before that, I am going to try Soyeruda's method once more. I think that there might be a problem with lag, but I'm 99% sure it's my computer. Be right back, restarting


--------------------
Current Projects:
Bony Beetle Strikes Back: Working Title
Coding:|||||||||
Level Design:|||||||||
Sprites and Graphics:|||||||||
Sounds:||||||||||
In Total:||||||||||



Which Neglected Mario Character Are You?

CODE
Thwomp Master says (5:59 AM):
I'm not crying
Thwomp Master says (6:00 AM):
And I never complained
Thwomp Master says (6:00 AM):
I just said I have 56 complaints
PMEmail PosterUsers WebsiteMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Pages: (2) 1 [2]  Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0577 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.20 ]