Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411507 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 26, 2024, 03:50:56 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)[ERROR] Push :: Execution Error - Variable Get
Pages: [1]
Print
Author Topic: [ERROR] Push :: Execution Error - Variable Get  (Read 1220 times)
Aslinng
TIGBaby
*



View Profile
« on: March 22, 2015, 08:38:25 AM »

Hello,

I'm using Game Maker Studio and it has been many days that I'm trying to resolve that bug.
I can't figure out why it's happening.
I already tried to clean the "cache" but no luck.

Code:
############################################################################################
FATAL ERROR in
action number 1
of  Step Event0
for object object91:


Push :: Execution Error - Variable Get -1.mvyMax(100171, -2147483648)
 at gml_Object_object91_StepNormalEvent_1 (line 16) -     mvy = Approach(mvy, mvyMax, gravNorm);
############################################################################################

I understand that the program is telling me that the variable "mvyMax" doesn't exist in my "object91" but that's strange because I wrote it my "create"  event.

Code:
///Basic Variables
jumped = false;
landed = false;

platformTarget = 0;
wallTarget     = 0;

push = false;

wallslide = false;

// Velocity
mvx = 0;
mvy = 0;

// Used for sub-pixel movement
cx = 0;
cy = 0;

onGround = OnGround();
cLeft    = place_meeting(x - 1, y, obj_wall);
cRight   = place_meeting(x + 1, y, obj_wall);

// Movement //////////
groundAccel = 0.50;   //1.00;   //1.00
groundFric  = 0.50;   //2.00;   //2.00
airAccel    = 0.30;   //0.60;   //0.75
airFric     = 0.01;   //0.01
mvxMax       = 1.00;   //4.00;   //5.5    
mvxMaxCap    = 1.00;                                                  
mvyMax       = 5.00;   //12.0;   //10
mvyMaxCap    = 5.00;
mjumpHeight  = 3.00;   //10.0;   //8
mjumpHeightCap=3.00;
gravNorm    = 0.25;   //1.00;   //0.5
mdir = 1;              //Direction
preventfalling = true;

left = 0;
right = 0;

image_speed = (5+irandom(3))/100; //=Between 0.05 & 0.08

//Start walking towards Player
alarm[10] = 1

Here's the code that is getting the error.

Code:
///Movement
var tempAccel, tempFric;
// Apply the correct form of acceleration and friction
if (onGround) {  
    tempAccel = groundAccel;
    tempFric  = groundFric;
}
else {
    tempAccel = airAccel;
    tempFric  = airFric;
}

// Handle gravity
    mvy = Approach(mvy, mvyMax, gravNorm);

//Change direction when encountering a wall
if (place_meeting(x+mvx,y,obj_wall)) && (right == 1)
{
left = 1;
right = 0;
}
if (place_meeting(x-mvx,y,obj_wall)) && (left == 1)
{
left = 0;
right = 1;
}

// Left
if (left != 0)
{
    // Apply acceleration left
    if (mvx > 0)
        mvx = Approach(mvx, 0, tempFric);  
    mvx = Approach(mvx, -mvxMax, tempAccel);
// Right
}
else if (right)
{
    // Apply acceleration right
    if (mvx < 0)
        mvx = Approach(mvx, 0, tempFric);  
    mvx = Approach(mvx, mvxMax, tempAccel);
}

// Friction
if ((left=0) && (right=0)) {
    mvx = Approach(mvx, 0, tempFric);
}

Here's the script "Approach".

Code:
/// Approach(start, end, shift);


if (argument0 < argument1)
    return min(argument0 + argument2, argument1);
else
    return max(argument0 - argument2, argument1);
« Last Edit: March 22, 2015, 08:59:47 AM by Aslinng » Logged
FREAKNARF
Level 0
**


View Profile WWW
« Reply #1 on: March 26, 2015, 08:47:23 AM »

Hello,

Erhh i'm not sure but you can try to avoid this  in create event :
onGround = OnGround();
what's in this script ?
cheers!
Logged

K
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic