Variables/Counters/Flags

Remember it never hurts to ask, but you might not get it.

Moderators: andrewj, Corbin, Lobo

User avatar
wildweasel
Posts: 8
Joined: Thu 17 May 2007 1:22 am
Location: Waiting for Godot
Contact:

Variables/Counters/Flags

Postby wildweasel » Thu 17 May 2007 1:35 am

Alright, this one's a little complicated to explain for me, but I'll do my best.

What I want is a way to define variables in DDF, whether through DDF code itself (i.e. something like a #DEFINE statement at the beginning of a DDF file, or a seperate DDF file to keep track of them) or mid-game through specific DDF commands.

The applications of variables are very diverse and incredibly useful. So I'll make a few examples.

- JumpIf. Say you have a switch puzzle in your map, where the switch will do something different depending on where an arrow is pointing. The arrow positions would be defined through a single variable, and the switch would trigger an RTS script that would check this variable and then jump to a different point in the script depending on what its value is.

- Another JumpIf situation could occur in weapons. In my ZDoom weapon mod, The Stranger, the Auto-Pistol weapon has a tendency to jam. I accomplish this by randomly (3 times out of 256) jumping to a portion of weapon code that sets an IsJammed flag. The weapon's attack states checks if IsJammed is set, and if it is, refuses to fire and plays a little "jammed" animation instead. Pressing alt-fire clears the jam (and un-sets IsJammed, so the weapon will fire again).

- A monster that will only attack you if the variable "Bounty" is above 100, with various pickup items that will increase "Bounty" by small amounts.

- An animated texture that stops animating if the variable "BasePower" drops below a certain point (e.g. a computer screen or a glowing light).

- Music that begins playing once "Bounty" reaches a high enough level (for action music situations).

There's all kinds of applications for this. As far as I can tell, this is the one thing ZDoom has that EDGE really, desperately needs. With this, the power of EDGE should be vastly increased.
(Sig lengths are too short for me to use my regular sig. Sorry.)

User avatar
andrewj
Posts: 698
Joined: Sat 05 May 2007 11:22 am
Location: Tasmania

Postby andrewj » Thu 17 May 2007 4:57 am

Better scripting is definitely planned. I would say more, but it could be quite a while before I get around to it.

User avatar
BaronOfStuff
Posts: 217
Joined: Thu 25 Oct 2007 11:40 am
Location: Over the horizon somewhere in England
Contact:

Re: Variables/Counters/Flags

Postby BaronOfStuff » Fri 26 Oct 2007 1:32 pm


User avatar
Dartmerc
Posts: 570
Joined: Tue 21 Aug 2007 3:25 am
Location: Sydney
Contact:

Postby Dartmerc » Sat 27 Oct 2007 2:00 am


User avatar
wildweasel
Posts: 8
Joined: Thu 17 May 2007 1:22 am
Location: Waiting for Godot
Contact:

Postby wildweasel » Wed 30 Jan 2008 2:17 am

Hey, uh, am I permitted to bump things? Just wanted to see what was going on with this feature...currently it's one of a few things currently tying me to GZDoom.
(Sig lengths are too short for me to use my regular sig. Sorry.)

User avatar
Joppu
Posts: 174
Joined: Tue 15 May 2007 5:37 am
Location: Finland
Contact:

Postby Joppu » Wed 30 Jan 2008 6:35 am

Yeah variables could be very useful. Some variable types could be

var.local for use in just one entry.
var for use in the whole rts/ddf script.
var.global for use in both rts/ddf scripts globally.

User avatar
andrewj
Posts: 698
Joined: Sat 05 May 2007 11:22 am
Location: Tasmania

Postby andrewj » Wed 30 Jan 2008 10:29 am


User avatar
Visplane Overflow
Posts: 178
Joined: Tue 15 May 2007 11:01 pm
Location: We can't stop here, this is maple syrup country.

Postby Visplane Overflow » Wed 30 Jan 2008 4:01 pm


User avatar
Nick_Perrin
Posts: 210
Joined: Tue 15 May 2007 2:38 am
Location: Canada
Contact:

Postby Nick_Perrin » Wed 30 Jan 2008 11:23 pm


User avatar
wildweasel
Posts: 8
Joined: Thu 17 May 2007 1:22 am
Location: Waiting for Godot
Contact:

Postby wildweasel » Thu 31 Jan 2008 3:34 am

(Sig lengths are too short for me to use my regular sig. Sorry.)

User avatar
Corbin
Posts: 657
Joined: Mon 09 Jul 2007 6:10 am
Location: vice city, california
Contact:

Postby Corbin » Thu 31 Jan 2008 7:05 am


User avatar
Lobo
Posts: 347
Joined: Wed 09 May 2007 8:04 pm
Location: Spain
Contact:

Postby Lobo » Thu 31 Jan 2008 8:20 pm

You wouldn't have to learn a new language, you could still keep using RTS if you wanted.
, Lonely Meadows TC,
, DoomP.A.L.

User avatar
Liberation
Posts: 338
Joined: Mon 14 May 2007 4:36 pm
Location: England

Postby Liberation » Thu 31 Jan 2008 9:33 pm

I be happy to donate as well :D

User avatar
wildweasel
Posts: 8
Joined: Thu 17 May 2007 1:22 am
Location: Waiting for Godot
Contact:

Postby wildweasel » Fri 01 Feb 2008 3:11 am

(Sig lengths are too short for me to use my regular sig. Sorry.)

User avatar
Nick_Perrin
Posts: 210
Joined: Tue 15 May 2007 2:38 am
Location: Canada
Contact:

Re: Variables/Counters/Flags

Postby Nick_Perrin » Fri 01 Feb 2008 3:43 am


User avatar
wildweasel
Posts: 8
Joined: Thu 17 May 2007 1:22 am
Location: Waiting for Godot
Contact:

Re: Variables/Counters/Flags

Postby wildweasel » Fri 01 Feb 2008 11:23 pm

(Sig lengths are too short for me to use my regular sig. Sorry.)

User avatar
Nick_Perrin
Posts: 210
Joined: Tue 15 May 2007 2:38 am
Location: Canada
Contact:

Re: Variables/Counters/Flags

Postby Nick_Perrin » Sat 02 Feb 2008 8:01 am



Return to “Feature Suggestions”

Who is online

Users browsing this forum: No registered users and 2 guests