Triggers in a way thats not too confusing for people? (XP)

Started by Heretic86, November 04, 2014, 08:52:57 pm

Previous topic - Next topic

Heretic86

Im working on a script and have run into a small dilema.  Im trying to balance functionality and ease of use.  What I want to do is allow a Player to get on and off a ride at any valid location.  It will require an Event on a map that I use for the Graphic of the ride when the player isnt riding it.  They can trigger the ride with the enter key while not riding it and hop on.  But while riding, I need to let them off anywhere.  Scriptwise, Im thinking doing this by a Trigger ID, which will cause an Event to run.  The Event that is triggered will simply move the Graphic to the Player's location by Event Commands so the ride is at the location the player hopped off.  Basically, the user presses Enter while on a ride and they can hop off, and doesnt matter where the Event is at.  Script will start the Event based on the Event ID per map after making sure there is a valid location and nothing else is running or triggered from within the Script.  I havent built this in yet as I think this may be too confusing for people.

The alternative that I dont like is to only allow Players to get on and off rides at specific locations.  Fine for Boats at Docks with Mooring Cletes (where you tie up a boat), but thats not the only one Im building into the script.  Im also going for Horses and Magic Carpets.  If I can do a Map Loop, I may do an Airship also, but thats in the future.  For now Im just working on the Land based non map looping types of rides.  So this is what I am thinking for a trigger to hop on and off anywhere valid:

Script: (this part not yet built, subject to change)
if Input.trigger(Input::ENTER)
 if $game_system.enable_vehicle and $game_system.vehicle_trigger_id and $game_system.vehicle_trigger_id > 0 and
    $game_map.events[$game_system.vehicle_trigger_id] and not $game_system.map_interpreter.running?
   # Starts the Event regardless of Location
   $game_map.events[$game_system.vehicle_trigger_id].start
 end
end

When entering a Map:
# Run this Event when User presses Enter if Valid
$game_system.vehicle_trigger_id = 12

In the Event 12 that is called when user presses Enter:

Conditional Branch: Script: vehicle_trigger?
 # Do stuff to hop off vehicle, Switches, and move the Event to Player, other Animations, etc
End Conditional Branch

Do you think this is too confusing, or have any other suggestions?  Im NOT looking for an Event solution as Im using Boats and other Oversized Graphics that require scripts already.  Yes, the boat flaots and is movable on water...

Or do you think whatever "Floats my Boat"?  Is this too confusing to the Non Scripter to use?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Heretic86

No replies huh?  Well, too late now.  The way I described above is the way its gonna be.  Works just fine, although it may confuse people a bit when trying to use the script.

Step 1: Put player on a vehicle (boat or magic carpet, "enable_vehicle = true") and assign a vehicle_trigger_id()

Step 2: Use the Event that is triggered to check for "can_disembark?" then animate getting off the vehicle.

Step 3: Move another event that looks like the Vehicle to the location and direction of the vehicle, then "enable_vehicle = false"

There is gonna be a ton of eventing that will need to happen, but all the scripts are in place to allow for functional eventing.  I tried to handle as much of the stuff as I could in the scripts, but there is no getting around eventing.  Did I make this too complicated?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Zexion

Quote from: Heretic86 on November 06, 2014, 06:54:08 am
Did I make this too complicated?

Possibly, there are a number of ways you could go about this system, so it's really just a matter of personal preference.
A relatively easy way would be to do the dock/undock animation in a common event where you could set up changing graphics depending on the actor.
You could also just make the character disappear as they dock, and have a parallel process with a picture moving to the players coords.
I've never really done this type of system (even tho gummi ship), so I don't exactly know what all you need to take into account as far as obstacles, etc.

Heretic86

Maybe this is a personal preference, but its also XP, so the character graphics arent the same size as the vehicle graphics.  If they were the same size, then I'd figure just swap the graphics.  Naa, this is a whole different ball of wax / whacks.  Im not just replacing character graphics (problems with that already due to collisions), Im going the hardest way possible (cuz its a challenge), Im putting the player's character on the RTP Boat itself and using that as my vehicle!



Make more sense now?

That screenshot isnt just a mockup image, it is fully functional, even at the present state of the script.

The script is fairly close to being finished, but I still need to do some Documentation and finish the Demo for it.  There is a lot of features that I put in.  The first feature is Sprite Clipping.  You'll have to look close at the pic but you should be able to see the bottom few pixels of the character are clipped off.  That was to make sure you could use ANY sprite hop in a boat, so no graphics editing required!  I also had to add in Float Animations, which cause a character to bob up and down.  Super easy to use.  For Player @float_anime = true, or for an Event, add a Comment \float_anime and yeah, there is a ton of other stuff to configure.  The Boat is an Oversized Vehicle so it will bump into stuff, like the Dock.  But most importantly, I changed some stuff around so you can totally control where every character can move on the fly, which is what allows the Player to be able to move on the Water Tiles and NOT walk on Land!  To move on Land, the Player has to Disembark, which is left open for script users to event, but basically, remove the Tile restrictions on the Player and jump on land. 

Disembarking leads this post full circle.  To disembark, the Player needs to be able to trigger an event.  But if you put an event on every single shore tile on a massive map, you'll not only get super lag, but run out of events!  Thats where I was asking if the Vehicle Trigger ID concept (cleaned up since inception) could be understood by a user of this script.  Player gets on a boat, they pull next to a dock or the shore, face the shore or dock and hit enter.  When they hit enter, that triggers the vehicle trigger ID which then, through eventing, allows the Player to disembark.  One map event vs 100k.

It doesnt matter much now since I already went ahead and wrote it.  I got bit by a total scripting bug.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20

Probably when I get around to actually trying it, it'll be easier to give opinions and suggestions for your system. I still can't make sense of what you're doing.
Quote from: Heretic86 on November 07, 2014, 08:13:40 am
But if you put an event on every single shore tile on a massive map, you'll not only get super lag, but run out of events!

And terrain tags are bad because...?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

Cuz, um, Im out?  I used em all!  However, excellent point.  I didnt consider Terrain Tags because my train of thought was that the Disembark evented actions would be triggered by the User pressing Enter.  The other trouble is that there is a lot more than just water tiles, such as Cliff Edge tiles also.  Basically, using a trigger allows the player to move from a normally impassable tile (without a vehicle) to a passable tile.  It takes a bit more explaining tho.  There are several types of vehicles.  Currently I have both a Boat and Magic Carpet mostly functional.  For disembarking on a boat, I use a script call "can_disembark_there?" so the player can "jump" to a new location and leave the vehicle in a passable location.  The location checked with "can_disembark_there?" is determined by where the Player is facing.  For a Magic Carpet however, I use "can_disembark_here?" so the Magic Carpet Vehicle is just left in the place the User pressed enter.  Now you see why it can be super duper confusing, and I really am trying to make this as easy as possible and wanted feedback.

Something else that needs to be explained is that vehicles like Boats are larger than the Player so I did extra checks to make sure that a location is movable based on the size of the vehicle.  It keeps the oversized vehicles from moving where it looks like they shouldnt be able to go.  This also allowed me to correct tons of other graphical glitches in one foul swoop, where small trees would get clipped through by the oversized vehicles.  Vehicles are more complex than most people consider and as a script solution, its the reason building this script is taking such a long time.  The good news, at least from my perspective, things are coming together damn near perfectly.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)