Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

YERD Variable Backdrops help please...

I am new to this, so i need some help please. :huh:
I would like to use this ( http://pockethouse.wordpress.com/vx/variable-backdrops/ ) for my battle backs, but i dont know the command to use so that i can put this in a run once / autostart or parallel process to set the background to what i need for it to be for the map in play.

Example, say i am in a forest, i want the first layer to be forest, then gray clouds, then cloudy. i understand the numbers and such, but i also get lost on the "bind to a variable"

So can i do this as a separate event script command, or do i do the bind thing, and i have no idea how to do that...

any help is really appreciated! :smile:
 
Its easy
when he says bind to a variable/switch its as easy as this:

BATTLE_SHADOW = 70 #Switch/variable Id
COVER_OPAQUE = 96 # This adjusts opacity for cover fog.
LAYER_COVER = 97 # This covers enemies. Dynamic
LAYER_FRONT = 98 # This is the front layer background. Static.
LAYER_MIDDLE = 99 # This is the middle layer. Dynamic.
LAYER_BACK = 100 # This is the final layer. Dynamic.

Hope it helps, its in the top of the script just change it there to the variables/switchs you need.

Be well.
 
That part i half way understood...
ok, but how do i call it in a script in the game?
something like $game.stuff, you know?

here is what i mean...
in the script it says...
$imported = {} if $imported == nil
$imported["VariableControlledBackdrops"] = true

module YE
module EVENT
module SWITCH

# If this switch is true, then the ground shadow will appear in battle.
# If it is off, then the shadow doesn't appear at all.
BATTLE_SHADOW = 70

end
module VARIABLE

# These are the variables that will be used to decide which backdrops
# will be used for battle.
COVER_OPAQUE = 96 # This adjusts opacity for cover fog.
LAYER_COVER = 97 # This covers enemies. Dynamic
LAYER_FRONT = 98 # This is the front layer background. Static.
LAYER_MIDDLE = 99 # This is the middle layer. Dynamic.
LAYER_BACK = 100 # This is the final layer. Dynamic.

# This hash determines the rate and direction the backdrops go.
# wx - Wait this number of frames before increasing dx
# wy - Wait this number of frames before increasing dy
# dx - Rate the plane moves horizontally right. Negative for left.
# dy - Rate the plane moves horizontally up. Negative for down.
BACKDROP_HASH ={
# ID => [wx, wy, dx, dy, Backdrop Name]
100 => [ 0, 0, 0, 0, "inner"],
101 => [ 0, 0, 0, 0, "grassland"],
102 => [ 0, 0, 0, 0, "woods"],
103 => [ 0, 0, 0, 0, "forest"],
104 => [ 0, 0, 0, 0, "mountain"],
105 => [ 0, 0, 0, 0, "beach"],
106 => [ 0, 0, 0, 0, "desert"],
107 => [ 0, 0, 0, 0, "swamp"],
108 => [ 0, 0, 0, 0, "snow"],
109 => [ 0, 0, 0, 0, "castletown"],
110 => [ 0, 0, 0, 0, "porttown"],
111 => [ 0, 0, 0, 0, "posttown"],
112 => [ 0, 0, 0, 0, "foresttown"],
113 => [ 0, 0, 0, 0, "minetown"],
114 => [ 0, 0, 0, 0, "deserttown"],
115 => [ 0, 0, 0, 0, "snowtown"],
116 => [ 0, 0, 0, 0, "farmvillage"],
117 => [ 0, 0, 0, 0, "castleoutside"],
118 => [ 0, 0, 0, 0, "castlethrone"],
119 => [ 0, 0, 0, 0, "castledungeon"],
120 => [ 0, 0, 0, 0, "churchoutside"],
121 => [ 0, 0, 0, 0, "churchinner"],
122 => [ 0, 0, 0, 0, "shipoutside"],
123 => [ 0, 0, 0, 0, "shipinside"],
124 => [ 0, 0, 0, 0, "heaven"],
125 => [ 0, 0, 0, 0, "heaveninner"],
126 => [ 0, 0, 0, 0, "bridge"],
127 => [ 0, 0, 0, 0, "ruins"],
128 => [ 0, 0, 0, 0, "shop"],
129 => [ 0, 0, 0, 0, "fort"],
130 => [ 0, 0, 0, 0, "fortinner"],
131 => [ 0, 0, 0, 0, "tower"],
132 => [ 0, 0, 0, 0, "evilcastle"],
133 => [ 0, 0, 0, 0, "towerinner"],
134 => [ 0, 0, 0, 0, "dungeonentrance"],
135 => [ 0, 0, 0, 0, "cave"],
136 => [ 0, 0, 0, 0, "magma"],
137 => [ 0, 0, 0, 0, "icecave"],
138 => [ 0, 0, 0, 0, "watercave"],
139 => [ 0, 0, 0, 0, "mine"],
140 => [ 0, 0, 0, 0, "sewer"],
141 => [ 0, 0, 0, 0, "innerbody"],
142 => [ 0, 0, 0, 0, "darkspace"],

# ID => [wx, wy, dx, dy, Backdrop Name]
200 => [10, 5, 1, 1, "cloudswhite"],
201 => [ 5, 5, 1, 1, "cloudsgrey"],
202 => [ 5, 10, -1, -1, "cloudsblack"],
203 => [10, 5, 1, 1, "cloudsblue"],
204 => [ 5, 5, -1, 1, "cloudspurple"],
205 => [ 5, 10, 1, -1, "cloudsred"],
206 => [10, 5, -1, 1, "cloudsorange"],
207 => [ 5, 5, 1, 1, "cloudsyellow"],
208 => [ 5, 10, 1, -1, "cloudsgreen"],

# ID => [wx, wy, dx, dy, Backdrop Name]
300 => [ 0, 0, 0, 0, "sun"],
301 => [ 0, 0, 0, 0, "cloudy"],
302 => [ 0, 0, 0, 0, "sunset"],
303 => [ 0, 0, 0, 0, "nightsky"],
304 => [ 0, 0, 0, 0, "mountains"],
305 => [ 0, 0, 0, 0, "ocean"],
306 => [ 0, 0, 0, 0, "weird"],
307 => [ 0, 0, 0, 0, "earth"],
308 => [ 0, 0, 0, 0, "moon"],
309 => [ 0, 0, 0, 0, "redstar"],
310 => [ 0, 0, 0, 0, "galaxy"],
}

end # VARIABLE
end # EVENT
module TOOLS

# This will let you set how you would like your backdrops to appear when
# you start a new game. In the order of Battle Shadow, Cover Opacity, Cover
# Layer, Front Layer, Middle Layer, and Back Layer.
STARTING_BACKDROPS = [false, 0, 0, 101, 200, 304]

# This will adjust how you would like the backdrops to appear when battle
# testing. Same ordering as above.
BTEST_BACKDROPS = [false, 0, 0, 136, 0, 0]

end
end #YE

so i think that for different areas i have to change STARTING_BACKDROPS = [false, 0, 0, 101, 200, 304] to what ever pics i need (different back drops in relation to the area), how can i change those values on the fly and make them take change?
 
You don't the script if I am not mistaken, you just set the variables values to the ones in that list,
just like in the picture in the website, (make sure you download the resource pack in the website).

The list you show there, is the current backdrop parts,

100 => [ 0, 0, 0, 0, "inner"],
inner is the file name of that backdrop part,
LAYER_COVER = 97 # This covers enemies. Dynamic
LAYER_FRONT = 98 # This is the front layer background. Static.
LAYER_MIDDLE = 99 # This is the middle layer. Dynamic.
LAYER_BACK = 100 # This is the final layer. Dynamic.

Set variable 100, in this case the Layer_Back, to some value of that list like 100, its the inner backdrop part, so you will have the inner show in back layer;
change var 98 to some other value, and keep changing the other values when you need to change the backdrop.

Hope it helps.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top