Vehicle as "touch" NPC

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Vehicle as "touch" NPC

Post by Willy Elektrix »

Is there anyway to have a boat vehicle act as a "touch" NPC instead of a "use" NPC? The problem is, you can't touch an NPC through a wall, therefore you can't touch the boat through the shoreline. However, for reasons of consistency, I want to make the boat function like a touch NPC.

Is there a way around this?
User avatar
FnrrfYgmSchnish
Metal Slime
Posts: 721
Joined: Thu Jun 18, 2009 4:37 am
Location: Middle of Nowhere, VA

Post by FnrrfYgmSchnish »

It's possible to set up "A" and "B" vehicle tiles; just push A or B when you're hovering over a spot in the wallmap editor. Maybe you could try removing the wall that keeps you from touching the boat, then putting one of those types of tiles on the shore (where you can walk) and setting the boat to be blocked by that type of tile.

Then you'd just need a way to keep the heroes from walking out into the water; a blank NPC that's set to "use," does nothing, and only appears if a certain tag is off should work for that. Just make sure the boat is set to turn that tag on whenever you're riding it. Of course, this wouldn't work so well if you can get on the boat from A LOT of different places (I was thinking of something like a "you can only get on the boat from ports/docks" sort of thing when I typed this up, not a "you can get on the boat from any shoreline tile" sort of thing.)

I don't know if you're already using the vehicle tiles or not (if so this may not work so well!), but they're kind of an odd little feature that I can imagine people forgetting about, so I figured I'd mention them.
Last edited by FnrrfYgmSchnish on Tue Oct 01, 2013 7:37 pm, edited 2 times in total.
FYS:AHS -- Swapping out some step-on NPCs for zones + each step script
Puckamon -- Not until the reserve party is expanded.[/size]
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

What about an each-step script? In the each-step script, you can check the four tiles around the leader, and if the boat NPC is in one of them, you trigger it with the "use npc" command.
User avatar
Mogri
Super Slime
Posts: 4598
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

But the ask is to allow the player to step onto the boat, like you can do in Final Fantasy (NES).

You could use a script to selectively remove walls next to the boat.

You may want a "step on" NPC instead of a touch NPC, depending on the feel you're going for.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6247
Joined: Mon Dec 08, 2008 7:07 am
Location: Home
Contact:

Post by Spoonweaver »

The clear solution in my opinion is to have a beach tile where the boat the hero and both walk. Problem solved.

Another solution, requiring lite scripting, would be it have 1 script run when you exit the boat, that makes the tile the boat is currently on no longer have a wall map. And another script that runs when you board the boat that makes the tile currently under the boat have the proper wallmap.
Then you just need to remove the wall under the first boat and you're all set.
Each script would be basically 1 line long.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

All of your ideas are good. I'm not sure how I will resolve this, but you've given me a place to start.
Mogri wrote:You could use a script to selectively remove walls next to the boat.
Spoonweaver wrote:Another solution, requiring lite scripting, would be it have 1 script run when you exit the boat, that makes the tile the boat is currently on no longer have a wall map. And another script that runs when you board the boat that makes the tile currently under the boat have the proper wallmap.

Then you just need to remove the wall under the first boat and you're all set.
Each script would be basically 1 line long.
When you use a script to edit a wallmap, does the wallmap stay changed even when you save and reload the game?
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Willy Elektrix wrote:When you use a script to edit a wallmap, does the wallmap stay changed even when you save and reload the game?
No, the wallmap will be re-loaded when you load the game. You would have to re-apply the changes to the wallmap in the loadgame script.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

Code: Select all

plotscript, boatmount, begin
write pass block(npc X(170),npc Y(170),15)
end
This is the code I started with. However, this completely encircles the boat with walls. How do I detect which direction the hero mounted the boat from and then only place a wall in that direction?
Spoonweaver wrote:The clear solution in my opinion is to have a beach tile where the boat the hero and both walk. Problem solved.
If I were to use this method, how would I prevent the hero from entering the water?

For instance, I can make a B tile (for mounting vehicle B) that prevents the boat from leaving the "beach" and going on land. But how do I make a wall that will let the boat pass from the beach to the water, but will not let the hero walk from the beach to the water?
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6247
Joined: Mon Dec 08, 2008 7:07 am
Location: Home
Contact:

Post by Spoonweaver »

you would make all the water tiles walls marked with an A then have the vehicle set to pass over A. Then you would have grass ( or whatever is beyond the beach) marked as B and have the boat vehicle blocked by b.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

I think I found a bug. If you are using a "touch" NPC boat, when you run into a regular wall, the heroes dismount. The same thing happens if you touch a touch-to-use NPC, even if the "enable NPC activation" vehicle bitset is on.
Last edited by Willy Elektrix on Sat Oct 05, 2013 8:33 pm, edited 1 time in total.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

What is the state of the "dismount one space ahead" bitset and the "pass walls while dismounting" bitset?
Post Reply