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 → I know it can be done! But I'm lazy...
I know it can be done! But I'm lazy...
2002-03-15, 7:04 AM #1
A while ago my brother was fiddling with MSPAINT and made this slightly cheezy cracked glass texturish... thing. Anyway, that got me thinking; how hard would it be to write a cog that handled glass like the normal cog, except that the first time it was shot it changed to this cool cracked glass, and then shattered when it was shot again. I'm sure it could be done, but I don't know how you would do it... Do you use some sort of int to count how many times it's been damaged? Anyway, if anyone can give me a clue (or maybe just write the cog for me... yeah...), I'd appreciate it.

------------------
I am a Christian.
I have a guidebook for life.
I have a friend who accepts me as I am.
I have a promise that will last for eternity.
What do you have?
Cynic (sin'ik) n. One of a sect of ancient Greek philosophers who held that virtue is the ultimate goal of life, their doctrine gradually coming to symbolize insolent self-righteousness.

Drink So-Be, and play longer!
2002-03-15, 7:58 AM #2
you could indeed have a cog attached to the surface, in which you would use an int to to store how often it had been damaged. Then use a mat for the surface with 2 cells, the second cel should be your cracked glass. In the cog, check the int and if it was the first time (int = 0), use SetMaterialCel(bla)...the only problem is, that you can only have one window like this...
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-03-15, 8:03 AM #3
sorry, i made a mistake...you have to use SetWallCel(surface, cel). This way you can have multiple windows...

------------------
I am no Christian.
I have no guidebook for life.
I have no friend who accepts me as I am.
I have no promise that will last for eternity.
I am no dreamer.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-03-15, 10:16 AM #4
Add this to the normal glass cog:

Code:
Startup:
Setwallcel(Surface, 0);
Stop;
Damaged:
If(Getwallcel(Surface) == 0) Setwallcel(Surface, 1);
Else

//Glass code here


------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-03-19, 3:50 AM #5
Um, you'd think that woulda worked, but all I get is this neat effect of the glass not breaking(ARg!). I did add the second surface to the damaged message so it would change that as well, but thats all I did.
Cynic (sin'ik) n. One of a sect of ancient Greek philosophers who held that virtue is the ultimate goal of life, their doctrine gradually coming to symbolize insolent self-righteousness.

Drink So-Be, and play longer!

↑ Up to the top!