Game Dev Contest
Join in on the Game Development contest with over $300 in prizes!
Banner Creation Contest!
Help the community out by creating your own version of the banner, and potentially having that as the main banner!
Resources
Check out our resources :D
Upgrade your account
Help out the community, and keep the website running and fully up to date by donating! :D

can you check if a tile contains an event with a conditional scriptcall using either tile xy or screen xy?

GO TO ADMIN PANEL > ADD-ONS AND INSTALL ABSTRACT SIDEBAR TO SEE FORUMS AND SIDEBAR

CynicSyndrome

Towns Guard
Joined
Dec 6, 2015
Messages
69
Points
59
RM Skill
Writer
can you check if a tile contains an event with a conditional script call using either tile xy or screen xy? I cannot seem to find the right script for this, also I am wondering how to call for the value of map weather.
 

LTN Games

Master Mind
Resource Team
Joined
Oct 6, 2015
Messages
2,741
Points
626
RM Skill
Programmer
You should be able to check against the events array in the map and compare their coordinates with yours.

Replacing 3 with the tile position you want, at least I'm pretty sure it's the tile position.
JavaScript:
$gameMap.events().some(event => {
    return event.x === 3 && event.y === 3
})
If you want screen position you can try this but my guess is it won't work as good as using the tile position
JavaScript:
$gameMap.events().some(event => {
    return event.screenX() === 3 && event.screenY() === 3
})
As for the type of weather currently being used on the map you can use this
JavaScript:
$gameScreen.weatherType() // Returns the type of weather on screen (rain, snow etc)

$gameScreen.weatherPower() // Returns the power of the weather
I hope this helps!
 

CynicSyndrome

Towns Guard
Joined
Dec 6, 2015
Messages
69
Points
59
RM Skill
Writer
SOLVED!
◆If:Script:$gameMap.eventIdXy(x, y) !== 0
◆Text:None, Window, Bottom
:Text:event found

:End
 
Top