Jump to content


Photo

Another 39dll Lib


  • Please log in to reply
48 replies to this topic

#21 lap202

lap202

    Programmer

  • GMC Member
  • 224 posts
  • Version:GM8

Posted 17 October 2009 - 11:02 PM

Still useful, i can simply work on my games security in its own script
  • 0

#22 lap202

lap202

    Programmer

  • GMC Member
  • 224 posts
  • Version:GM8

Posted 17 October 2009 - 11:04 PM

tho i think when u redo it, u should add a way to name a variable and server side it without needing to do a whole script full of em
  • 0

#23 Chris Vergilio

Chris Vergilio

    GMC Member

  • GMC Member
  • 481 posts

Posted 19 October 2009 - 01:21 AM

This worked great for me! I use Game Maker 5.3a Reg. so its pretty cool. I'm definitely giving credit when I use it in my game! Very Satisfied! :skull:
  • 0

#24 qwertyuil390

qwertyuil390

    GMC Member

  • GMC Member
  • 232 posts
  • Version:GM8.1

Posted 20 October 2009 - 04:07 AM

Very nice! I understand it and makes it very easy for me to focus on the game itself otherwise.

In your example, the rate at which the players position takes a third of a second (Alarm is set to 10, room speed is 30, thus 10/30 is 1/3). I want to make it so that when the player moves, the position is updated to the server, but it isn't updated when the player is not moving. I tried things like "if speed !=0" and "if obj_player.x != obj_player.xprevious" but none of it works, the server person just stays in the upper left corner.

A bit of help please? :skull:
  • 0

#25 sabriath

sabriath

    12013

  • GMC Member
  • 3149 posts

Posted 20 October 2009 - 06:50 AM

Very nice! I understand it and makes it very easy for me to focus on the game itself otherwise.

In your example, the rate at which the players position takes a third of a second (Alarm is set to 10, room speed is 30, thus 10/30 is 1/3). I want to make it so that when the player moves, the position is updated to the server, but it isn't updated when the player is not moving. I tried things like "if speed !=0" and "if obj_player.x != obj_player.xprevious" but none of it works, the server person just stays in the upper left corner.

A bit of help please? :skull:

Save your variables into temporary and check them against your current:

tspeed = speed
tdirection = direction

Then after you do your movement code (step event), something like:

if (tspeed != speed) || (tdirection != direction)
/\
tspeed = speed
tdirection = direction
send 'your speed/direction update message ID'
send x
send y
send speed
send direction
\/

I do suggest using an alarm to update just the x/y location while you are moving.
  • 0

#26 qwertyuil390

qwertyuil390

    GMC Member

  • GMC Member
  • 232 posts
  • Version:GM8.1

Posted 20 October 2009 - 02:52 PM

Very nice! I understand it and makes it very easy for me to focus on the game itself otherwise.

In your example, the rate at which the players position takes a third of a second (Alarm is set to 10, room speed is 30, thus 10/30 is 1/3). I want to make it so that when the player moves, the position is updated to the server, but it isn't updated when the player is not moving. I tried things like "if speed !=0" and "if obj_player.x != obj_player.xprevious" but none of it works, the server person just stays in the upper left corner.

A bit of help please? :)

Save your variables into temporary and check them against your current:

tspeed = speed
tdirection = direction

Then after you do your movement code (step event), something like:

if (tspeed != speed) || (tdirection != direction)
/\
tspeed = speed
tdirection = direction
send 'your speed/direction update message ID'
send x
send y
send speed
send direction
\/

I do suggest using an alarm to update just the x/y location while you are moving.

Thanks for that. I'll be sure to try it out.

For the alarm, it updates even when the player is not moving, thus wasting messages sent and recieved - right? And lowering the timer even more would send it faster but use up even more messages. I just thought that you should update player if he is moving...but I may be wrong ;)

Thanks again

EDIT: Nope, I tried what you did, didn't work... any other suggestions? Maybe I did something wrong...

Edited by qwertyuil390, 20 October 2009 - 03:04 PM.

  • 0

#27 sabriath

sabriath

    12013

  • GMC Member
  • 3149 posts

Posted 20 October 2009 - 07:45 PM

Thanks for that. I'll be sure to try it out.

For the alarm, it updates even when the player is not moving, thus wasting messages sent and recieved - right? And lowering the timer even more would send it faster but use up even more messages. I just thought that you should update player if he is moving...but I may be wrong :)

Thanks again

EDIT: Nope, I tried what you did, didn't work... any other suggestions? Maybe I did something wrong...

Yes, if you are not moving, the alarm wastes messages, I only built it as an example. Although you should send SOMETHING at least once every 5-10 seconds, just to keep the connection alive. Did you change the server to accept the variables? Delete the alarm code and try this:

for server obj_player step event...

Update
Check for ID:33 (4 arg(s))
/\
Receive into x
Receive into y
Receive into speed
Receive into direction
Write 37
Write self.id
Write x
Write y
Write speed
Write direction
Send to Group Movement 0
\/
Clean up Messages


for the client obj_startup create event 'Execute a piece of code' add this...
td = -1;
ts = -1;

for the client obj_startup step event before the "Clean up Messages"....

Check for ID:37 (5 arg(s))
/\
Receive into nid
Receive into otx
Receive into oty
Receive into ots
Receive into otd
Execute a piece of code
var z;
if (nid != myid)
{
	if ds_map_exists(pids, nid)
	{
		z = ds_map_find_value(pids, nid);
			z.x = otx;
			z.y = oty;
			z.speed = ots;
			z.direction = otd;
	} else
		ds_map_add(pids, nid, instance_create(tx, ty, obj_others));
}
\/


AFTER Clean up Messages, put...

