Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Where am I stepping?
Where am I stepping?
2002-01-27, 12:30 PM #1
I was just toying around with the idea of 'ice cleats', and was wondering what would be the best way to go about changing surface flags once a player picks the cleats up.

Can I set it up so that it checks all surfaces for ice flags? Or, can I use a pulse and check to see what the flags are of the surface he's standing on?

Just hunting for ideas to see if it's worth it.

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2002-01-27, 12:47 PM #2
Running an array checking for icy floors would be the easiest way:

Code:
For(I=0;I<=Getsurfacecount();I=I+1) {
If(Getsurfaceflags(I) == ICE_FLAG) {
Setsurfaceflags(I, NEW_FLAGS); } }


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-27, 2:50 PM #3
Might want to go with "&" instead of "==".

------------------
http://millennium.massassi.net - Millennium
Sniper Arena! - Enhancement Pack!
2002-01-27, 3:54 PM #4
Hmmm...I'll try that, thanks. Now I just need an icy level, since I'm too lazy to make one.

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2002-01-28, 3:07 PM #5
Question -- What if it has multiple flags? Like it's flagged as floor, and metal, and ice? I don't know why that would be, but hey, it might happen. Would pick out the ice flags, or would it look at the whole flag in general?

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2002-01-28, 3:58 PM #6
That's what my post was meant about.

if(something == anotherthing)

This means if "something" is exactly "anotherthing", while,

if(something & anotherthing)

This means, if "anotherthing" is included in "something".

------------------
http://millennium.massassi.net - Millennium
Sniper Arena! - Enhancement Pack!
2002-01-28, 10:21 PM #7
So, if I understand right, I would put:

Code:
    	    For(I=0;I<=Getsurfacecount();I=I+1)
              {
		If((Getsurfaceflags(I) & 0x1000) || (Getsurfaceflags(I) & 0x2000))
                  {
			Setsurfaceflags(I, 0x1);
                  }
              }


The || <--- that means OR right? I.E. Flags are set to 'icy' OR 'very icy'?

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2002-01-29, 1:10 AM #8
Right. That means, if the surface flag includes icy or includes very icy, it sets the surface flag to 0x1.

------------------
http://millennium.massassi.net - Millennium
Sniper Arena! - Enhancement Pack!

↑ Up to the top!