(Help) I am trying to create a spawnable vehicle using events

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Hey guys.


I am working on a project at the moment and am trying to figure out how to use events to create a flying vehicle that you can spawn using an item.


Im making it so you when you use "orb", an orb literally shows up beside/over top of you and you can fly around the map in it.


I have tried doing this using a comment event called orb, and having a paralell process going that shows the "orb" where the player is on the map and have x/y to do so.


I have been at it for over an hour and i cannot for the life of me seem to get it working.

I had it working kind of at one point but was only able to get the orb on the map, not where the player was.


Now after fiddling with it i can't even get it on the map anymore..


I appreciate any help lol and I am sorry if this is posted in the wrong spot, i looked for a few minutes and this seemed the most worthy spot to ask this question.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Associate the item with a common event, and make the common event do a Set Vehicle Location command.  You'd probably want to use variables to get the player's current map id, x and y location, and use those in the Set Vehicle Location command.  Make the airship the vehicle and set its sprite to the 'orb'.
 

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Lol damn it.. thats exactly what I did. I used the same technique for a torch overlay to get the airship there.


I will keep tinkering with it, thanks tho that means im on the right track :)
 

Dalamar

Veteran
Veteran
Joined
Apr 29, 2013
Messages
370
Reaction score
61
First Language
English
Primarily Uses
RMMV
Could you please post your event?  Also, what plugins are you using?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You need to tell us what's working and what's not.  The above method should work, so if it's not, you've probably got something wrong somewhere.  Please post screenshots of your event.


Also, check your signature - the spoiler tags don't seem to be working, and your signature is taking up more space than your posts ;)
 

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Lol Well my signature was from the old site which I think was quite a while ago, I looked up my last post and it was way back in 2013. I remember you very well though Shaz :p
I will fix my signature right now!


When it comes to the original question, the only thing that isnt working is the airship spawns at one place on the map.


I am going to make a copy of the map with all new events and see if like you say im just messing up something to do with command flow or something silly.


Thanks folks :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Please just give us screenshots.  Why go to all the trouble of recreating it from scratch, when it would take you a few seconds to provide a screenshot and post it for us, and we may be able to see the problem immediately?  If you want our help, you need to be willing to give us extras if we need them.  Of course if you prefer to keep guessing & fumbling on your own ...  ;)


If the airship "spawns at one place on the map", what place is that?  You're still not really giving enough info for us to help you.  Maybe a pic of the map in the editor, showing where the airship spawns all the time, will help as well.


