Jump to content


henki133

Member Since 24 Jan 2012
Offline Last Active Apr 19 2012 05:55 PM

Topics I've Started

yoyo runner - stuck at "connecting to..."

18 April 2012 - 06:51 PM

So, It worked before in an earlier patch. But now it just doesn't seem to wanna connect anymore!
This is what I've tried so far:
Gamemaker: 0.0.0.0/0
Android Phone: computer's iPv4 ( local ip )

Gamemaker: 0.0.0.0/0
Android Phone: Router's ip

Gamemaker: Router's ip
Android Phone: computer's iPv4 ( local ip )

Gamemaker: Router's ip /24
Android Phone: computer's iPv4 ( local ip )

Gamemaker: Router's ip /254
Android Phone: computer's iPv4 ( local ip )

Gamemaker: 192.168.1.1/254
Android Phone: computer's iPv4 ( local ip )

Gamemaker: computer's iPv4 ( local ip )
Android Phone: computer's iPv4 ( local ip )

Gamemaker: computer's iPv4 ( local ip ) /24
Android Phone: computer's iPv4 ( local ip )

Again, nothing seem to wanna work!
Android SDK is valid, Java SDK is valid and keystore is generated.

Before, it worked with the combination I listed first inside the code area...

Help please? Any suggestions?

2 variables: the bigger, the smaller. how?

14 March 2012 - 09:19 PM

As topic says: How would you manage to make one variable get smaller, the bigger another one gets? I am making a game which you draw a line by holding the mouse and dragging. I have tried to make the line color change gradually from yellow to red depending on the destination when the mouse was pressed minus the current destination of the mouse. It works fine except that it gets red the closer I get to the starting point, which it should not. Since red is 0 and yellow is 255 (if you use make_color(255,var,0) var is red to yellow) it's pretty obvious that it gets more yellow the larger one variable gets. ( The line should only be able to be dragged from left to right, so the variable increases.)

Any help? ;)

Thanks in advance!

//henki133

rotation snap

31 January 2012 - 08:23 PM

Hello!   :whistle:

I would like to know how you could snap a squared image so it's angle is always straight but it changes depending on where the player is.
I tried using floor() and defining the x and y of the object to face but I didn't feel comfortable with that since it was buggy and I suck on angles anyways so I had no Idea how to fix it.. :P
Here is a picture for a better explanation:
Posted Image

Thanks.

//henki133

What is wrong with gamemaker and variables

31 January 2012 - 02:23 PM

So, I have defined the variables in the create event:
var ds;
var tt;
var dd;
var ts;

I have put everything correctly into end step:
    tt = ((((rimage_angle - mr_angle) mod 360) + 540) mod 360) - 180;
    with(char_body) {
        other.ds = abs(tt) / 4;
    }
    if abs(tt)<ds mr_angle = image_angle else mr_angle+= sign(tt) * ds ;
    //


    dd = ((((image_angle-90 - m_angle) mod 360) + 540) mod 360) - 180;
    with(obj_room_lighting) {
        other.ts = abs(dd) / 4;
    }
        with(light_mask) {
        other.ts = abs(dd) / 4;
    }
    with(self) {
        ts = abs(dd) / 2;
    }
    if abs(dd)<ts m_angle = image_angle else m_angle+= sign(dd) * ts ;

This is the error that it gives:
___________________________________________
ERROR in
action number 1
of End Step Event
for object obj_player:

Error in code at line 4:
           other.ds = abs(tt) / 4;
                          ^
at position 25: Unknown variable tt

This happened when I put in this code in end step because I have to:
    tt = ((((rimage_angle - mr_angle) mod 360) + 540) mod 360) - 180;
    with(char_body) {
        other.ds = abs(tt) / 4;
    }
    if abs(tt)<ds mr_angle = image_angle else mr_angle+= sign(tt) * ds ;

It should NOT give any errors. Still it does.

Help with movement in TDS

30 January 2012 - 06:14 PM

[SOLVED]

Hello!
I have been working with this for a long time now and decided to get help instead.
I have tried to make the character (Which is split in 2 parts - upper and lower body.) to aim with one part of the body and walk with the other.
It would be very simple if it wasn't for the movement script that I have. It basically makes the player face the mouse which is centered in the middle of the screen.
What I want is the lower body to be able to walk and the upper body to aim WITHOUT the lower body being able to twist around the upper body so it looks like he broke his back.   :whistle:  (You get what I mean..  :biggrin: )
Exeption: When walking forwards, I would like it as it currently is with the player. Maybe I should tweak the view a bit when walking diagonally? What do you think is the best?
Here is the .exe: DOWNLOAD 13.55MB

