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
Location
Vestal, NY
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
Location
In My Heart <3
Website
ltngames.gitlab.io
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
Location
Vestal, NY
SOLVED!
◆If:Script:$gameMap.eventIdXy(x, y) !== 0
◆Text:None, Window, Bottom
:Text:event found

:End
 
Top