At a guess, I'd say you're either setting your variables incorrectly (or not setting them at the appropriate time) or that you're using variables that are also being used by a plugin that you haven't initialized correctly (a lot of people just add them and don't bother to initialize/customize them, and end up using switches or variables that the plugin is using).
 
Last edited by a moderator:

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Lol oops, I had put screenshots in that reply but it didn't attach... 


So here is how I have it set up, this was based on a torch light tutorial I watched I believe by echo.


I had it work once, but it only put the ship down in a set spot.


The reason I was going to remake it is to see if it worked right away, then id better understand WHY its doing what its doing instead of blindly following a tutorial with a process i dont fully grasp lol


If that makes sense.


Cheers :D

 

2016-06-17 (1).png

2016-06-17.png
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
What is the 'has sword' variable?  You need to set a variable to the current map id as well, at the same time as setting the player x and y variables, and use that in the Set Vehicle Location call.
 
Last edited by a moderator:

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Ok maybe thats what Im not understanding is map id. The sword is for another instance on a different map


I have seen it said many times and still am unable to find it or implicate it
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Okay - let's go through it.


The Set Vehicle Location command allows you to relocate a vehicle at any point in the game, to any map and coordinate you want.


You can either do this by selecting the map and position manually, or if it's not a fixed location, you can use variables.  If you use variables, you have to use ALL variables.  That means there needs to be a variable for the map id, and the x and y coordinates where you want the vehicle to be.


Normally when you use variables to do this, you will have 3 Control Variables commands prior to the Set Vehicle Location command (this could be in the same event, or it could be a different event that was run earlier.  One of them will set the map id, one will set the X coordinate, and one will set the Y coordinate.  


Now, you've set the variables for X and Y, but you haven't set the variable for the map id.  Instead, you're using some 'has sword' variable that clearly has a completely different purpose, and goodness knows when it would have last been updated or what value it might hold.  Chances are it's probably NOT going to contain the id of the map you want the vehicle to move to.


So just create a new variable specifically for this purpose, and call it Map ID.  Then use a Control Variables command to set this variable to the current map's Map Id (this is in Game Data > Other and should be the default selection).  Then change your Set Vehicle Location command to use THAT variable instead of the 'has sword' variable.  That should be enough to fix the issue.


Why didn't it work with the 'has sword' variable?  Maybe that variable still contains a 0, and there is no map with id 0.  Maybe it contains a number that is higher than any map id.  Maybe it contains a valid map id, but that map is not large enough to have the x/y coordinate represented by those other two variables.  Could be any number of reasons.  The important thing is, the command is expecting something that's a map id, and you didn't ensure that's what it receives.
 
Last edited by a moderator:

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
OHHH!!!!!!


I have no idea how that happened, good eye lol 


this orb thing was one of this first things I tired "making" I bet i foolishly didnt name it until i tried using it for the sword :p


I am going to try this in a few minutes here once the olday gets to bed lol


THANK YOU!
 

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Okay - let's go through it.


....
So I followed your instructions and this is what I came up with.


I set the variable to control map id, and left the x and y.


Im wondering if it matters the order its in? I tried map id, then x then y, then map id after x and y and its just not working lol


I feel like it's something soooo small and obvious 


EDIT


Ok... So i was using screen x and y not MAP x and y..


It works perfectly now lol


thanks a lot Shazzy.


Now, how to make it disappear when I get off. Conditional branch maybe?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Nice catch - I completely missed that in your screenshot, because I immediately saw that you weren't setting/using the correct map id, and I just focused on that.


Yes, a conditional branch to see if the player is in the 'airship' vehicle. But where to add it?  As you don't need to use an event to get off the vehicle, do you?


Do you make the player board the vehicle automatically?  So if they use the orb, the 'orb' vehicle arrives and they get straight on?  Or could they walk around and not get on at all?  


If you make them board automatically, turn on a switch immediately after (I'll call it Player on Orb).  Create a parallel process common event that's conditioned by this switch.  Add the following commands:

Code:
Wait 15 Frames
If Vehicle 'airship' is being driven
  # nothing happens here
Else
  Set Vehicle Location (set it directly, not using variables this time, to somewhere on an unused map)
  Control Switches: Player on Orb = OFF
End


However, if you don't make them board automatically - if they can walk around and ignore the orb, you'll need two parallel process common events and two switches (the other switch, which I'll call Player on Foot, should be set on right at the start of the game, and in the common event above, when you turn off the Player on Orb switch, also turn ON the Player on Foot switch).  Then add another parallel process common event, conditioned by the Player on Foot switch, that does the following:

Code:
Wait 15 Frames
If Vehicle 'airship' is being driven
  Control Switches: Player on Orb = ON
  Control Switches: Player on Foot = OFF
End


So you've just got two common events, and one or the other will always be running, depending on whether the player is on the orb or not.  The moment they get on the orb, they switch and it starts checking to see if the player gets off the orb, hides it away, then starts checking to see when they get on again.  Remember, the second common event and switch is only needed if you're NOT making the player get on the vehicle immediately after they summon it.
 
Last edited by a moderator:

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Lol im glad you can see exactly what im trying to accomplish!


Yeah its set up so you use the item and you hop right on, so the top one is the one im going to use.


I don't know if it's dude or dudette, but you rock :D


Thanks for the quick replies.


I wonder if anyone has done exactly this before, cuz I sure looked everywhere for some kind of tutorial lol.


Now it makes sense why screen location wouldnt work, that would be for some kind of image, not an event im assuming.


Happy dude over here :D
 

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Ok wait, that didnt work..


Let me try this a bit more lol
 
Last edited by a moderator:

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
So this is how it's set up, but when I get off it still just hangs out there, i have it going to it's own map with  nothing on it.

2016-06-18.png
 

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Lol wow......


It says boat :(


Ok You win, i suck :D


I got it fixed lol
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
lol!


Just edit your post instead of posting several times in a row :)


Oh - your event is wrong.  The only thing you should have added to the Orb common event was to turn the switch on after boarding the airship.


You should create a new common event, set it to parallel process, and condition it by switch 10.  That new common event should have the Wait 15 Frames, the If Airship is Driven test, and the Set Event Location to move it out of the way and finally turn the switch off. 


If you've got all that in the same event and it's working, it's just a coincidence that you happened to disembark within the first 15 frames, during that wait time.  If you wait a couple of seconds after boarding and then disembark, the orb won't be moved away.
 
Last edited by a moderator:

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Lol Ya i edited the top one but it wouldnt let my edit it a fourth time, but its all workin now yo :D


im so stoked.


Now I have most of the mechanics working for the game, now its time to get back to storyline!


I appreciate your help lol


Any news on a falcao styled battle system yet? hehe xD
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top