OmegaDev
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Again...

3 posters

Go down

Again... Empty Again...

Post by yami Tue Apr 20, 2010 2:45 pm

Sorry for requesting so much...
@~@
I need a script or script modification to:


  1. this time I would like to check if an event was in an area around the player and do something with it:

So the player would be @ and events would be # :

#-@-#

Now if I wanted a range of 2, to detect 'enemy' in the events name,
I would be ableto scan them

#@--#
Here I should only be able to detect the left most enemy

I would like to do with the selected events:

  • erase them Wink
  • I can't think of what else right know...




yami
yami
Apprentice
Apprentice

Posts : 127
Gald : 425

Stats
Cookies: 0

Back to top Go down

Again... Empty Re: Again...

Post by Dezz123 Tue Apr 20, 2010 2:50 pm

Haha, I think you don't need a script... You can just download Kazeko and the Midnight Guild and copy the Common Event used.
Dezz123
Dezz123
Legendary
Legendary

Posts : 1534
Gald : 6469

Stats
Cookies: 0

http://www.dezzgames.webs.com, www.evalon.webs.com

Back to top Go down

Again... Empty Re: Again...

Post by yami Tue Apr 20, 2010 3:10 pm

that won't work, it would cause a lot of lag and be very messy.
I would need a common event for every enemy in meh game Wink
yami
yami
Apprentice
Apprentice

Posts : 127
Gald : 425

Stats
Cookies: 0

Back to top Go down

Again... Empty Re: Again...

Post by omegas7 Tue Apr 20, 2010 3:33 pm

Here you have:

Deletes all events with X name in X range from the player.
Code:
class Game_Map
  def yami_events_deletion(name,range)
    for i in 1..@events.size
      player = $game_player
      if (@events[i].x >= (player.x - range)) && (@events[i].x <= (player.x + range)) &&
        (@events[i].y >= (player.y - range)) && (@events[i].y <= (player.y + range)) &&
        @events[i].event.name.include?(name)
        @events[i].erase
      end
    end
  end
end

Use the event script call:
Code:
$game_map.yami_events_deletion(name,range)

name is the name of the events you are looking for. The event will be deleted if its name includes this specified the name. Case sensitive.
range is the amount of tiles to look for the event, like your example in the first post.

Enjoy. Me get cookies.
omegas7
omegas7
Admin
Admin

Posts : 1180
Gald : 4121

Stats
Cookies: 0

http://www.omegadev.biz

Back to top Go down

Again... Empty Re: Again...

Post by yami Wed Apr 21, 2010 10:38 am

GIBS COOKIEZ
Thank you. Omega, you are a scripting God
yami
yami
Apprentice
Apprentice

Posts : 127
Gald : 425

Stats
Cookies: 0

Back to top Go down

Again... Empty Re: Again...

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum