Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, TipmyPip, VoroneTZ, Quad, 1 invisible), 688 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
A simple multi-player code please #181522
02/02/08 06:18
02/02/08 06:18
Joined: Sep 2007
Posts: 158
Guangzhou China
bomber Offline OP
Member
bomber  Offline OP
Member

Joined: Sep 2007
Posts: 158
Guangzhou China
I've read locoweed's tutorial, but that was making an entire multiplayer game I just need a small code that I can add to my script so it becomes multiplayer.


"I don't know what the facts are but somebody's certainly going to sit down with him and find out what he knows that they may not know, and make sure he knows what they know that he may not know."
————Donald Rumfeld
Re: A simple multi-player code please [Re: bomber] #181523
02/02/08 14:31
02/02/08 14:31
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
check aums!

Re: A simple multi-player code please [Re: bomber] #181524
02/02/08 22:27
02/02/08 22:27
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Quote:

that I can add to my script so it becomes multiplayer.




Doesn't work that way. There is no code that when you plug into your existing single player (SP) code makes it multiplayer (MP).

You either code it MP from day one or don't do MP at all.

Re: A simple multi-player code please [Re: bomber] #181525
02/07/08 10:51
02/07/08 10:51
Joined: Oct 2004
Posts: 290
Latvia
Leonardo Offline
Member
Leonardo  Offline
Member

Joined: Oct 2004
Posts: 290
Latvia
Check Locoweed's site, I believe he has a simple bare-bone MP script there.
And fastlane is right, you don't plug MP scripts in an SP game to make it multiplayer. You do it the other way around - you plug SP scripts into a MP game.


"Things of the mind left untested by the senses are useless."
Re: A simple multi-player code please [Re: Leonardo] #181526
02/08/08 06:51
02/08/08 06:51
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline
Serious User
PrenceOfDarkness  Offline
Serious User

Joined: Aug 2004
Posts: 1,305
New York
LMAO, i'm sorry but this is so funny! I wish I would have thought of that:
Quote:

I just need a small code that I can add to my script so it becomes multiplayer




I've spent the last year and a half trying to get the higher concepts of multiplayer on A6/A7, I've probably spent 2.5 years all together on multiplayer and still don't get some stuff. So, if someone gives you a small peace of code that instantly makes your game multiplayer I will kill myself

I don't know your understanding of multiplayer, but like everyone else has suggested locoweed's tutorial is the best way to get started. Just don't stop there, you must mess with the stuff yourself or else you will never fully grasp it. Good Luck, and maybe you can write all of us that small peace of code that will transform our game into multiplayer.


"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: A simple multi-player code please [Re: PrenceOfDarkness] #181527
02/21/08 22:34
02/21/08 22:34
Joined: Jul 2007
Posts: 53
Germany
Henning Offline
Junior Member
Henning  Offline
Junior Member

Joined: Jul 2007
Posts: 53
Germany
Hi bomber,

it's right, you have to write the game for multiplayer, here is just a small example that runs under A7.07 using Lite-C.
Maybe it helps to see concepts.

// Simple Multiplayer
// 3D Gamestudio A7 Version 7.07 commercial

#include <acknex.h>
#include <default.c>

ENTITY* clPlayer;
ENTITY* svPlayer;

var isMove = 0;
var isInput = 0;
var showX = 0;
var showY = 0;

function moveMe () { // movement for both on server
while (1) {
my.x += my.skill1 * time_step;
my.y += my.skill2 * time_step;
ent_sendnow (me);

isMove++; // moveMe() running?
if (isMove > 999) isMove = 0;
wait (1);
}
}

function getInput () { // wsad control on client and server separately
if (connection == 2) me = clPlayer;
if (connection == 3) me = svPlayer;

while (1) {
if (key_w == 1) my.skill1 = 5;
if (key_s == 1) my.skill1 = -5;
if (key_a == 1) my.skill2 = 5;
if (key_d == 1) my.skill2 = -5;
if (!key_any) {
my.skill1 = 0;
my.skill2 = 0;
}

if (connection == 2) send_skill (my.skill1, SEND_VEC|SEND_UNRELIABLE);

showX = my.skill1; // show input
showY = my.skill2; // show input
isInput++; // getInput() running?
if (isInput > 999) isInput = 0;
wait (1);
}
}

////////////////////////////// main ///////////////////////////////////////
function main () {
level_load ("M.wmb"); // just a platform and a cylinder at +X for orientation
wait (-0.5);
vec_set(camera.x,vector(-200, 0 , 20));

while (connection == 0) wait (1);

if (connection == 2) { // client
clPlayer = ent_create ("BlueBox.mdl", vector (70, 30, 0), moveMe);
}

if (connection == 3) { // client / server
svPlayer = ent_create ("RedSphere.mdl", vector (70, -30, 0), moveMe);
}
wait (-0.5);

getInput();
}

PANEL* diag_pan = {
flags = VISIBLE;
digits (4,10,"Diagnostics",*,1,NULL);
digits (4,20,"connection =",*,1,NULL);
digits (80,20,3.0,*,1,connection);
digits (4,50,session_name,*,1,NULL);
digits (4,60,player_name,*,1,NULL);
digits (4,70,"Input :",*,1,NULL);
digits (80,70,3.0,*,1,isInput);
digits (4,80,"Move :",*,1,NULL);
digits (80,80,3.0,*,1,isMove);
digits (4,90,"Inp X :",*,1,NULL);
digits (80,90,3.0,*,1,showX);
digits (4,100,"Inp Y :",*,1,NULL);
digits (80,100,3.0,*,1,showY);
}

Re: A simple multi-player code please [Re: Leonardo] #181528
02/24/08 12:58
02/24/08 12:58
Joined: Sep 2007
Posts: 158
Guangzhou China
bomber Offline OP
Member
bomber  Offline OP
Member

Joined: Sep 2007
Posts: 158
Guangzhou China
Quote:

Check Locoweed's site, I believe he has a simple bare-bone MP script there.
And fastlane is right, you don't plug MP scripts in an SP game to make it multiplayer. You do it the other way around - you plug SP scripts into a MP game.



where's locoweed's site?


"I don't know what the facts are but somebody's certainly going to sit down with him and find out what he knows that they may not know, and make sure he knows what they know that he may not know."
————Donald Rumfeld
Re: A simple multi-player code please [Re: bomber] #181529
02/28/08 20:55
02/28/08 20:55
Joined: Jul 2007
Posts: 53
Germany
Henning Offline
Junior Member
Henning  Offline
Junior Member

Joined: Jul 2007
Posts: 53
Germany

Re: A simple multi-player code please [Re: Henning] #181530
03/25/08 14:18
03/25/08 14:18
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline
Senior Member
xbox  Offline
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
Hey i found a simple code to add that makes it become multiplayer. I tried it and it does work. I used the techdemo level and there are some minor glitches but other that that it works. Although it is a tutorial, all you have to do is copy the red text to your main script and do what it says. IT IS SO EASY, A CAVEMAN COULD DO IT. lol. This is what i use for my multiplayer games.
click here


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1