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 → Something must be wrong... Cavey needs help!
Something must be wrong... Cavey needs help!
2001-10-05, 6:22 AM #1
okay, i just need to know how i could link every sector in a level as one... I have 300+ sectors in my level so i don't wanna type every sector manually [http://forums.massassi.net/html/smile.gif]

------------------
Guns don't kill people. Kids who play computer games do.
[edit: Visit Cave_Demon's site: http://cave2.2ya.com ! -stat]
[This message has been hacked by StaticX (edited September 11, 2001).]
WHAT?
2001-10-05, 7:02 AM #2
Okay,
Try using a for() loop in your cog to go through all the sectors, and set whatever needs to be set in it.

Code:
symbols

...
int         NumSectors         
#Set this in Jed to however many sectors you have, since I haven't figured out how to get the SectorCount at the moment.  
#I'm not even sure that there is a way.

end

...
for(int i=0;i<=NumSectors;i=i+1){
//do stuff using i as the sector ref
}
...


Hopefully that should work for you. I'm pretty sure I got the for() loop syntax correct, but I may be mistaken on the condition part.

------------------
LordVirus: His pot is blacker than his kettle!

Visit Virus Productions!

[This message has been edited by LordVirus (edited October 05, 2001).]
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2001-10-05, 7:56 AM #3
It doesn't werk! [http://forums.massassi.net/html/biggrin.gif]
Okay, so what it should do is red flashing light in every sector. Copy that?
Code:
symbols

message		startup
message		pulse

int	NumSectors

float		period=1.0

int		cmap=0		local

end

# ========================================================================================

code

startup:
	SetPulse(period);
	return;

# .................................................................................

pulse:
	cmap = 1 - cmap;
	for(int i=0;i<=NumSectors;i=i+1) {
	SetColorMap(NumSectors, cmap);
	}
	return;

end


------------------
Guns don't kill people. Kids who play computer games do.
[edit: Visit Cave_Demon's site: http://cave2.2ya.com ! -stat]
[This message has been hacked by StaticX (edited September 11, 2001).]
WHAT?
2001-10-05, 9:10 AM #4
Code:
symbols

message		startup
message		pulse

int	sector_i		local

float		period=1.0

int		cmap=0		local

end

# ========================================================================================

code

startup:
	SetPulse(period);
	return;

# .................................................................................

pulse:
	cmap = 1 - cmap;
	for (sector_i = 0; sector_i < GetSectorCount(); sector_i = sector_i + 1) {
	SetSectorColorMap(sector_i, cmap);
	}
	return;

end


[This message has been edited by ~Rishka~ (edited October 05, 2001).]
2001-10-05, 10:41 AM #5
IT WORKS! OH, THANKYOUTHANKYOUTHANKYOUTHANKYOU!!!!!!!!!11111
[http://forums.massassi.net/html/biggrin.gif]
/me hugs ~Rishka~

------------------
Guns don't kill people. Kids who play computer games do.
[edit: Visit Cave_Demon's site: http://cave2.2ya.com ! -stat]
[This message has been hacked by StaticX (edited September 11, 2001).]
WHAT?
2001-10-05, 11:22 PM #6
lol risha that it the excact cog I was aobut to make :P

Damn it , wheres my hug , I would of helped you if risha didn't get there first [http://forums.massassi.net/html/smile.gif]

and BTW just as risha has written , GetSectorCount() will get the number of sectors in a level.
2001-10-06, 6:08 AM #7
You're Welcome, You're Welcome, You're Welcome lol

/me hopes Cave is a girl. j/k

p.s. Seifert, quit trying take credit for my coding lol... j/k... I just have no life so i was able to post it quicker hehe =)

↑ Up to the top!