If an expression is true (ts!=obj_player.speed)||(td!=obj_player.direction)
/\
Set variable ts to obj_player.speed
Set variable td to obj_player.direction
Send 33
Send obj_player.x
Send obj_player.y
Send obj_player.speed
Send obj_player.direction
\/

Edited by sabriath, 21 October 2009 - 05:10 AM.

  • 0

#28 qwertyuil390

qwertyuil390

    GMC Member

  • GMC Member
  • 232 posts
  • Version:GM8.1

Posted 20 October 2009 - 11:19 PM

Uh, wow it still didn't work and I did EXACTLY as you said... send me a copy of a client and server that successfully completes this so I can see if it works on my computer...

Also, when I did that, like before, the player was always in the top left corner on anybody's screen...They were there, but their position didn't update...
  • 0

#29 sabriath

sabriath

    12013

  • GMC Member
  • 3149 posts

Posted 21 October 2009 - 05:09 AM

Uh, wow it still didn't work and I did EXACTLY as you said... send me a copy of a client and server that successfully completes this so I can see if it works on my computer...

Also, when I did that, like before, the player was always in the top left corner on anybody's screen...They were there, but their position didn't update...

Sorry, I forgot that I moved the object directly with x/y changes rather than with speed and direction. Update the player object in the client to move using speed and direction instead, something like:

if down key pressed
vspeed = 1
else
if up key pressed
vspeed = -1
else
vspeed = 0

if left key pressed
hspeed = -1
else
if right key pressed
hspeed = 1
else
hspeed = 0

I also see an error with my previous post, I will highlight the parts with bold text, it's near the bottom. It should work. I no longer will be helping with this project because I am trying to finish my scripts. I will come back to this at a later time to fix it for easier use.
  • 0

#30 qwertyuil390

qwertyuil390

    GMC Member

  • GMC Member
  • 232 posts
  • Version:GM8.1

Posted 21 October 2009 - 03:08 PM

Lol still hasn't worked but thanks anyways.

Umm, can anyone tell me what the difference between the "Write Message" and "Send Message" actions are? I changed some send actions to write actions and I the player went in the upper left corner, but with send messages, the player would still go to its starting position on the server but it wouldn't move when I moved the player...
  • 0

#31 sabriath

sabriath

    12013

  • GMC Member
  • 3149 posts

Posted 21 October 2009 - 07:28 PM

Lol still hasn't worked but thanks anyways.

Umm, can anyone tell me what the difference between the "Write Message" and "Send Message" actions are? I changed some send actions to write actions and I the player went in the upper left corner, but with send messages, the player would still go to its starting position on the server but it wouldn't move when I moved the player...

"Write Message" is located in the Server Player area, which means you should only put it on the server side before a "Send to Group". "Send Message" sends directly to the other connection, used primarily by the client.

I had a few errors before, not sure why you couldn't fix them, but here are the files. The code is almost the exact same (other than a couple errors like I said).

http://willhostforfo...servclient2.zip
  • 0

#32 Simple-games

Simple-games

    GMC Member

  • New Member
  • 400 posts

Posted 26 October 2009 - 08:39 PM

I get this error:


___________________________________________
ERROR in
action number 1
of Step Event
for object obj_player:

Error in code at line 12:
if float=true

at position 5: Unknown variable float
  • 0

#33 sabriath

sabriath

    12013

  • GMC Member
  • 3149 posts

Posted 27 October 2009 - 09:46 AM

I get this error:


___________________________________________
ERROR in
action number 1
of Step Event
for object obj_player:

Error in code at line 12:
if float=true

at position 5: Unknown variable float

*looks blankly at you*

That's not my code, so I'm not sure where you got that error from.
  • 0

#34 3D2DGAMES

3D2DGAMES

    GMC Member

  • GMC Member
  • 638 posts

Posted 20 November 2009 - 05:45 PM

link dead?
  • 0

#35 Crazor Razor

Crazor Razor

    Game maker software

  • New Member
  • 157 posts

Posted 20 November 2009 - 08:31 PM

link dead?

If it is a will host for food link, look at this topic Sad news
  • 0

#36 sabriath

sabriath

    12013

  • GMC Member
  • 3149 posts

Posted 23 November 2009 - 10:33 AM

[BUMP] I have updated the link, although I do not support my library at this time due to other projects, I will be back to update it with better authentication and easier use when I can.
  • 0

#37 Crazor Razor

Crazor Razor

    Game maker software

  • New Member
  • 157 posts

Posted 26 November 2009 - 07:39 AM

kool
  • 0

#38 Orbitguy

Orbitguy

    UNS Lead Guy

  • GMC Member
  • 314 posts
  • Version:GM:Studio

Posted 13 December 2009 - 02:54 AM

Just wanted to say this is a really awsome looking 39dll LIB, (and the only one designed for GM7 I think. Or that came up in the search function)

I mostly use GML but I'd like to give this a try as 39dll has been a bit complicated so far, so I'll try it out and see how it feels. =P I'm guessing it's at least better than getting laughed at when I use mplay lol.
  • 0

#39 mrcool1997

mrcool1997

    GMC Member

  • New Member
  • 104 posts

Posted 17 April 2010 - 06:44 PM

I will try that...Looks like I won't write scripts all the time.
  • 0

#40 Šelusive

Šelusive

    GMC Member

  • New Member
  • 6 posts

Posted 03 October 2010 - 06:38 PM

Is there any tutorial on how to use this LIB cuz i dont really get where and when i have to "activate" the thingies. Oso (= also) Im dutch so i didnt really get some of the lib action names so if someone could explain some better to me

Actions i need help with:
Spoiler


In short i dont get the messages thing :P

PS This is my second try at creating a GM MMORPG in the meantime ill mess around with the LIB until someone replies...
PS 2 Im using GM8 :GM8:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users