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 → Players are numbered
Players are numbered
2002-01-02, 6:52 AM #1
Did anyone notice that CA commented out two verbs from the JKSpecs' multiplayer list? They were:

GetPlayerNum()
GetPlayerThing()

Both take one parameter and return an integer. My theory is that players in a game are indexed. IE, the host is 0, the second player is 1, the third is 2, etc.

In that case:

index_num=GetPlayerNum(thing_num);
thing_num=GetPlayerThing(index_num);

SP testing seems to prove this, but it really needs to be tested in Multiplayer. And unfortuneatly, I can't do that right now.

Could someone spare the time?

[This message has been edited by SaberMaster (edited January 02, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-02, 9:01 AM #2
Hrmmmm, interesting.

*fires up second computer behind him and whips up a quicky cog*
-Hell Raiser
2002-01-02, 9:36 AM #3
Whooooooooooooooweeeeeeeeeee dogie!!!!

The host is 0, and the next player who joins will be 1, then the next will be 2, and so on!

this is the cog I whipped up:

Code:
# Test

symbols

thing		player			local
int			playernum		local

message		startup
message		pulse

end

code

startup:

	player=GetLocalPlayerThing();
	SetPulse(1);

return;

pulse:

	playernum=GetPlayerNum(player);
	PrintInt(PlayerNum);
	
	if(player==GetPlayerThing(playernum))
	{Print("Player is be PlayerThing Playernum");}
	

return;

end


It printed 0 for the host, and 1 for the computer behind me. I would assume that it would keep counting up for each player that joined. It also printed "Player is be PlayerThing Playernum" on both computers, yay!

While a join message with a counter on the host coulda easily came up with player number in order of joining, it's built into JK and runs over MP (I'd assume so), so why not use it. [http://forums.massassi.net/html/smile.gif] Using GetPlayerThing(playernum) takes away the need to store the player thing in a variable cuz its already in an array somewhere in JK. [http://forums.massassi.net/html/smile.gif] I'm sure there could be lots of great uses for this.

There, I did some testing/research, happy now? [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/biggrin.gif] Actually, when you think about it, I'm one of the ideal one's to do stuff like this, cuz, *fanfare* My old 233mhz, 64mb ram, Voodoo2 computer sits behind me (not bad for JK at all, 30-40fps in CO), and everyone in the house is on our LAN. [http://forums.massassi.net/html/smile.gif]

[edit]

One quick question, GetNumPlayers() returns the number of players in the game right? So there'd be no need for any counter of any kind. To get the last player that joined, you'd use GetPlayerThing(GetNumPlayers()-1); I'd assume.
[/edit]

------------------
-Hell Raiser
Cogging type person that does, umm, stuff?
"Free, your, mind."
DBZ: TDIR has a new home!

[This message has been edited by Hell Raiser (edited January 02, 2002).]
-Hell Raiser
2002-01-02, 10:50 AM #4
Thankyou, Hell Raiser [http://forums.massassi.net/html/wink.gif] You'll be credited, of course.

Yes, GetNumPlayers() returns the number of players in an MP game. And GetNumPlayers()-1 should return the index number of the last player.

The GetPlayer verbs should be very useful for keeping track of players in a game. One of the main uses I can see, is that GetPlayerThing(0) will return the thing number of the host.

In case anybody's wondering about my last few posts, I am working on a Cog Reference to replace the JKSpecs. And it's coming along quite well. [http://forums.massassi.net/html/biggrin.gif]

------------------
I never forget a face, but in your case, I'll be glad to make an exception. -Groucho Marx
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-02, 11:42 AM #5
I hate to burst your bubble, but GetNumPlayers() just returns the number of walkplayers in the current level. GetMaxPlayers() always returns '32' - the max the engine can handle [http://forums.massassi.net/html/frown.gif]

I would have loved these verbs to have worked, as I could readily use them to configure the number of bots for Rbots. [http://forums.massassi.net/html/frown.gif]

However, SendTrigger(GetPlayerThing(0), etc) is just what I'm looking for, to send a trigger exclusively to the host. [http://forums.massassi.net/html/smile.gif]

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here

[This message has been edited by Raynar (edited January 02, 2002).]
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2002-01-02, 11:59 AM #6
No, recheck that Raynar.

GetAbsoluteMaxPlayers() always returns 32.
GetMaxPlayers() returns the number of walkplayers.
GetNumPlayers() returns the number of players.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-02, 12:12 PM #7
Ah yes, my mistake, you're right. I remember going through these verbs looking for the max players that the host has set before launching the game, and coming up empty.

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2002-01-02, 4:38 PM #8
When are those cog verb references coming out? I'm finishing up my AI MP level and I'd love to learn about any new godies I can throw in. [http://forums.massassi.net/html/smile.gif]
2002-01-03, 9:50 AM #9
Bubble intact [http://forums.massassi.net/html/biggrin.gif]

My reference won't be releasable for at least another month. -And that would be just the verb descriptions. The complete version will take at least two months to finish, depending on how much material I decide to cover(EG, flags, tutorials, templates).

------------------
I never forget a face, but in your case, I'll be glad to make an exception. -Groucho Marx
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-03, 11:00 AM #10
SM - if your interested, I have a few suggestions for you.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-03, 1:13 PM #11
Heh woulden't of that verb totally scale down the need for the JKA cog into about 2 lines ????
2002-01-03, 2:57 PM #12
Pretty much Seifer, pretty much.

------------------
-Hell Raiser
Cogging type person that does, umm, stuff?
"Free, your, mind."
DBZ: TDIR has a new home!
-Hell Raiser
2002-01-04, 6:16 PM #13
I hate to say it, but this is one of those "needed hacker tidbits" thats been known for a while [http://forums.massassi.net/html/smile.gif] and you guys have the gist of it :
2002-01-04, 6:38 PM #14
Sure, GBK. Suggestions are welcome. [http://forums.massassi.net/html/wink.gif]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-04, 8:04 PM #15
.. well, it's so great that the "hackers" share and spread information freely.. wait, the non-hackers are doing that..
2002-01-05, 2:34 PM #16
The only suggestion I can remember at the moment:

Have a kindof 'commenting' on specific verbs, where there would be comments from coggers. Tips, tricks, things to aviod, that sort of thing. Any misc info on a verb that ones learns from actully using them.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-05, 4:46 PM #17
GBK: I know what you mean. The PHP site has something similar. Users can contribute notes to each function. As an example, here's the PHP 'switch' function http://www.php.net/manual/en/control-structures.switch.php .

This would require a dedicated site, of course, to host it.

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here

[This message has been edited by Raynar (edited January 05, 2002).]
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2002-01-05, 4:59 PM #18
It is fine for me to make such a system on my site, comment postable cog verb list.

Then, in the new jkspec, that you guys are working on, for each verbs, you can have a link to each comment page for better jkspec use.

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited January 05, 2002).]
2002-01-05, 11:59 PM #19
Hideki: Your site would be ideal, as it's the #1 source for cog references. [http://forums.massassi.net/html/smile.gif]

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2002-01-07, 8:13 AM #20
I'm doing something like that, GBK. I realize that reading the verb and translating it into a sentence is not good enough for a reference.

So, a good description is provided with the verb, and a more complete description of how to use certain types of verbs is provided in a "notes" document for each verb section.

By "type", I mean specific types of verbs such as: sector adjoin, player handle, thing flags, etc. You do realize that writing that kind of stuff out takes a lot of time?

I would greatly appreciate it if coggers contributed some verb info, but I've no plan for making some sort of commenting system. My reference is going to be downloadable - mainly because I want the pages to load quickly.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-07, 10:22 AM #21
Well, it wouldnt really have to be a system, rahter just another HTM page. Jumble all the comments together, and use bookmark hyperlinks to link the verb to the notes. That way, it would remain DLable.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-08, 1:46 PM #22
I can make that commenting system, but I was wondering how it should be done.

If it needs to be editable after the posting of a comment, then people need to register to edit only your own post. People don't like registering much, so I could make anyone edit anyone's post and post with any name they like then I have to think about abusive use of killing good comments...

What's the best way?
And how about ranking each comments? So people can easily pick up the good comments.

------------------
http://millennium.massassi.net/ - Millennium
2002-01-09, 5:33 AM #23
I was thinking more of a plain text file. We send the host our comments, and he/she adds them.

Although, if someone were to invest the time and resources on such a system, it would be nice.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-09, 9:16 PM #24
I think it takes more time and power to post all the sent comments, and comments don't get posted if the host person is busy and lazy, so I was thinking once the system is done, it should all go smoother.

------------------
http://millennium.massassi.net/ - Millennium

↑ Up to the top!