Telemetius
Tele*
- 267
- Posts
- 9
- Years
- Italy
- Seen Jan 9, 2022
Hello forum.
So what I'm trying to do is to create a method that returns the id of the event with a certain name.
For example if I use identificatore("Carl") it should give me the id of the event on the map named carl.
The game isn't showing me errors but the code won't return me anything either:
So what I'm trying to do is to create a method that returns the id of the event with a certain name.
For example if I use identificatore("Carl") it should give me the id of the event on the map named carl.
The game isn't showing me errors but the code won't return me anything either:
Code:
def identificatore(value)
example=[]
if !value.is_a?(Integer)
for event in $game_map.events.values
if event.name[/^#{value}$/]
example.push(event)
end
end
eventid=get_character(example[0]).id
end
return eventid
end
Last edited: