Help - Search - Members - Calendar
Full Version: Osg Player
Game Maker Community > Games > Game Maker Creations > Tools & Applications
Paddymay
OSG Player
Easily play OSGs!

Instructions
Copy the OSG source/text.
Open up the program.
It'll run the OSG you copied!

What are OSGs?
One Script Games. If you don't know what these are, you cant use this.

List of Existing OSGs
Pong OSG (By Unkown)
Snake OSG (By Hockeyflyers)
Example OSG (By me)
Conversation (By MegaManFan1)
Open Website (By MegaManFan1)
Rock Paper Scissors (By Hammered_productions)
(Comment and add yours to this list!)

Green Name = Playable game, not just all messages and inputs
Red Name = Unnamed or not working
Normal Name = Just all messages and inputs
Blue Name = Promoted OSG!

Example OSG
CODE
show_message("Welcome to the example OSG.")
show_message("OSGs are games that be executed with one script!")
show_message("The OSG Player by Paddymay allows:")
show_message("Easily executing code from the previously copied text")
show_message("Any Pro user functions")
show_message("And the only game that supports OSGs")
show_message("Click OK to exit.")
game_end()


Download the OSG Player here!
MegaManFan1
Where do get an OSG?
EDIT: Oh NVM.
EDIT2: I'm working on an OSG of my own. I'll post it when it's done.
EDIT3: It's done!!!
CODE
//Conversation
if (show_question("Would you like to play a game"))
     {
     name = get_string("What is your name?","")
     show_message(name + "?")
     show_message("What a nice name.")
     show_message("Let's play!")
     show_message("...")
     show_message("I can't think of a game.")
     if (show_question("Do you know of a good game?"))
          {
          show_message("Oh you do?")
          show_message("That's great!")
          show_message("...")
          show_message("Well?")
          show_message("What is it?")
          if (show_question("Can't you say anything other than ok?"))
               {
               show_message("Good.")
               show_message("...")
               show_message("I can't think of anything else.")
               if (show_question("How 'bout you?"))
                    {
                    show_message("Awesome!")
                    show_message("Ahh forget it!")
                    game_end()
                    }
               else
                    {
                    show_message("Okay! Bye then!")
                    game_end()
                    }
               }
          else
               {
               show_message("HA!!!!!!")
               show_message("...")
               show_message("Well...")
               show_message("Bye")
               game_end()
               }
          }
     else
          {
          show_message("Ahh to heck with you.")
          game_end()
          }
     }
else
     {
     show_message("Okay! Bye then!")
     game_end()
     }
Paddymay
Can you name that OSG?
chaz13
I would post my OSG, but the code would have to be placed into three different posts...
Shadow Link
So basically this is

Room Creation Code:
CODE
if(clipboard_has_text())
{
    execute_string(clipboard_get_text())
}

else
{
    show_message("Error: Nothing on clipboard!")
}


It's nice, and simple. But there's 2 things:

1) Could've been done better. Perhaps you could store OSGs on text files in the game's directory, then have the game pull up a menu of which one you would like to play.
2) This program gives people who use Lite access to Pro functions. It's not exactly a legal thing to do, as it's similar to making a Game Maker with Game Maker. Though not as severe as replicating GM, it would've been wise to contact a Moderator before posting this.
Paddymay
You cant make sprites, objects, and all that beautiful stuff with OSGs.
Paddymay
Also...

1) There are some OSGs out there that require Pro.
2) Its hard to make a simple playable game with OSGs.
Shadow Link
Yes, there are rules to OSGs, but the tool can still run stuff like sprite_add, object_add, instantce_create and the like.
Paddymay
Actually, those functions are against the OSG rules. People flamed me for using one of those.
Paddymay
And besides, even making a sprite is 100% hard with a FUNCTION.
Shadow Link
QUOTE (Paddymay @ Jul 23 2009, 06:23 PM) *
Actually, those functions are against the OSG rules. People flamed me for using one of those.


That's what I mean. You don't have to make just OSGs with this. Regardless, you'd have to give out your code/resources for it to work as a normal game (unless you make a full Game Maker OSG tool with this, and use that tool to substitute GM). I still think you should've checked with a Moderator as it now lets anyone make Pro OSGs without having to buy GM.

EDIT: I don't intend to come off as mean or anything. This is a great tool, albeit simple. I just think that one made in Lite would've been safer.
Paddymay
Ok, the conversation ends on this post.
The only way you can experience the full version of GM and know it's functions is having it. For example, opening websites, changing cursors, you need the variable/function finder in GM to know all those functions and their args.
MegaManFan1
Okay, so I got bored and played around with this some more. The result, was this.
CODE
//Open Website

var_site = get_string("Enter the full website URL.","")
execute_shell(var_site,0)
game_end()

It's not much, but it does something. This isn't any great masterpiece. I know that it isn't. I don't expect you to think that it is. This is just something for PaddyMay to add to his list.
Later.
MMF1

EDIT: I'm working on an upgrade for this tool that allows loading external OSGs. I'll PM it to you when I get it done.
Paddymay
Congrats MegaManFan1, that OSG is great! It's been promoted/linked.
MegaManFan1
What does that mean?
Really? It's so simple.
Hammered_productions
CODE
//Rock Paper Scissors, by Hammered_Productions

