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 → Requireing MP cogs!
Requireing MP cogs!
2003-04-04, 11:22 PM #1
Hi!
I reqire COGs that work in MP. And it's JK...

1 - A goal COG: How do I do so that when a specific object (a ball) enters a sector, there will be an increas in score, and any player that arrives a little later his "score value" will compensate?

2 - Spinning ball: How do I make an object spin accordingly to the speed and direction it's moving in (like a ball)?

Gah... Just remembered one more COG question. How do I make the players Always Invul?

/Edward
------------------
ATM2: Blippidadooda...
Creepio: I give up, what is gold and goes Bump Bump Bump...

[This message has been edited by Edward (edited April 05, 2003).]
Edward's Cognative Hazards
2003-04-05, 11:37 AM #2
1) Write a cog for the sector that has an entered message. Give the sector variable a mask of 0xfff. In the entered message, test to see if the entering thing is your ball. If it is, set a variable (eg, on) to 1. Also in the entered message test to see if on is 1 and if the entering thing is a player. If true, give the entering player however many more kills you want to give him.

2) It's possible, but difficult to do...

3) SetActorFlags(player, 0x8);

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-04-05, 12:41 PM #3
OK... I understood half of what you said about #1... Up until Also...

#2... Ok... If it is too difficult to make it spin like a ball, is there a way to make it rotate all the time?

#3... SetActorFlags(player, 0x8)... Ok... That didn't work... I typed it straight from the Super Shield Powerup COG. Nothing!
Code:
# Always Invul
#
# By Edward
symbols

message		startup
message		newplayer
message		pulse
int         bin=62                           local

int		i=0	local

end
#
code
startup:
	SetActorFlags(GetLocalPlayerThing(), 0x8);
	SetThingFlags(GetLocalPlayerThing(), 0x4);
	SetInvActivated(GetLocalPlayerThing(), bin, 1);
	jkSetSuperFlags(2);
	SetPulse(1);
return;
pulse:
	If(i=1)	
	{
		jkClearSuperFlags(2);
		i=0;
	}
	else if(i=0)
	{
		jkSetSuperFlags(2);
		i=1;
	}
return;
newplayer:
	SetActorFlags(GetLocalPlayerThing(), 0x8);
	SetThingFlags(GetLocalPlayerThing(), 0x4);
	SetInvActivated(GetLocalPlayerThing(), bin, 1);
	jkSetSuperFlags(2);
	SetPulse(1);
Return;
end


/Edward
------------------
ATM2: Blabidabiboop!
Creepio: What cannon fodder? NOOOOOOOO!
Edward's Cognative Hazards
2003-04-05, 6:28 PM #4
Y'know, if SetThingRotVel() used a Heading vector and not P/Y/R, you could just set it to it's Velocity. If there's a way to convert a heading vector into P/Y/R then you'd have it made in the shade.

------------------
-Hell Raiser
Remember kiddies, trial and error.
Without struggles there is no progress
DBZ: The Destruction is Real
-Hell Raiser
2003-04-06, 6:34 AM #5
Just figured out what was wrong with 3! I needed a delay! Now about 2 and 1...
------------------
ATM2: Blapidedibadoo!
Creepio: You wouldn't dare play quidich with me, would you?

[This message has been edited by Edward (edited April 06, 2003).]
Edward's Cognative Hazards
2003-04-06, 9:12 AM #6
OK! Number one completed! All I needed was the mask, and Parsec to take away the faults! Now number 2 is all that is left! That one's going to be hard...

/Edward
------------------
ATM2: Blicpoolabeen...
Creepio: Yes, being able to look straight up is quite a new sensation...
Edward's Cognative Hazards
2003-04-07, 4:08 AM #7
Ah! No wait! Number one isn't totally complete! I haven't added anything that would compensate the score for the other players that come in an hour late. Some one HELP!!!
Code:
# GOAL! MÅL! WHATEVER! SKITSAMMA!
#
# By Edward
symbols

message		startup
message		entered

sector		rgoal		mask=0xfff
sector		ggoal		mask=0xfff

thing		ball

int		rscore=0	local
int		gscore=0	local
int		s=0		local
int		m=0		local
int		h=0		local

message		pulse

sound		GoldMore
sound		RedMore
sound		Tada

end
#
code
startup:
	SetPulse(1);
