[XP] Place objects from Tileset on map script

Started by Juz10_gameguy, June 17, 2016, 02:11:03 am

Previous topic - Next topic

Juz10_gameguy

Hi, I don't have much scripting experience so was hoping someone could help me with a hopefully simple script for my game. I need a script that will allow me to place objects from my tileset into the game during gameplay.

So for example during gameplay you come across an empty lot. A carpenter in town will build a house for you on that empty lot for 5000 gold or whatever. I was wondering if it was then possible to say have a switch called "house built" or whatever activate, which would then call a script and make a house appear in the empty lot. The house would obviously be premade already and be found on the tileset. I hope I am making myself clear for what I am asking. Is this possible via a script?

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

schmoggi

June 17, 2016, 06:19:51 am #2 Last Edit: June 17, 2016, 06:21:16 am by schmoggi
Hey,

you can swap Tiles on your Map with the following call script:

$game_map.data[x, y, layer] = ID


x = map_x position
y = map_y position
layer = Map Layer, it starts with 0 for Layer 1
ID = Tile ID from your Tileset, starting with 384 for the first Tile below Autitiles in the left upper Corner

Though, i don't know if the changes on the Map are saved in the save File. I can't test it yet because i'm not at home. If not, maybe some friendly Scripter could edit it so the changes are saved.

greetz

Blizzard

Nope, they aren't changed. But depending on what exactly it is he is trying to do, he's better off with a full script. e.g. if he wants a script where you can build your own house.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Zexion

Another trick is to just take a screenshot of the house on the lot and use it as an event graphic. Requires a bit of paint and cropping but nothing too hard and no scripts needed either.