You are not logged in.
Pages: 1
"custom1"
"custom2"
(...)
custom(1)
custom(2)
(...)
exemple:
// ------------------------------------------------------------
// Open Surge Engine 0.2.0 level
// This file was generated by the built-in level editor.
// ------------------------------------------------------------
// header
name "Jungle Hill"
author "MatheusRRR"
version "1.0"
requires 0.2.0
act 1
theme "themes/crisis_city.brk"
bgtheme "themes/crisis.bg"
spawn_point 16 288
music "musics/crisis.ogg"
grouptheme "themes/crisis.grp"
startup ".fire_crysis_startup"
players "Silver" "Blaze"
custom1 "images/1.png" <============
(...)
This command can store variables for the specific level.
Suppose the "custom1" has the value "icon_level1.png" and hud has a command to display the icon for specific level. Depending on the value of "custom variable", each level may have a different icon.
this suggestion will be useful for the game?
Offline
oh coool! i like that.
Not active much anymore.
The only things I do now is just let inspiration come to me when it's needed.
Also bad profile pic because I don't have anything else in mind.
Offline
hmmmmm, you can do that already, can't you?
We usually define strings in the language files (.lng). That said, you could have an entry like
TEXT1_LEVEL1 "hello!"
then, in the .lev file, you'd have:
startup ".fire_crysis_startup" ".level1_startup"
where .level1_startup would set some global $_LEVELID to one (or two, or three...). Finally, when you want to access you TEXT1_LEVEL? string, in any level, you print $TEXT1_LEVEL$_LEVELID.
Offline
that might work, but with the custom variable would save time and space. Suppose an object specific to each level he walk "ypos" a certain height for other, with a certain speed. looks simple but is not. if we make the object, each phase would have the startup logging, but it all by code. In the case of custom variable, he would record these variables without using objects, leaving the game in less space.
example "using objects"
// ------------------------------------------------------------
// Open Surge Engine 0.2.0 level
// This file was generated by the built-in level editor.
// ------------------------------------------------------------
// header
name "Jungle Hill"
author "MatheusRRR"
version "1.0"
requires 0.2.0
act 1
theme "themes/crisis_city.brk"
bgtheme "themes/crisis.bg"
spawn_point 16 288
music "musics/crisis.ogg"
grouptheme "themes/crisis.grp"
startup ".fire_crysis_startup" ".levels_startup"
players "Silver" "Blaze"
(...)
+
object ".levels_startup"
{
requires 0.2.0
state "main"
{
if "level()=a" and "act()=b" "ab"
if "level()=a" and "act()=c" "ac"
(...)
}
}
example "using custom variable"
// ------------------------------------------------------------
// Open Surge Engine 0.2.0 level
// This file was generated by the built-in level editor.
// ------------------------------------------------------------
// header
name "Jungle Hill"
author "MatheusRRR"
version "1.0"
requires 0.2.0
act 1
theme "themes/crisis_city.brk"
bgtheme "themes/crisis.bg"
spawn_point 16 288
music "musics/crisis.ogg"
grouptheme "themes/crisis.grp"
startup ".fire_crysis_startup"
players "Silver" "Blaze"
custom1 "images/1.png" <============
(...)
only
Offline
hmmm, it has just occurred that there's an even simpler thing! How about this:
1) You're dealing with strings here, correct? Define your custom strings in the .lng file - as you probably know, all strings are defined there.
CUSTOM1_sunshine "abc"
CUSTOM1_waterworks "xyz"
only this
2) You don't need a bunch of startup objects, nor to deal with a lot of code. Just access that string when you need it.
Suppose that there's some $LEVEL_FILE set to "sunshine" or "waterworks", automatically (there isn't, right now, but there could be). Then, accessing your string is a matter of printing
$CUSTOM1_$LEVEL_FILE
very simple!!
does that help?
Offline
yes, u are right.
Offline
Pages: 1