return;
entered:
	If(GetSourceRef()!=ball) return;
	PlaySoundGlobal(Tada,1,0,0xC0);
	If(GetSenderRef()==rgoal)
	{
		gscore=gscore+1;
		print("Goal in Red!");
		printint(gscore);
		printint(rscore);
		if(rscore>gscore)
		{
			PlaySoundGlobal(RedMore,1,0,0xC0);
		}
		Else if(rscore<gscore)
		{
			PlaySoundGlobal(GoldMore,1,0,0xC0);
		}
		Else
		{
			print("EQUAL...");
		}
	}
	Else if(GetSenderRef()==ggoal)
	{
		rscore=rscore+1;
		print("Goal in Gold");
		printint(gscore);
		printint(rscore);
		if(rscore>gscore)
		{
			PlaySoundGlobal(RedMore,1,0,0xC0);
		}
		Else if(rscore<gscore)
		{
			PlaySoundGlobal(GoldMore,1,0,0xC0);
		}
		Else
		{
			print("EQUAL...");
		}
	}
return;
pulse:
	s=s+1;
	If(s>=60)
	{
		m=m+1;
		s=0;
	}
	If(m>=60)
	{
		h=h+1;
		m=0;
	}
return;
end


/Edward
------------------
ATM2: Blapoodopeeda
Creepio: No way are you playing soccer with me!
Edward's Cognative Hazards
2003-04-07, 5:59 AM #8
couldent you jsut randomly change the direction of the roll, just by setting its vector in a cog? no one would notice, ither that or you could use some kind of key-pup thing, so if it moves forwards it rolles the right way (useing a key), and left right or backwards you could do the same. you could also make it throwable, that would be easyer to move in teh level like a ball.

------------------
I am pjb.
Another post......
another moment of my life wasted.....
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-04-07, 6:04 AM #9
edward you double posted that, delite on o them please.

------------------
I am pjb.
Another post......
another moment of my life wasted.....
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-04-07, 6:06 AM #10
edward you double posted that, delite on o them please.

------------------
I am pjb.
Another post......
another moment of my life wasted.....
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-04-07, 7:38 AM #11
Quote:
<font face="Verdana, Arial" size="2">
edward you double posted that, delite on o them please.
</font>

Your no better... But hay! Sometimes the server is slow and when my browser says time out the server might have picked up all the info. Oh well. Let's just delete our copies...
Quote:
<font face="Verdana, Arial" size="2">
couldent you jsut randomly change the direction of the roll, just by setting its vector in a cog? no one would notice, ither that or you could use some kind of key-pup thing, so if it moves forwards it rolles the right way (useing a key), and left right or backwards you could do the same. you could also make it throwable, that would be easyer to move in teh level like a ball.
</font>

Hmmm. Pup... Key... I'll try that!
And have my ball as a thowable. Already done!
Now... About syncronizing the score between the player who hosted and the player that came an hour too late?

/Edward
------------------
ATM2: Bluuurp...
Creepio: Yes, I know... It's, a roid's, head...

[This message has been edited by Edward (edited April 07, 2003).]
Edward's Cognative Hazards
2003-04-07, 8:28 AM #12
Hm... The puppet didn't work.
Code:
# Puppet file for the ball.
# Suggested by [SF]pjb
# Made by Edward

Mode=0
# action	key		flag	?	?
walk		rollf.key	0x01	2	2
walkback	rollb.key	0x01	2	2
strafeleft	rolll.key	0x01	2	2
straferight	rollr.key	0x01	2	2
fall		rolld.key	0x01	2	2
hit		rollh.key	0x28	1	4

Mode=1, basedon=0

Mode=2, basedon=0

Mode=3, basedon=0

Mode=4, basedon=0


/Edward
------------------
ATM2: MeepMoopMap!
Creepio: No, you may NOT sell me as a hood onament...
Edward's Cognative Hazards
2003-04-08, 12:52 AM #13
Thats odd, you set the pup in the template? and then placed the item in your level? and asighend the sector? and put the key's in the gob?

i got a nifty four armed charicter to work last night, if you want i will make the ball for you.

------------------
I am pjb.
Another post......
another moment of my life wasted.....
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-04-08, 9:05 AM #14
The reason SetActorFlags(player, 0x8) didn't work is because kyle.cog makes a player invul for a few seconds and then turns it off when a player spawns. So it won't work right away on startup and MP spawning will turn it off.

Quote:
<font face="Verdana, Arial" size="2"> About syncronizing the score between the player who hosted and the player that came an hour too late?</font>


From the DM:

Quote:
<font face="Verdana, Arial" size="2">The engine does not allow client computers to change the scores - only the server can. And when the server modifies a score, it will send the new scores to the clients.</font>


And it follows that the server will give a joining client the current scores - so just make sure your scoring cog runs on the server.



