Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411637 Posts in 69394 Topics- by 58448 Members - Latest Member: Danque_Birbington_II

May 14, 2024, 02:13:26 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsGame Maker Tuts
Pages: 1 ... 6 7 [8] 9 10 ... 24
Print
Author Topic: Game Maker Tuts  (Read 356219 times)
MaloEspada
Guest
« Reply #140 on: June 01, 2009, 03:32:28 PM »

Worked like a breeze PureQuestion!
Thanks guys.  Cool Hand Thumbs Up Right
Logged
PureQuestion
Level 4
****



View Profile
« Reply #141 on: June 01, 2009, 06:09:07 PM »

Awesome. I'll have to remember that this worked.
THEN I WILL HAVE IT MADE!
 Hand Money LeftBig LaffHand Money Right

Hopefully, anyway.
Logged

___
Vice President of Marketing, Romeo Pie Software
Level 10
*


View Profile
« Reply #142 on: July 05, 2009, 09:57:23 AM »

OKAY SO...  (long post warning)

Anyone out there ever use RPG Maker?  It has this event system that is really sweet.  Each event is only executed until after the previous one is done.  This made it really easy to make little scripted sequences and full on cut scenes and such.  I really want to be able to make something like it in Game Maker... but WHY?!

Well, up until now I've been using states and timers to do any sort of scripted sequence event.  Like in Jottobots, the intro calls for a lot of things to happen.  The screen starts off as black, and a bunch of little robots go flying by from the left to the right.  Then the title drops down from the top of the screen and settles, followed by J. Otto and my name to appear with EXPLOSIONS.  then after all of that, the character standing on the ground fades into view.

My current way of doing this relies on an object and a timer in that object that just always adds one to itself.  So then I have "events" set up like so:
Code:
if (timer == 100) {
  do the code to make an explosion
}

if (timer == 110) {
  do the code to make a name appear
}

if (timer > 300 and timer <= 400) {
  do the code to adjust the alpha to fade in the character
}

Then after all of this, when the timer reaches some value, it switches the "state" over to the normal game mode, which does no scripted sequences or anything.  I guess this works, but it sucks when I have to adjust anything in the script.  If I want to change the timing of something, I have to go and adjust every timer value until I fine tune it to get it right.

Now if I were to have some sort of system in place that executes scripts only when the previous one is done, then that sequence could be a whole lot simpler.  It could be a matter of something like:

Code:
createJottobots(blah blah blah);
wait(500);
createTitle();
wait(200);
explode(something something something);
showText();
wait(20);
fade(the object covering the character and ground, time, etc etc);
controlRestore();

So each one of those would execute in order, waiting for the last one to finish before proceeding with the next.  So if I wanted to adjust the order of something, all I have to do is just cut and paste, and adjust things like the wait() events.

That's a pretty simple linear example, and I had thought up of just a system of where there's an object that has some ds_queues.  In the queues are the scripts and their respective arguments.  It only executes while a flag says it's okay to do so, and every time it executes one it changes this flag to false, and the script itself is responsible for when it should be set back to true to run the next event.

But then I realized... it's going to be kinda hard to do stuff like if statements and loops, since they wont be part of the queue, and will be evaluated when the scripts are added!  Not when they're executed...

So now I'm working on a different way to do this, but I guess the point of all of this is:   Does anyone know exactly what I'm talking about?  Is there a certain term for this kind of system that I should know so I can look stuff up about it?  Has anyone ever actually done anything like this before and can point me in the right direction like a kid with a blindfold on swinging a bat at a stuffed animal with candy inside?

So far I've found a "command stack" example on the GMC, but seems absurdly complicated from what I started with.  There's also an "ai" extension of some sort, but it's not exactly what I'm looking for either.  I'm working on my current version of this event system thing that should handle conditions and loops, and its showing some promise -- but if anyone has any resources about this stuff I'd appreciate it!

tl;dr
Quote
I want to make an event system like RPG Maker's in Game Maker.  Haha.

p.s. special thx arthur lee
Logged
pgil
Guest
« Reply #143 on: July 05, 2009, 10:45:40 AM »

