[RMMV] CAN'T FIGURE OUT HOW MY SCRIPT CODE IS WRONG.
Posts
Pages:
1
Hello all.
I am simple as hell here, but my partner and I have figured out basic script calls and whatnot. The problem is that I can't seem to use it correctly in our game, of course.
Here's the set up:
There are 4 maps of water levels in the sewer. 0 is empty, 1 is half, 2 is high, 3 is full. Two example maps are:
And
There's a map with a switch that allows the player to control the water level. The idea is that I want a vehicle (the boat) to change its location every time the water level is lowered/raised (the water doesn't actually change, the map that the hero goes to just changes)
Here is the Event of that switch.
I found this code to determine where the boat ends up:
$gameMap.boat().setLocation(88, 30, 30);
The 88 represents the Map ID, the 30 and 30 the X and Y. In theory, the boat should change every time the player chooses a different water level (scale 0-3, 3 being full and 0 being empty).
The problem is that this code only works like once, then the boat stops moving depending on the water level the player has chosen.
Does this make sense? Am I coding this wrong or is idea incompatible with how the script actually works?
EDIT: Sorry, I can't seem to upload the right kinds of images. All in all, just need help choosing where to put a vehicle every time a switch is turned in a Vehicle location script.
I am simple as hell here, but my partner and I have figured out basic script calls and whatnot. The problem is that I can't seem to use it correctly in our game, of course.
Here's the set up:
There are 4 maps of water levels in the sewer. 0 is empty, 1 is half, 2 is high, 3 is full. Two example maps are:
And
There's a map with a switch that allows the player to control the water level. The idea is that I want a vehicle (the boat) to change its location every time the water level is lowered/raised (the water doesn't actually change, the map that the hero goes to just changes)
Here is the Event of that switch.
I found this code to determine where the boat ends up:
$gameMap.boat().setLocation(88, 30, 30);
The 88 represents the Map ID, the 30 and 30 the X and Y. In theory, the boat should change every time the player chooses a different water level (scale 0-3, 3 being full and 0 being empty).
The problem is that this code only works like once, then the boat stops moving depending on the water level the player has chosen.
Does this make sense? Am I coding this wrong or is idea incompatible with how the script actually works?
EDIT: Sorry, I can't seem to upload the right kinds of images. All in all, just need help choosing where to put a vehicle every time a switch is turned in a Vehicle location script.
For one, the image-tag would be...
...something like this.



The thumb tag is pretty fickle, and I'm not sure if I've seen it work with anything that isn't a file in a user's locker.
As to the actual question posed, I'm not really sure. The command seems to check out, but, if the boat isn't where it should be, perhaps some tracking as to where it actually is might be in order. Which might look like...
...this to print the variables in question into the console. Though, I also have to question if the map transitions are as they should be at each water level. Who knows? Maybe the player is always entering the map where the water level is 0, even if the boat is where it's supposed to be?
*Edit: For what it's worth, I did exactly one dungeon where the player had to manipulate the water level to advance. As I recall, I only allowed players to move it in one direction, and still had to test the hell out of the map transitions to ensure that players where being taken to the correct maps.
Also, for what's it's worth, I never did that again. XD
[img][url]https://iili.io/jJmPEl.png[/url][/img]
[img][url]https://iili.io/jJmtpe.png[/url][/img]
[img][url]https://iili.io/jJmjBR.png[/url][/img]
...something like this.



The thumb tag is pretty fickle, and I'm not sure if I've seen it work with anything that isn't a file in a user's locker.
As to the actual question posed, I'm not really sure. The command seems to check out, but, if the boat isn't where it should be, perhaps some tracking as to where it actually is might be in order. Which might look like...
console.log($gameMap.boat()._mapId); console.log($gameMap.boat().x); console.log($gameMap.boat().y);
...this to print the variables in question into the console. Though, I also have to question if the map transitions are as they should be at each water level. Who knows? Maybe the player is always entering the map where the water level is 0, even if the boat is where it's supposed to be?
*Edit: For what it's worth, I did exactly one dungeon where the player had to manipulate the water level to advance. As I recall, I only allowed players to move it in one direction, and still had to test the hell out of the map transitions to ensure that players where being taken to the correct maps.
Also, for what's it's worth, I never did that again. XD
Pages:
1















