New account registration is temporarily disabled.

[RMVX ACE] ALLOWING A PLAYER TO BUILD A FENCE

Posts

Pages: 1
so i am making a farm simulator game and i would like the player to be able to build their own fences, is there a good way of doing this through events?

any help would be appreciated

thanks
Mirak
Stand back. Artist at work. I paint with enthusiasm if not with talent.
9300
You could make predetermined spots where players might want to build a fence by adding transparent events that offer the player the ability to construct a fence using wood, for example.

Then, if player has wood, ask the player if they'd like to build a fence there, if they do, remove as many wood units as you'd like and then change the event's page to another one where the fence graphic shows up.

At least that's the easy way i can think of.

I'm not very well versed in Ace to know how you'd be able to create a fence event *anywhere* on the map without teleporting a certain off-screen fence event with variables, or if that is even possible.
Sooz
They told me I was mad when I said I was going to create a spidertable. Who’s laughing now!!!
5354
Honestly, you shouldn't allow a player that much power. They start getting ideas above their station.
mirak i would like to be able to create a fence anywhere on the map,(kinda like stardew valley) would scripting be the only option then?
Mirak
Stand back. Artist at work. I paint with enthusiasm if not with talent.
9300
Yes, but even with scripting you're going to have a bad time.

This yanfly script allows you to spawn events anywhere on a map:
https://yanflychannel.wordpress.com/rmvxa/utility-scripts/spawn-event/

But according to the instructions, the events will disappear when you change maps, so you wouldn't be able to leave the farm because the fences will disappear...

That's as far as my knowledge of Ace can help, i'm sorry i can't be of more help.
pianotm
The TM is for Totally Magical.
32388
You're going to want a script, but you can do it with eventing.

Essentially, you need an event on every square of the map (or area that you want the player to be able to manipulate). Depending on what you want your player to be able to do, you will need multiple pages on each event (say being able to build a fence isn't the only thing you want a player to be able to do), with a variable that calls each activity through a custom user command. Make sure you call the right sprite and give the player the option to place it. You basically have to build a user interface from the ground up. It would actually be easier for you to do something like this in Game Maker or Unity.
You could have a parallel process set up to where when you press a button, an event gets moved to right in front of you and then builds the fence. So, you would have to have a bunch of invisible events offscreen. You would also need a script that saves event positioning. Aaaaaand, you're going to want a pretty low hard limit on the events, or you're going to run into lag pretty quickly.

If your scope is small, it's doable, but for a pretty minor gameplay element it's going to be a major resource hog. Like piano said, RPG Maker isn't really optimized for this kind of thing, though it's possible to work within the limits of the program and still make a good farming simulator (the Farming One, for instance).
author=Mirak
Yes, but even with scripting you're going to have a bad time.

This yanfly script allows you to spawn events anywhere on a map:
https://yanflychannel.wordpress.com/rmvxa/utility-scripts/spawn-event/

But according to the instructions, the events will disappear when you change maps, so you wouldn't be able to leave the farm because the fences will disappear...

That's as far as my knowledge of Ace can help, i'm sorry i can't be of more help.


You can save the fence positions in an array and reload the events when re-entering the map. This however might cause some considerable lag. I have been using this script for something similar and while the result is workable it occasianally results in lagspikes when spawning the new events (although no lag when traversing the map after placing said events).
Another solution: break the farm into multiple areas so that you have a hard event cap in each area. That would make the lag more tolerable, but breaking the farm up like that might be weird from a player perspective.
how would i make the player understand the limits to putting down a certain number of fences?
maybe i should change my plan for building fences anywhere and go with a more simple route like what mirak was suggesting with a predetermined spots.
You could mark the availble spots with regions in the editor and check the region number with a conditional branch when the player interacts with it to see if a fence can be placed. Maybe you could mark the tiles where a fence can be built?
author=Kyoui
You could mark the availble spots with regions in the editor and check the region number with a conditional branch when the player interacts with it to see if a fence can be placed. Maybe you could mark the tiles where a fence can be built?


Checking the regions would be kinda the Harvest Moon way to do it. In them you can (usually) only place a fence on 'farm dirt' areas. So maybe let your player know they can do 'whatever they want with their farm', but not mess with the town/surrounding areas?

To help with some of the lag, would a pre-loader script help? In my very short time playing around with VXA, I noticed the game got very slow to load up pretty quickly. (Then I went to MV and wow so fast, feel like Sanic the donut steel over here.)
@dorien: You could use the show picture command to create a HUD and have, like, 0/30 in the corner of the screen when you go into fence-building mode. If you're new at this, this kind of thing might be a little much to take on, so Mirak's idea might be the way to go.
i have never used the region editor before so i don't really know how to use it
@housekeeping: that is a great idea, never really though about that (already created a hud for other things so its not much of a problem).

Thank you for helping me guys
Pages: 1