Code:
createJottobots(blah blah blah);
wait(500);
createTitle();
wait(200);
explode(something something something);
showText();
wait(20);
fade(the object covering the character and ground, time, etc etc);
controlRestore();

That's similar to how AGS works, and one thing that I miss in Game Maker. Not really sure the best way to do it. I just use a timer system like you posted above, and it seems to work just fine for title sequences and simple animations. 
Logged
___
Vice President of Marketing, Romeo Pie Software
Level 10
*


View Profile
« Reply #144 on: July 05, 2009, 10:56:56 AM »

Code:
createJottobots(blah blah blah);
wait(500);
createTitle();
wait(200);
explode(something something something);
showText();
wait(20);
fade(the object covering the character and ground, time, etc etc);
controlRestore();

That's similar to how AGS works, and one thing that I miss in Game Maker. Not really sure the best way to do it. I just use a timer system like you posted above, and it seems to work just fine for title sequences and simple animations. 

Timer systems fall apart though in situations where the time until a script is completed is unknown.  Like if an event calls for the camera to pan to the left until it hits a target, I have no idea when that will exactly be done.  Sure, I could probably set it up so it will return the amount of time it will take to get to the target, but it gets messy with more complicated things than just moving the camera some distance.  Like if I call a script to have an object move to a certain coordinate, but there are varying obstacles in the way (moving platforms, opening and closing doors, etc) then I have no idea when that event will be over.  I can guess, but it will never be as accurate than just having a system of events.

I guess an event system opposed to a timer and state system just ends up being a lot more versatile! Smiley
Logged
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #145 on: July 05, 2009, 11:17:11 AM »

What you describe is fundamentally impossible to do if the language core doesn't support it. Here's a nasty way of emulating such timings. Have a function with a big switch statement, and it progresses through the options linearly. Call it every frame.
Here's an example, which convenient syntax for sleeping:

Code:
sleepUntil = 0;
state = 0;
function sleep(time)
{
  sleepUntil = now()+time;
}

function next()
{
  state += 1;
}

function runEveryFrameDuringCutscene()
{
if(sleepUntil>0)
{
  if(sleepUntil>now())
  {
    next();
    sleepUntil = 0;
  }
  else
    return;
}
switch(state)
{
case 0:
  displaySomeText();
  startAnAnimation();
  next();
  break;
case 1:
  if(animationIsFinished()) next();
  break;
case 2:
  doNextThing();
  sleep(500);
  break;
case 3:
  finishCutScene();
}
}
Logged
___
Vice President of Marketing, Romeo Pie Software
Level 10
*


View Profile
« Reply #146 on: July 05, 2009, 03:30:36 PM »

Hm, interesting.

I actually found something in GMC that is pretty close to what I'm talking about:

http://gmc.yoyogames.com/index.php?showtopic=383531&hl=script_execute

I found it while actually trying to find information on a crazy bug with the script_execute function, ha!
Logged
MaloEspada
Guest
« Reply #147 on: August 02, 2009, 06:25:43 PM »

Hey there guys, need a super help here.
I'm aiming towards using .pttune songs for my game, because they are very small in comparison to mp3s and such.

For this, I'm using this dll.
Quote

If you follow the tutorial correcly, you'll quickly find that the "bridge.pttune" that comes with the dll works perfectly. But my problem goes beyond that.

I tried with multiple .pttunes and found out that only some of them work; I don't know why some work and others don't. MY pttunes don't work, that's why I'm asking here.

Here is the link for one of my pttunes, which doesn't work:
Quote


I also would like to add that both work with pxtone player.
Logged
pgil
Guest
« Reply #148 on: August 03, 2009, 05:23:01 AM »

I'm guessing the dll uses an old version of the pxtone player. pxtone has been updated several times in the past year or so.
Logged
MaloEspada
Guest
« Reply #149 on: August 03, 2009, 08:09:34 AM »

That was my fear. I don't know enough programming to update the DLL...