youscore=0; hescore=0;
draw_background(background_create_gradient(room_width,room_height,c_red,c_black,1,1),0,0)
rnds=get_integer("Welcome to rock paper scissors, how many rounds would you like to play?","3")
for (i=1; i<rnds+1; i+=1)
{
    cpu=floor(random(3))+1
    you=show_message_ext("Choose an action","rock","paper","scissors")
    if cpu=1 and you=2 {youscore+=1 show_message("cpu - rock#vs#you - paper#YOU WIN")}
    else if cpu=1 and you=3 {hescore+=1 show_message("cpu - rock#vs#you - scissors#YOU LOSE")}
    else if cpu=2 and you=1 {hescore+=1 show_message("cpu - paper#vs#you - rock#YOU LOSE")}
    else if cpu=2 and you=3 {youscore+=1 show_message("cpu - paper#vs#you - scissors#YOU WIN")}
    else if cpu=3 and you=1 {youscore+=1 show_message("cpu - scissors#vs#you - rock#YOU WIN")}
    else if cpu=3 and you=2 {hescore+=1 show_message("cpu - scissors#vs#you - paper#YOU LOSE")}
    else
        {
            if cpu=1 show_message("You both chose rock")
            if cpu=2 show_message("You both chose paper")
            if cpu=3 show_message("You both chose scissors")
        }
    show_message("Round "+string(i)+"/"+string(rnds)+" completed.#You have "+string(youscore)+" points#CPU has "+string(hescore)+" points.")
}
if hescore>youscore show_message("CPU Won.")
else if youscore>hescore show_message("You Won.")
else show_message("Draw!")
game_end()
MegaManFan1
@Paddymay
Do I have your permission to publicly release my file loader here?

@Everyone else
I have created a version of this software that will load a text file containing an OSG. It works better in my opinion. Mine isn't quite so simple.
Paddymay
There's an error in that code...
MegaManFan1
Mine? Or the Hammered's OSG?
Paddymay
QUOTE (MegaManFan1 @ Jul 26 2009, 06:14 PM) *
@Paddymay
Do I have your permission to publicly release my file loader here?

@Everyone else
I have created a version of this software that will load a text file containing an OSG. It works better in my opinion. Mine isn't quite so simple.


Yes, give me the link and i'll edit the main post.
Paddymay
QUOTE (MegaManFan1 @ Jul 26 2009, 06:16 PM) *
Mine? Or the Hammered's OSG?


Hammered's OSG.
MegaManFan1
So can I post mine?
Paddymay
PM me the link.
Hammered_productions
whats the error paddy? i didnt get one :[
MegaManFan1
It's the v1.1 one I already PM'ed you. I'll PM it to you again if need be. Do I need to?
Paddymay
QUOTE (Hammered_productions @ Jul 26 2009, 06:22 PM) *
whats the error paddy? i didnt get one :[


COMPILATION ERROR in string to be executed
Error in code at line 3:
dth,room_height,c_red,c_black,1,1),0,0)

at position 2: Symbol , or ) expected.


What the heck is dth?!?!?
Hammered_productions
lmao oh the code got seperated so it was like this:

room_wi
dth,room_height


etcetc.. fixed now though, try it again :]
Paddymay
QUOTE (MegaManFan1 @ Jul 26 2009, 06:23 PM) *
It's the v1.1 one I already PM'ed you. I'll PM it to you again if need be. Do I need to?


PM the direct exe download.
MegaManFan1
Oh gotcha!
Paddymay
QUOTE (MegaManFan1 @ Jul 26 2009, 06:27 PM) *
Oh gotcha!


That's a non-pro version! A couple of OSGs would be broke by now...

******
Moderator edit:

If you want to send something to the author, use the PM system -- not this topic. Also, members should NOT post their versions of this program here.

MegaManFan1
@Paddymay
Are you gonna let this die? Just wanna know.
Shadow Link
Seeing as how this was bumped, I might as well post this to get it off my desktop:

Save this image, and rename it to "arrow.png" if needed.


And here's the OSG:

CODE
set_automatic_draw(0);
screen_refresh();
draw_clear(c_ltgray);
draw_set_color(c_black);
spr_arrow = sprite_add(working_directory + "\arrow.png",1,0,1,1,1,16,16);
xx = 50;
yy = 50;
dir = 0;
vel = 2;
turn = 3;

while(1 = 1)
{
draw_clear(c_ltgray);
draw_text(20,20,"Press [Esc] to exit");

if(keyboard_check_direct(vk_left))
{
dir += turn;
}

if(keyboard_check_direct(vk_right))
{
dir -= turn;
}

if(keyboard_check_direct(vk_up))
{
xx += lengthdir_x(vel,dir);
yy += lengthdir_y(vel,dir);
}

if(keyboard_check_direct(vk_down))
{
xx -= lengthdir_x(vel,dir);
yy -= lengthdir_y(vel,dir);
}

if keyboard_check_direct(vk_escape)
{
break;
}

draw_sprite_ext(spr_arrow,0,xx,yy,1,1,dir,c_white,
1);
screen_refresh();
}

game_end();


My point is: You don't have to follow "OSG rules" to make a full game with this. Sure, you'll get kicked out of a competition, but that's the only thing stopping you really.
MegaManFan1
Is all it does is just draw the text and image? That's cool I guess, I just thought there was more. Nice job with that! I'm gonna PM you my version. smile.gif You'll like it, trust me.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.