• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Weird Issue

Status
Not open for further replies.
M

MasterGrey

Guest
Ok so here is my code

Code:
var sh=(room_height/2)-floor(random(room_height/3));
sh=(sh/100)*100;
var ah=sh;
var dirt_level;
var dirt_level2;
var stone_level;
var bedrock_level;
var l;
for(xx=0;xx<room_width;xx+=100)
{
    z = floor(random(17));
    if(z == 0)
    
    instance_create(xx,ah,object_grass_planet_grass);
    
    dirt_level=((room_height-ah)/100)*100;
    dirt_level2=(room_height)/100*100;
    stone_level=(room_height)/100*100;
    
    ah+=choose(100,-100,0);
    
    for(yy=ah;yy<dirt_level;yy+=100)
    {
      
        instance_create(xx,yy+100,object_grass_planet_dirt)
        1=yy;
        
        for(yy=1;yy<dirt_level2;yy+=100)
        {
           instance_create(xx,yy+100,object_grass_planet_dirt2)
          
          
        for(yy=2;yy<stone_level;yy+=100)
        {
            if(yy>=ah)
            instance_create(xx,yy+100,object_grass_planet_stone)
            else instance_create(xx,yy+100,object_water);
        }
    }
}
}

its giveing me errors saying that i cannot set a constant to a vaule and all i did was do 1=yy;???????

Plus im trying to add another layer you could assist or not but still this is quite strange when i use gamemaker
All the code worked before now im getting issues any help im all ears.

I think i should have used unity and made a 3d version because this game maker is too buggy.

My galaxy by the way

29qGMLZ13131.png
 

Perseus

Not Medusa
Forum Staff
Moderator
I think i should have used unity and made a 3d version because this game maker is too buggy.
What I think is that you should have understood how basic assigments work in programming languages before trying to carry out such complex actions.

http://docs.yoyogames.com/source/da...gml language overview/401_03_assignments.html

The variable needs to be LHS and the value needs to be RHS. What you're currently doing is that you're trying to change the value of 1 to yy -- which is impossible as 1 is a constant number and can't change its value, so GM throws an error message. You need to set yy to 1 (as explained in the Manual entry linked to).

Code:
yy = 1;
<variable> = <value>;
 
M

MasterGrey

Guest
What I think is that you should have understood how basic assigments work in programming languages before trying to carry out such complex actions.

http://docs.yoyogames.com/source/dadiospice/002_reference/001_gml language overview/401_03_assignments.html

The variable needs to be LHS and the value needs to be RHS. What you're currently doing is that you're trying to change the value of 1 to yy -- which is impossible as 1 is a constant number and can't change its value, so GM throws an error message. You need to set yy to 1 (as explained in the Manual entry linked to).

Code:
yy = 1;
<variable> = <value>;
Quick reply eh..... Well this isnt so to say my code i made my own code but im having issues with it.

But yeah this isnt my code.

Hehehe i dont know why the guy did it like that but still thanks for the help i just did the code his way because im way too busy with some other scripts to work on something else.



Plus this is my code boi

Code:
galaxy_radius = 15000; 
num_arms = 5;
num_stars = 15000;

spiral_tightness = -0.28; //higher number = more tight, negative reverses direction of spiral

//the nearest any 2 stars can be to each other
//danger of infinite loop if this number is too high
min_star_seperation = 17; 

//the maximum distance a star can be from its spiral arm
max_star_displacement = 43; 

//how much stars bunch toward center of galaxy
//lower numbers bunch toward edge, higher toward middle, 0.5 = no bunching
bunching = 2; 

//how much stars bunch toward the spiral arm they are in
//lower numbers bunch toward edge, higher toward middle, 0.5 = no bunching
bunching_2 = 2.8; 

//no need to touch these
arm_radial_spacing = 360 / num_arms;
random_interval = power(galaxy_radius,1/bunching);
random_interval_2 = power(max_star_displacement,1/bunching_2);

randomize();
var star_placed, arm, dist, dist2, angle, xx, yy, nearest_star;
repeat (num_stars)
{
    star_placed = false
    do
    {
        arm = irandom(num_arms-1);
        dist = power(random(random_interval),bunching);
        angle = (dist + dist) * spiral_tightness + arm * arm_radial_spacing;
        
        xx = random_range(-1,1);
        yy = random_range(-1,1);
        dist2 = power(random(random_interval_2),bunching_2) / point_distance(0,0,xx,yy);
    
        xx = x + lengthdir_x(dist,angle) + xx * dist2;
        yy = y + lengthdir_y(dist,angle) + yy * dist2;
        nearest_star = instance_nearest(xx,yy,object_star_universe_new);
        if (instance_number(object_star_universe_new) == 0) or (point_distance(xx,yy,nearest_star.x,nearest_star.y) > min_star_seperation)
        {
            instance_create(xx,yy,object_star_universe_new);
            star_placed = true;
        }
    }
    until (star_placed)
}
Im not called The master for nothing no offense
 
M

MasterGrey

Guest
Yet again i have another weird issue wow is gamemaker on a roll ....


My views are f,ed up and i dont know why as it was working earlier

Because it seems you know more than me or so you think tell me what i did wrong heres the code

view_xview[0] = x - (view_wview[0]/2);
view_yview[0] = y - (view_hview[0]/2);

Again it worked like bliss now its f,ed up............................................................................


Nevermind game maker is a buggy mess just like this says
http://purplepwny.com/blog/gamemaker_is_an_abomination.html
So im not going to waste my time with it now or this fourm

Every time i start the engine it says something is missing i wasted 2 LONG YEARS ON THIS.
 
Last edited by a moderator:
Status
Not open for further replies.
Top