Here is the step event in the player (The movement engine.):
//limit speed to maximum speed so it doesn't get too extreme
playerHSpeed = median(-playerSpeedMax, playerHSpeed, playerSpeedMax);
playerVSpeed = median(-playerSpeedMax, playerVSpeed, playerSpeedMax);

//value that modifies speed to make sure speed doesn't double up when two keys are pressed
var _splitSpeed;
_splitSpeed = (playerSpeedMax - abs(playerHSpeed) - abs(playerVSpeed)) / 4;

//apply movement to front and back
var _forwardSpeed;
_forwardSpeed = playerVSpeed + (sign(playerVSpeed) * _splitSpeed);
x += lengthdir_x(_forwardSpeed, image_angle);
y += lengthdir_y(_forwardSpeed, image_angle);

//apply movement to the sides
var _sideDirection, _sideSpeed;
_sideDirection =  image_angle + 90 * -sign(playerHSpeed);
_sideSpeed = abs(playerHSpeed + sign(playerHSpeed) * _splitSpeed);
x += lengthdir_x(_sideSpeed, _sideDirection);
y += lengthdir_y(_sideSpeed, _sideDirection);

//apply friction to movement
if (playerHSpeed < 0) {
  playerHSpeed = min(playerHSpeed + playerFriction, 0);
} else {
  playerHSpeed = max(playerHSpeed - playerFriction, 0);
}
if (playerVSpeed < 0) {
  playerVSpeed = min(playerVSpeed + playerFriction, 0);
} else {
  playerVSpeed = max(playerVSpeed - playerFriction, 0);
}

//get mouse difference from screen center and use that to rotate character
//image_angle = (image_angle - (display_mouse_get_x() - mouseXPrevious) / 10 * mouseSensitivity + 360) mod 360;
if (keyboard_check(ord('W')) && keyboard_check(ord('D'))){
    global.diagonal135=1;
} else { 
    image_angle = (image_angle - (display_mouse_get_x() - mouseXPrevious) / 10 * mouseSensitivity + 360) mod 360;
    global.diagonal135=0;
}
if (keyboard_check(ord('W')) && keyboard_check(ord('A'))){
    global.diagonal45=1;
} else {
    image_angle = (image_angle - (display_mouse_get_x() - mouseXPrevious) / 10 * mouseSensitivity + 360) mod 360;
    global.diagonal45=0;
}

display_mouse_set(mouseCenterX, mouseCenterY);
mouseXPrevious = display_mouse_get_x();

//align the view correctly with the character
view_xview[0] = x + lengthdir_x(viewHalfHeight-90, image_angle) - viewHalfWidth;
view_yview[0] = y + lengthdir_y(viewHalfHeight-90, image_angle) - viewHalfHeight;
view_angle[0] = -image_angle + 90;

if (keyboard_check_released(ord('W')) || keyboard_check_released(ord('A')) || keyboard_check_released(ord('S')) || keyboard_check_released(ord('D'))) {
    global.moving=0;
}

Here is the smooth turning script which is in the end event (Just wanna thank Nocturne for helping me out with this one.   :yes: ):
if global.moving=1 {
    var dd,ts;
    dd = ((((rlimage_angle - m_angle) mod 360) + 540) mod 360) - 180;
    with(char_body) {
        other.ts = abs(dd) / 4;
    }
    with(obj_room_lighting) {
        other.ts = abs(dd) / 2;
    }
    with(self) {
        ts = abs(dd) / 2;
    }
    if abs(dd)<ts m_angle = image_angle else m_angle+= sign(dd) * ts;

} else {

    var dd,ts;
    dd = ((((image_angle-90 - m_angle) mod 360) + 540) mod 360) - 180;
    with(char_body) {
        other.ts = abs(dd) / 4;
    }
    with(obj_room_lighting) {
        other.ts = abs(dd) / 2;
    }
    with(self) {
        ts = abs(dd) / 2;
    }
    if abs(dd)<ts m_angle = image_angle else m_angle+= sign(dd) * ts;
}


Just tell me if this isn't enough information and I will do what I can to explain.  :smile:

P.S. Note that when you walk diagonally, the upper body just follows along and the light also. This was just something I put in while working on what I really want.

Thanks!
//henki133