Jump to content


Rachel

Member Since 22 Dec 2007
Offline Last Active Nov 27 2012 03:38 AM

Topics I've Started

Unknown Variables

05 November 2012 - 12:53 PM

I've been working on a little animal crossing game. It works fine the day of, or the day after but a couple of days later it'll say a variable doesn't exist. Take for example the coconut tree.

When I load the save file, it claims that "generated" is not a known variable. It was declared in the create event. The room it is in is persistent. It'll also say "day" is not a known variable.

Information about object: obj_coconut_tree

Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
execute code:

depth = -y
image_speed = 0
image_index = 0
visible = false
tree_life = 1 //tree is alive

//Checks if plant is on the island
generated = 0 //hasn't been generated

 Step Event:
execute code:

depth = -y

//Reveals plant after placement is finished

if (generated = 1) {
sprite_index = spr_coconut_sapling
visible = true
}

//Checks if plant is on the island and if place is free

if (generated = 0) {
    if not (place_free(x,y)) {
        x = random(236)
        y = random(150)
        move_snap(16,16)
        }
    if ((place_meeting(x,y,obj_tulip)) or (place_meeting(x,y,obj_rose)) or (place_meeting(x,y,obj_pansy)) or (place_meeting(x,y,obj_cosmos)) or (place_meeting(x,y,obj_coconut_tree))) {
        x = random(236)
        y = random(150)
        move_snap(16,16)
        }
    if not (collision_point(x,y,obj_island,true,true)) {
        x = random(236)
        y = random(150)
        move_snap(16,16)
    }
    if (collision_point(x,y,obj_island,true,true) and (place_free(x,y))) {
        move_snap(16,16)
    if not ((place_meeting(x,y,obj_tulip)) and (place_meeting(x,y,obj_rose)) and (place_meeting(x,y,obj_pansy)) and (place_meeting(x,y,obj_cosmos)) and (place_meeting(x,y,obj_coconut_tree))) {
        generated = 1
        }
        else {
        x = random(236)
        y = random(150)
        move_snap(16,16)
        }
    }
}

execute code:

//Tree growth

if (ctrl_time.last_day<ctrl_time.day) { //if over a day has passed
    if tree_life = 1 { //if tree is alive
        sprite_index = spr_coconut_tree //sapling becomes tree
        if (image_index<3) { //if tree isn't full grown
            image_index += (ctrl_time.day-ctrl_time.last_day) //numbers of days passed equals growth
            if (image_index > 3) { //if numbers of days is over full grown
            image_index = 3 //tree remains full grown
            }
        }
    }
}


This is the time script.

Information about object: ctrl_time

Sprite: spr_control
Solid: false
Visible: false
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
execute code:

second = current_second
minute = current_minute
hour = current_hour
day = current_day
year = current_year
weekday = current_weekday
month = current_month

last_day = current_day
last_hour = current_hour
last_month = current_month

 Step Event:
execute code:

second= current_second
minute= current_minute
hour= current_hour
day= current_day
year= current_year
weekday= current_weekday
month= current_month

Other Event: Game End:
execute code:

last_day = current_day
last_month = current_month

Instance under object

15 October 2012 - 12:37 PM

I'm recreating the tiny chao garden rock paper scissors mini game. I don't know how to check for the variables of the particular instance, such as the computer's hand and the player's hand when they collide. How do I make sure that the script is checking for exactly that instance's variable, rather than just all of the objects aligning under one variable? Currently, the script only checks for a default variable of the first instance interacted with and assigns that to all of the instances.

This is part of my script:

if (keyboard_check(ord("X"))) {
if (place_meeting(x,y,obj_selector)) {
speed = 5
direction = 90
}
}

//If instance is gu

if (image_index = 0) {
if ((place_meeting(x,y,obj_computer_triangle)) and (obj_computer_triangle.image_index = 1)) {
        obj_jkp_rings.rings += 5
        instance_destroy()
    }
if ((place_meeting(x,y,obj_computer_triangle)) and (obj_computer_triangle.image_index = 2)) {
    obj_triangles.loses += 1
    instance_destroy()
  }
}

//If instance is choki

if (image_index = 1) {
if ((place_meeting(x,y,obj_computer_triangle)) and (obj_computer_triangle.image_index = 2)) {
        obj_jkp_rings.rings += 5    
        instance_destroy()
    }
if ((place_meeting(x,y,obj_computer_triangle)) and (obj_computer_triangle.image_index = 0)) {
    obj_triangles.loses += 1
    instance_destroy()
  }
}

//If instance is pa

if (image_index = 2) {
if ((place_meeting(x,y,obj_computer_triangle)) and (obj_computer_triangle.image_index = 0)) {
        obj_jkp_rings.rings += 5
        instance_destroy()
    }
if ((place_meeting(x,y,obj_computer_triangle)) and (obj_computer_triangle.image_index = 1)) {
    obj_triangles.loses += 1
    instance_destroy()
  }
}

Compiling a game

22 September 2012 - 03:23 PM

Note: Moderators please move if in the wrong section. I didn't know where to post this request.

I've been working on this game slowly for years, and then my laptop died and I lost my version of Game Maker 7.0 Pro. I've been trying to reactive it on my new laptop, but it hasn't worked. Even though the program says activation successful, the program still opens up in Lite. So I won't be able to work on my game unless Softwrap Support can do something about it.

I've temporarily shared the download to the open source file on google docs here: (link no longer available)

If someone could compile it into a exe so that I could just store it as a memory of the work I've done (even though it's no where near finished), I'd really appreciate it.

NPC Collision Problems

21 February 2012 - 01:20 AM

I've played around with a few collision codes and haven't found the one right for my games. In my current game, the free walking horse walks backwards when colliding with a wall, and gets stuck in corners.

The collision code is a simple drag and drop one. "//Collision Event if dir = 90, reverse vertical direction," and so on.

This is the moving code:

//Alarm 0

move_snap(1,1)
speed = 0;
image_index=0;
image_speed=0;
alarm[1] = choose(45,50)

//Alarm 1

speed = 0
alarm[0] = choose(45,50)
move_snap(1,1);
move=choose(1,2,3,4)
if move=1
{
if (color = 0) {
sprite_index=spr_horse_w_down
}
if (color = 1) {
sprite_index=spr_cream_horse_w_down
}
direction=270
speed=.5
image_speed=imgspd
move=0}

if move=2
{
if (color = 0) {
sprite_index=spr_horse_w_up
}
if (color = 1) {
sprite_index=spr_cream_horse_w_up
}
direction=90
speed=.5
image_speed=imgspd
move=0}

if move=3
{
if (color = 0) {
sprite_index=spr_horse_w_right
}
if (color = 1) {
sprite_index=spr_cream_horse_w_right
}
direction=0
speed=.5
image_speed=imgspd
move=0}

if move=4
{
if (color = 0) {
sprite_index=spr_horse_w_left
}
if (color = 1) {
sprite_index=spr_cream_horse_w_left
}
direction=180
speed=.5
image_speed=imgspd
move=0}

Ranch Story: Hiragana Racers

20 February 2012 - 07:07 AM

When my last laptop died, I lost my activated copy of Game Maker 7.0 Pro. Unfortuently, I haven't been able to activate it on my current laptop. Unless Softwrap Support can do something about it, I have a feeling this will be the last demo of this game.


Posted Image

Ranch Story: Hiragana Racing

Demo v2.2
Download: https://docs.google....TTXlIdmVKRHFKZw

Buttons and Credits
Press F1 to see buttons guide and credits
Drag and drop hay over to horse to feed

Features
Choose Gender NEW
Boy or Girl
Racing mini-game
Three courses
High score viewable in stable
Thomas as MC NEW
Announces player’s place
Audience NEW
Music emoticon when player gets hiragana correct
Exclamation mark when player gets hiragana wrong
Opponents NEW
Including Claire as a rival
Extra points towards high score for winning the race
Mason NEW
It's not an HM game without a love story!
Horse maintenance
Brushing horse
Feeding horse
Filling trough with water
Entertaining horse with music
Increases chance of starting with a higher speed
Leveling Up
Experience Points
Starting off with a base speed
Increases speed capacity
Choose Horse NEW
Color
Personality
Name
Horse Color
Chestnut
Cream
Horse Personality NEW
Sassy
Energetic
Speedy
Hardy
Saving and Loading
Save through the diary located in the stable
Load at the menu screen or through the diary

Soon to Come
More Horse Colors
Perlino
Black
Audience
More villagers in the audience
Random Visits
Such as May coming to see your horse
Mason
Heart events
Mystery Bachelorette
Heart events
Facesets
Villager's faceset shows when talking
Outfit Rewards
New outfits rewarded for winning races
Hiragana Chart
Hiragana chart in the stable
Second Horse (possibly)
After winning all three races, Barley brings a foal for you to raise. When raised to an adult, the foal can raise in katakana races. (then the game would be renamed Kana Racing)
Barn Cat (possibly)
Another option is to award a barn cat after winning all three races

Bugs
Horse sometimes gets stuck (Temporary fix: Horse's position restarts when entering stable)
Player's collision when walking along an edge is not smooth
Letters in text are not aligned
りゅ (ryu) combination does not register
When playing as a boy, player cannot reach the diary and if attempts to do so will get stuck

Screenshots

Posted Image

Posted Image

Screenshot Four

Screenshot Five

Posted Image