PDA

View Full Version : (Scripted) Custom Counters still aren't possible?



ShadowTiger
10-04-2008, 03:16 PM
Just wondering if it's at all possible to store (And even harder, somehow indicate their value to the player.) certain values in various places.

I only mean the question's intricacies in terms of a (rather selfish) question regarding wondering if it's possible yet to keep track of various different pickups.

For example, I'm making a Fallout (II) Tileset. If you've ever played Fallout 1 or 2, you'll know that you've got a hell of a lot of different types of ammo to keep track of.

... Yeah. You get the idea.


So isn't it possible to just make a global script which keeps track of like, ten different values, and then script the ammo pickup items to increase certain values by their amounts, and when you fire the appropriate weapon, to subtract from that value? Shouldn't be hard, I would imagine.

The question is, are there enough global values? Will Fallout-type quests need to rely on some other kind of data tracker due to a startling lack of Global Values?



Er .. Also, what item is that which the script would be attached to? Bow, Arrow, or Bow & Arrow? Thanks. :p

_L_
10-04-2008, 11:41 PM
What do you mean "enough global values"? If you want one, you just define a variable in global scope.

ShadowTiger
10-05-2008, 12:10 AM
Well, coming from someone who hasn't taken that big of a step into scripting, much less actually works with it on a near-daily (If not hourly.) basis, I wouldn't be surprised if I wouldn't know if there was a maximum number of slots for global values, i.e. D0-D8 vs A0-A2, or G0-G8 etc. Not familiar enough with them yet to truly know for sure what's what.

In fact, you could say that it's why I'm inquiring. :p

So long story short, I can indeed contain all of these values and modify them via using a scripted item. Great. Thanks.

Joe123
10-05-2008, 11:59 AM
Expressing them all on the subscreen, however, is a different matter.

//Draws an integer as a counter
void CustomCounter(int x, int y, int counter, int digits){
for(int i=0;i<digits;i++) Screen->DrawTile(6,x+((digits-1)*8)-i*8,y-56,ZeroTile+(Floor(counter/Pow(10,i))%10),1,1,0,1,0,0,0,0,true,128);
}

One for which you might like to use this void.