------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-04-08, 9:16 AM #15
I know nothing about server COGging... I will require LOTS of help! If you look further up this topic you'll see what I've got so far. (8 replies to be exact.)

/Edward
------------------
ATM2: Blapidoobeip
Creepio: Blapidoobeip
Edward's Cognative Hazards
2003-04-09, 3:35 PM #16
Don't worry about syncing the scores or client/server issues. You shouldn't have to worry about that. A cog without flags runs on the server only and syncs its changes with clients - just remember that class and item cogs have default flags.

As for the puppet, I'm not sure. It's probably your implementation.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-04-15, 9:35 AM #17
Quote:
<font face="Verdana, Arial" size="2">Originally posted by SaberMaster:
Don't worry about syncing the scores or client/server issues. You shouldn't have to worry about that. A cog without flags runs on the server only and syncs its changes with clients - just remember that class and item cogs have default flags.

</font>

So, what you are saying is that I can have a COG with the value gscore, I do something so that this value increeses, and when a player comes in when the value is 10, the other player's gscore value is 10? Sounds almost too obvious... But just to make sure you haven't missunderstood, I'll post my COG once again...
Code:
# GOAL! MÅL! WHATEVER! SKITSAMMA!
#
# By Edward
symbols

message		startup
message		entered

sector		rgoal		mask=0xfff
sector		ggoal		mask=0xfff

thing		ball
thing		fornow

int		rscore=0	local
int		gscore=0	local
int		s=0		local
int		m=0		local
int		h=0		local

message		pulse

sound		GoldMore
sound		RedMore
sound		Tada
sound		creating

thing		new
thing		x
template	poof
template	sh

end
#
code
startup:
	SetPulse(1);
return;
entered:
	If(GetSourceRef()!=ball) return;
	PlaySoundGlobal(Tada,1,0,0xC0);
	If(GetSenderRef()==rgoal)
	{
		gscore=gscore+1;
		print("Goal in Red!");
		printint(gscore);
		printint(rscore);
		if(rscore>gscore)
		{
			PlaySoundGlobal(RedMore,1,0,0xC0);
		}
		Else if(rscore<gscore)
		{
			PlaySoundGlobal(GoldMore,1,0,0xC0);
		}
		Else
		{
			print("EQUAL...");
		}
	}
	Else if(GetSenderRef()==ggoal)
	{
		rscore=rscore+1;
		print("Goal in Gold");
		printint(gscore);
		printint(rscore);
		if(rscore>gscore)
		{
			PlaySoundGlobal(RedMore,1,0,0xC0);
		}
		Else if(rscore<gscore)
		{
			PlaySoundGlobal(GoldMore,1,0,0xC0);
		}
		Else
		{
			print("EQUAL...");
		}
	}
	CreateThing(poof,ball);
	StopThing(ball);
	TeleportThing(ball,fornow);
	sleep(1);
	PlaySoundThing(creating,new,1,-1,50,0xC0);
	sleep(1);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(poof,ball);
	StopThing(ball);
	TeleportThing(ball,new);
	CreateThing(poof,x);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
	CreateThing(sh,new);
	sleep(0.05);
return;
pulse:
	s=s+1;
	If(s>=60)
	{
		m=m+1;
		s=0;
	}
	If(m>=60)
	{
		h=h+1;
		m=0;
	}
return;
end

/Edward
------------------
[http://sevtrek.vinyamar.com/archives/s599.jpg]
Edward's Cognative Hazards
2003-04-16, 10:28 AM #18
HELLO? IS ALL WELL WITH THIS COG?
Edward's Cognative Hazards
2003-04-16, 4:08 PM #19
if it is the cog keeping score then that cog is fine. if you want it to really change the teams score that the game keeps track of then that cog wouldnt do it.

one other thing. if you are going to want it to print those goal messages to everyone you'll need to change it. the print verb only prints to the hosts computer. to make it print the message to everyone it would need to be like this.
Code:
jkStringClear();
jkStringConcatAsciiString("GOAL");
jkStringOutput(-3, -1);
jkStrintClear();

you will need one of those for each print message.

------------------
Famous last words - "It seemed like a good idea at the time."
2003-04-16, 10:09 PM #20
So tell me... What do I use instead of PrintInt?
And how do I change the Game Score like that?

/Edward
Edward's Cognative Hazards
2003-04-17, 1:31 PM #21
Code:
jkStringClear();
jkStringConcatInt(int);
jkStringOutput(-3, -1);
jkStringClear();

thats how you would print an int in mp.

------------------

[This message has been edited by DSLS_DeathSythe (edited April 17, 2003).]
Famous last words - "It seemed like a good idea at the time."

↑ Up to the top!