Jump to content


spookeyes

Member Since 03 Mar 2007
Offline Last Active Jan 31 2010 04:51 PM

Topics I've Started

Get Icon In Right Corner !solved!

18 June 2008 - 04:49 PM

Hello,

I just wonder if it is possible to get a icon in the right corner if you close a program/game in game maker.

This is what i mean:
Posted Image

If it is possible, how do i do it? Do i need a dll?

Tell me if i need to explain better.

Text Files Solved

07 June 2008 - 11:16 AM

Hi.

I am trying to make a new line when writing in a text file.

This is the code i use:

text=file_text_open_append('text.txt')
file_text_write_string(text,hello # my name is spookeyes # bla bla bla.)
file_text_close(text)

The problem is that it will get on the same line like this:

hello # my name is spookeyes # bla bla bla.

This is what i wanted it to be:

hello
my name is spookeyes
bla bla bla.

Is it possible to do it in a text file?

39dll: Arrow Sending

01 June 2008 - 08:41 PM

Hello,

I am currently making an online game. I'ts a platform view rpg game that uses 39dll. I have both a client file and a server file.

Right now, I'm trying to add weapons. I am trying to make a bow that can shoot arrows, just like guns that shoot bullets. The problem is that you can't see other players arrows.

This is the coding i am using:

In client:

global left pressed event of obj_player_self:
if can_shoot=true{instance_create(x,y,obj_arrow)can_shoot=falsealarm[2]=30}

Create event of obj_arrow:
spd=7dir=point_direction(x,y,mouse_x,mouse_y)clearbuffer();writebyte(5);writebyte(global.myid);writeshort(x);writeshort(y);writeshort(dir);writeshort(spd);sendmessage(global.clienttcp);motion_set(dir,spd)

In server:

Step event of obj_client :
    case 5:    var player, value, arrowx, arrowy, arrowdir, arrowspd;        value=readbyte()    player=global.players[value]        arrowx=readshort    arrowy=readshort    arrowdir=readshort    arrowspd=readshort            clearbuffer()    writebyte(10)    writebyte(value);    writeshort(arrowx)    writeshort(arrowy)    writeshort(arrowdir)    writeshort(arrowspd)        with(obj_client)    {    if (id!=player)    {    sendmessage(tcp);    }    }    break;

In client:

Step event of obj_client :
    case 10:    var player, value, arrowdir, arrowspd;                value = readbyte();    player = players[value];         arrowx=readshort    arrowy=readshort    arrowdir=readshort    arrowspd=readshort    arrowid=instance_create(arrowx,arrowy,obj_arrow_other)    arrowid.idd=player    arrowid.direction=arrowdir    arrowid.spd=arrowspd        break;

It still dosn't work!

I've tried to find out where the problem is.
In the step event of obj_client in the server i have used the following code to find out wheter the server got the correct value:

    arrowx=readshort    arrowy=readshort    arrowdir=readshort    arrowspd=readshort        script_addline('x:' +string(arrowx),c_black);    script_addline('y:' +string(arrowy),c_black);    script_addline('dir:' +string(arrowdir),c_black);    script_addline('spd:' +string(arrowspd),c_black);

And the result was:

x:491
y:491
dir:491
spd:491

Why in the **** is the number 491 the only number the server got. I tried again but i got the same result.

I tried to do something similar in the the step event of obj_client in the client when it receives the numbers from the server, but the result was weird again:
x:1617
y:1617
dir:1617
spd:1617

I have no idea why this is happening so i need your help.

Please tell me if you need the file or any more information.

Thanks in advance.

~~ Spookeyes

Real-valued Functions

17 May 2008 - 08:42 AM

Good morning GMC.

I am still learning GML and now i am trying to understand some Real-valued fuctions (like abs, sin, cos, max, sqr...)

I have already learned some by myself, but there is still some i don't understand.

To learn functions i do this:

Create event:
[codebox]value= 3

value = sqr(value)

[/codebox]

Draw event:
[codebox]draw_text(x,y,value)[/codebox]

Now i found out that sqr multiplies the value with itself.

But as i said, there are some fuctions i still don't understand.

Can you please explain what these fuctions are and how they are used:

1. Sin: when i put value as 1 in create event it returned 0.84.
2= 0.81.
7.42=0.91
I have no idea why these values returned.

2. Cos: 1=0.54.
2= -0.42.
7.42= 0.42

3. Sign

4. Tan

Ip Adress Question

24 April 2008 - 03:02 PM

I am currently making a online game. I have a server and people will connect through my external IP.
The problem is that my external IP changes very often. When my ip changes, they can't connect and i have to send a new exe- file with my new ip.

How can i get my ip to not change?