Ugh, I'm screwed.
Logged
pgil
Guest
« Reply #150 on: August 03, 2009, 08:14:39 AM »

Can you contact the person who wrote it?  Maybe they'd be willing to update it if they know people are interested.
Logged
MaloEspada
Guest
« Reply #151 on: August 03, 2009, 08:19:13 AM »

The last post on the site was more than a year ago... But I just sent an email, anyway.
Logged
Rostiger
Pixelhead
Level 5
******



View Profile WWW
« Reply #152 on: August 03, 2009, 08:48:45 AM »

Hey Chevy, thanks for all those tutorials and scripts!
I'm trying to consume all the information you've thrown out so far as much as possible, but I ran accros some problems with the view scrolling scripts.

I placed the call of the view_step_towards_point(x,y) script in the players step event. When I tested it, the player just moved outside the room really fast.

So I changed the x and y in this part
Quote
for(i=1; i<=8; i+=1){
    if dist > i*i*2
    {
        x += lengthdir_x( i, dir );
        y += lengthdir_y( i, dir );
    }
}

to

Quote
for(i=1; i<=8; i+=1){
    if dist > i*i*2
    {
        view_xview[0] += lengthdir_x( i, dir );
        view_yview[0] += lengthdir_y( i, dir );
    }
}

Now it works alright, but the movement of the player suddenly is really jerky at times. I suppose this is an effect that occurs when the view tries to catch up with the players position?

So I guess I still have an error somewhere - did I maybe put the script call in the wrong event?
Logged

Clemens Scott
Co-Founder & Artist of Broken Rules
MaloEspada
Guest
« Reply #153 on: August 03, 2009, 09:01:29 AM »

The author mailed me back, said to update with the DLLs that come with the PXTone, from Pixel's page.

It worked great.
Logged
fraxcell
Level 5
*****



View Profile
« Reply #154 on: August 10, 2009, 09:52:08 AM »

I'm having some trouble with the seamless view scaling. It works great, except when I use a room transition, and the seams in the tiles come back. I'm pretty sure it's because gamemaker uses its own surface when it transitions rooms. Is there a way to change that?
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #155 on: August 10, 2009, 01:53:31 PM »

seams between objects is actually a long-standing game maker video card bug which mark has never fixed -- i think it happens with or without surfaces.
Logged

PlayMeTape
Guest
« Reply #156 on: August 14, 2009, 08:28:22 AM »

Excellent tutorial on surfaces and scaling. It helped me out a lot. Just one problem, it seems to have some problems with certain transitions between rooms (push). I'm guessing this is because they use surfaces? Anyway, does anyone know a way around this?
Logged
ChevyRay
Guest
« Reply #157 on: August 14, 2009, 10:15:38 AM »

If your surface is being mashed by room transitions, you could always just save it into a background, then when the next room starts, draw that background back onto your surface and then delete it. If what you mean is that it just doesn't look correct during the transition, it must just have something to do with the way GM render's the screen during transitions that doesn't agree with running surfaces.

One way around it would be to use your own room transition system, which uses the surface image of the screen and imitates the ones GM uses (or just come up with a better one, because the built-in transitions are often pretty tacky to actually use, if you ask me).
Logged
fraxcell
Level 5
*****



View Profile
« Reply #158 on: August 14, 2009, 12:41:49 PM »

It only shows the seems during the transitions, so I'll probably just make my own system. Or just not use a transition, which doesn't look half bad.
Logged

PlayMeTape
Guest
« Reply #159 on: August 14, 2009, 05:56:00 PM »

Thanks, and you're right they aren't very smooth. I guess I'm just lazy:P. But I've got two other questions now.

First, how do I get the engine to recheck keys when I'm starting a new room. Because as it is right now it takes a while before it actually reacts to keys that are being held in between rooms.

Also, if I want to use a font in low resolution without it trying to smooth them out by filling in pixels on grey inbetween the white ones. Do I have to draw them from a sprite?
Logged
Pages: 1 ... 6 7 [8] 9 10 ... 24
Print
Jump to:  

Theme orange-lt created by panic