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 → MultiPlayer Questions
MultiPlayer Questions
2003-04-15, 11:27 AM #1
Hi!
I'm not sure how COGs work in multiplayer so I'd like to ask some questions if you don't mind...

1-RAND_CEL-: Let's say I have a surface with the material of a TV that has 8 cels. Then I make a COG so that when I activate the TV, it will play sound and a movie will show. Now the COG won't play the cels in order but randomly. Sort of like this... pulse: SetWallCel(tv,rand()*7); Let's say it is a guy who speaks and his lips move randomly. Now I wonder, When I activate this TV I see and hear the man speak as I activate it, but will the other players see and hear the man speak as I activate it?

2-ACTIVE_OR_NOT-: I make a COG that will move something, and in this COG I have an int (let's say on). When I activate a switch the on will become 1 preventing the switch from being activated again until on is 0. Will this apply to the other players?

3-TELEPORTING-: I make a COG that teleports a player when he hits the switch. But if I just say... activated: If(GetSenderRef()==switch) { TeleportThing(GetLocalPlayerThing(),destination); will that teleport only the one who press the switch or everyone?

4-COMPLEX-: I've made a complex COG that opens a door, fills a sector with water and gives a lot of thrust like if the water comes pouring in. I wonder, will all players in that sector get thrusted about, or only he who opened the door?

5-AI_CREATION-: I've been thinking of making an Actor that gets created in a spot and then will move in random directions. I have this feeling that if I say x=rand, etc, everyone will see him go one way but it won't be syncronized. One might see him turn left at the same time as someone else might see him turn right. Any suggestions?

6-CAM_LOOK-: A COG that makes a nice little Cut-Scene before the fight. A guy hosts, he sees the Cut-Scene first. The camera moves and shows stuff. A guy joins a little later, what happens, will this guys COG kick in and move the camera back to frame one, or will everyone's views all of a sudden return to camera 1, or what? And if any of these things happen, how can I sepperate the different views so that Host guy sees the movie from beginning to end and the joining guy sees it without inturrupting the Host guy?

That's it for now! Please reply soon!

/Edward
------------------
If only the world was easy...
Edward's Cognative Hazards
2003-04-15, 4:03 PM #2
1: yes.

2: yes.

3: that teleport wouldnt work right, if you put it in that way it would just teleport the host whenever anybody activates the switch. to get it to just teleport the person that activates it would be something like this.
Code:
activated:
  if(GetSenderRef() == switch)
    TeleportThing(GetSourceRef(), destination);
return;

the GetSourceRef() will get the person that activated the switch and teleport only him.

4: that cog should work for everyone.

5: ai in mp levels dont work too well from what ive tried, unless you take total control of what the ai does it will usually end up doing different things on everyones computers. i havent experimented with it too much though.

6: i havent messed with cutscenes and am not sure if they work in mp. i would think that if cutscenes work in mp it would still play for everyone and not interupt people watching the cutscene when a person joins the game. but you would have to make it so that the cog takes the person that joins to the cutscene.

the best way to tell if a cog works in mp is to put the cog in a test level and gob it then try it between two computers. thats what i usually do.
mostly any cog will work and sync all that happens with everyone playing. cogs that dont sync whats happening are inventory cogs and any cog that has the flags=0x240 above the symbols section. 0x240 cogs can use triggers to tell other cogs when and what to do and that can make the same thing happen on all computers. triggers also help reduce lag some times.

hope that helps you.


[This message has been edited by DSLS_DeathSythe (edited April 15, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-04-15, 11:02 PM #3
Yes, it does help!
The reason why I ask people these questions is because... It isn't that I don't have more than one computer. Well, I have one computer, the others are the familly's. I have one PC, my sister, who isn't keen on sharing, has another, my father has 2 but both has Win NT only (heard that NT isn't very good with games). Then there is another one for my mother, and that one is rarely connected because my father hasn't had the time to drill a hole in the wall so that the cord can get to the DSL box, and another is clear across the flat!
So that leaves me with a ton of questions.

7-PRINT-: I've edited the power up COGs so that when something is picked up, I changed the JKPrintUniString(player,number) to Print("Grenades") and Print("64-pack Mines"). Who will see it? He who picked it up, or everyone?
Edward's Cognative Hazards
2003-04-16, 2:48 PM #4
the power up cogs run localy so the print message will work fine.
if you were using it in say a door cog in a level where when the door is opened it goes Print("The door was opened") then it would only print the message on the hosts computer. print is something that only works localy. if you used a 0x240 cog and a trigger then you could use print verb. to have a cog print a message to everyone in a mp game you would have to use something like this.
Code:
jkStringClear();
jkStringConcatAsciiString("YOUR MESSAGE HERE");
jkStringOutput(-3, -1);
jkStringClear();

that would make it print the message to everyone.
but since your only using it in an inventory cog print will do fine.

------------------
Famous last words - "It seemed like a good idea at the time."

↑ Up to the top!