xD Need a script ;)
3 posters
Page 1 of 1
xD Need a script ;)
Well I need a little script
So I can check if on the tile the player or another event is standing on,
has a event on it with a certain name* and get it's id.
If so, I need a script call to erase events by script i.d . (this may be used seperately)
Hope it's enough
*so if the event's name is Bob, I state in the script call, to check if it was Bob, I would get the script ID in a variable , else it would return 0
So I can check if on the tile the player or another event is standing on,
has a event on it with a certain name* and get it's id.
If so, I need a script call to erase events by script i.d . (this may be used seperately)
Hope it's enough
*so if the event's name is Bob, I state in the script call, to check if it was Bob, I would get the script ID in a variable , else it would return 0
Last edited by yami on Mon Apr 19, 2010 1:20 pm; edited 2 times in total
yami- Apprentice
- Posts : 127
Gald : 425
Stats
Cookies: 0
Re: xD Need a script ;)
I think you need a little bit more info. in that... Like straighten it up a bit, make it easier to understand... Do you mean if someone stands on a tile (your character) it automatically gives the ID of the tile? :huh:
Re: xD Need a script ;)
I changed it
It is to see if an event is on that tile
It is to see if an event is on that tile
yami- Apprentice
- Posts : 127
Gald : 425
Stats
Cookies: 0
Re: xD Need a script ;)
Haha that's better... I think Omega is up for making a script actually
Try asking him... *hint hint*
:cheers: :bball: :bom: :drunken: :bounce:
That'll do...
Try asking him... *hint hint*
:cheers: :bball: :bom: :drunken: :bounce:
That'll do...
Re: xD Need a script ;)
Here you have, Yami:
Instructions in the script. Basically, it will let you check if the player is over another event with X specific name (case sensitive).
If true, the ID of the event found will be stored in a variable of your choice.
You can also erase an event ID through the value of a variable, look at the script.
Instructions in the script. Basically, it will let you check if the player is over another event with X specific name (case sensitive).
If true, the ID of the event found will be stored in a variable of your choice.
You can also erase an event ID through the value of a variable, look at the script.
- Code:
# =============================================================================
# Omegas7
# =============================================================================
# Checks if the player is OVER another event with a specific name.
# If that is true, the ID number of the event will be stored in a variable.
# =============================================================================
# Instructions:
# In a conditional branch, go to the script section, and write:
# $game_player.player_over_special_event?(name,variable)
# name is the 'name' (inside quotes) you are searching for.
# variable is the ID number of the game variable you want the event's ID to be
# stored.
# If that is true, the variable you chose will hold the ID number of the event
# found, and you'll be able to do whatever you want with such variable.
# =============================================================================
# In addition, you can use the number stored in the variable to erase an event,
# just use an event script call:
# $game_map.erase_event_id_from_variable(ID)
# ID is the ID number of the variable.
# =============================================================================
class Game_Event < Game_Character
attr_reader :event
end
class Game_Map
def player_over_special_event?(name,variable)
for i in 1..@events.size
if ($game_player.x == @events[i].x) && ($game_player.y == @events[i].y)
if @events[i].event.name == name
$game_variables[variable] = @events[i].id
return true
end
end
end
return false
end
def erase_event_id_from_variable(variable)
$game_map.events[$game_variables[variable]].erase
end
end
Re: xD Need a script ;)
OMGOmegas7 wrote:Here you have, Yami:
Instructions in the script. Basically, it will let you check if the player is over another event with X specific name (case sensitive).
If true, the ID of the event found will be stored in a variable of your choice.
You can also erase an event ID through the value of a variable, look at the script.
- Code:
# =============================================================================
# Omegas7
# =============================================================================
# Checks if the player is OVER another event with a specific name.
# If that is true, the ID number of the event will be stored in a variable.
# =============================================================================
# Instructions:
# In a conditional branch, go to the script section, and write:
# $game_player.player_over_special_event?(name,variable)
# name is the 'name' (inside quotes) you are searching for.
# variable is the ID number of the game variable you want the event's ID to be
# stored.
# If that is true, the variable you chose will hold the ID number of the event
# found, and you'll be able to do whatever you want with such variable.
# =============================================================================
# In addition, you can use the number stored in the variable to erase an event,
# just use an event script call:
# $game_map.erase_event_id_from_variable(ID)
# ID is the ID number of the variable.
# =============================================================================
class Game_Event < Game_Character
attr_reader :event
end
class Game_Map
def player_over_special_event?(name,variable)
for i in 1..@events.size
if ($game_player.x == @events[i].x) && ($game_player.y == @events[i].y)
if @events[i].event.name == name
$game_variables[variable] = @events[i].id
return true
end
end
end
return false
end
def erase_event_id_from_variable(variable)
$game_map.events[$game_variables[variable]].erase
end
end
THANK YOU
Here, hab cookiez, hug and SWEETS NAO!
yami- Apprentice
- Posts : 127
Gald : 425
Stats
Cookies: 0
Re: xD Need a script ;)
Haha, Yami's happy... Guess that means that this is DONE. It can now be..... Closed.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|