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 → King of the Hill -- multisector
King of the Hill -- multisector
2001-09-23, 1:16 PM #1
Hola-

I have to admit first and foremost, I haven't started to cog this, but I am going to add a Perfect Dark style King of the Hill to Rogue Squadron 2.0 -- I need to find a way to allow for multiple sectors at once to be the hill...then rotate to a different set of sectors (randomly) each time a hill is captured...anyone who's played PD knows what I mean.

I'm not asking for a complete coded out script...just some ideas on how to have multiple sectors in each hill, and how to rotate to a different hill when captured.

BTW, Rogue Squadron 2.0 is coming along nicely. Thanks to Hideki, new weapons are being added almost daily, and I'm squashing some of the minor bugs it used to have.

------------------
-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
2001-09-23, 2:17 PM #2
off the top of my head:

say there's 6 hills with 4 sectors to a hill.. use linkid to group all the sectors for one hill together, and use getsenderID() with enter/exit messages to determine who's in/how much time has gone by. use of rand() * 10 will give you the random element.. just split 10 into increments of 10/6 and depending on what the flex turns out, make that the new hill.

Example: rand() returns # from 0 to 1, so multiply by 10 to get a number from 1 to 10 (simply easier than messing with the smaller decimal #). If you have 10 hills, make 0-1 hill #1, 1-2 hill #2, and so forth. Then check against the flex produced from rand() * 10 and make the new hill from whatever the number falls between

Hope that helps, and that I didn't end up confusing you more.. if you want some code, I'll try to drop by again later. Maybe there's a much simpler/more efficient way, I'm just coming up with this as I'm typing [http://forums.massassi.net/html/smile.gif]

-Jipe
2001-09-23, 5:26 PM #3
I understood most of it, but the linkid thing lost me...

------------------
-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
2001-09-25, 6:00 PM #4
[IIRC]
Code:
symbols
sector hill1-1 linkid=1
sector hill1-2 linkid=1
sector hill1-3 linkid=1
sector hill1-4 linkid=1

sector hill2-1 linkid=2
sector hill2-2 linkid=2
sector hill2-3 linkid=2
sector hill2-4 linkid=2

sector hill3-1 linkid=3
sector hill3-2 linkid=3
sector hill3-3 linkid=3
sector hill3-4 linkid=3

sector hill4-1 linkid=4
sector hill4-2 linkid=4
sector hill4-3 linkid=4
sector hill4-4 linkid=4

end


that should make it so all sectors for hill 4 have getsenderID() of 4, all sectors for hill 2 have getSenderID() of 2, etc..

[/IIRC]
IF I RECALL CORRECTLY. THIS IS IN NO WAY FOR SURE
New! Fun removed by Vinny :[
2001-09-26, 2:51 PM #5
osiris hit it on the head - except, of course, no hyphens for the variables [http://forums.massassi.net/html/smile.gif]
2001-09-27, 12:01 AM #6
I can't have hyphens in the symbols section? Oh well, I can always use an underscore. "_" BTW, here's the latest update on what I've got thus far. Right now it's set up to be server only. Once I get it working, then I'll see about splitting it.

Code:
#
# KOTH_MAIN.COG
#
# King Of The Hill - Main Script
#
# Control any given hill for 20 seconds, and become
# King Of The Hill!
#

symbols

sector  hill0-1  		linkid=0
sector  hill0-2  		linkid=0
sector  hill0-3  		linkid=0
sector  hill0-4  		linkid=0
sector  hill0-5  		linkid=0
sector  hill1-1  		linkid=1
sector  hill1-2  		linkid=1
sector  hill1-3  		linkid=1
sector  hill1-4  		linkid=1
sector  hill1-5  		linkid=1
sector  hill2-1  		linkid-2
sector  hill2-2  		linkid=2
sector  hill2-3  		linkid=2
sector  hill2-4  		linkid=2
sector  hill2-5 	 	linkid=2
sector  hill3-1 		linkid=3
sector  hill3-2  		linkid=3
sector  hill3-3  		linkid=3
sector  hill3-4  		linkid=3
sector  hill3-5  		linkid=3
sector  hill4-1  		linkid=4
sector  hill4-2  		linkid=4
sector  hill4-3  		linkid=4
sector  hill4-4  		linkid=4
sector  hill4-5  		linkid=4

int	old_hill		local
int 	current_hill 		local
int 	current_hill_texture 	local
int	lock_capture		local

# Timers
#  6000 = Startup (1st hill)
#  6001 = Captured
#  6002 = Hill/Player Check
end

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

code

startup:

  If(IsServer()) SetTimerEx(30, 6000, 0, 0);

#----------------------------------------------------------------------

entered:

  If(lock_caputure == 1) Return;
  If(GetSenderID() == current_hill)
     {
	set_tint;
	lock_capture = 1;
	SetTimerEx(20, 6001, 0, 0);
	SetTimerEx(1, 6002, 0, 0);
	Return;
     }
  Return;

#-------------------------------------------------------------------

Timer:

  If(GetSenderID() == 6000) //1st Hill Setup
     {
   	current_hill = Rand() * 5;
   	current_hill_texture = current_hill + 10;
	Return;
     }
  Else
  If(GetSenderID() == 6001) //Captured Hill
     {
  	SetPulse(0);
  	Call captured_hill;
  	Return;
     }
  Else
  If(GetSenderID() == 6002) //Player-Hill Check
     {
	//Check to see if current capturers are still alive & there
	//Check to see if enemy team is also (reset counter if so?)
	SetTimerEx(1, 6001, 0, 0);
        Return;
     }
  Return;

#-------------------------------------------------------------------


captured_hill:

//add score to team

//move the hill	 
   old_hill = current_hill;
   current_hill = Rand() * 5;
   current_hill_texture = current_hill + 10;
   //Set Hill to current_hill linkid

#---------------------------------------------------------------------

team_setup:

  If(GetPlayerTeam(player) == 1) //Gold
     {
	set_tint = SetSectorTint(current_hill, '1 1 0');
	set_texture = SetSurfaceCell(current_hill_texture, 1); //??????
	Return;
     }
  Else
  If(GetPlayerTeam(player) == 2) //Red
     { 
	set_tint = SetSectorTint(current_hill, '1 0 0');
	set_texture = SetSurfaceCell(current_hill_texture, 2); //??????
	Return;
     }
  Else
  If(GetPlayerTeam(player) == 3) //Green
     {
	set_tint = SetSectorTint(current_hill, '0 1 0');
	set_texture = SetSurfaceCell(current_hill_texture, 3); //??????
	Return;
     }
  Else
  If(GetPlayerTeam(player) == 4) //Blue
     {
	set_tint = SetSectorTint(current_hill, '0 0 1');
	set_texture = SetSurfaceCell(current_hill_texture, 4); //??????
	Return;
     }
  Return;

end


The Surface cells are for the outside adjoins, so when people look at a tinted sector from the outside, the see the adjoined texture in that color.

But there's a big problem--I'm stuck. I'm not sure how to set up a constant check to see if the capturing team's players are still alive and in the sector, and whether any enemy team members are in it as well. (When an enemy comes in, the timer will stop) Any ideas?

------------------
-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

↑ Up to the top!