Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411978 Posts in 69438 Topics- by 58486 Members - Latest Member: Fuimus

June 15, 2024, 06:27:36 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Scripted Event System in Game Maker?
Pages: [1]
Print
Author Topic: Scripted Event System in Game Maker?  (Read 2809 times)
MartyMan
Level 0
***



View Profile
« on: June 20, 2010, 11:52:45 PM »

I'm attempting to make a scripted event system for my game. It's been giving me terrible trouble, though. The farthest I've gotten was getting a single string to type itself onto a screen in a dialog box. Concerned


This is just a mockup.

While the scripting would include things like making the player or npcs move, the most important part is the dialog, so that has to be finished first. Again, the farthest I've gotten is making it print a single string- I got terribly lost trying to make it go through a set of strings. Not to mention, I had trouble trying thinking of where to store the dialog- a text file seems obvious, but I'm not sure how to get GM to read one. The more I think about it, I'm wondering if a GM newbie like me is a bit in over his head, not to mention programming in general. Sad

I'd really appreciate any advice you could give on the subject. Maybe a tutorial somewhere that could point me in the right direction? I'd really appreciate it, considering this is the biggest Engine related hurdle I have to jump over in order to really get down and dirty with making this game. Crazy
Logged
BlueSweatshirt
Level 10
*****

the void


View Profile WWW
« Reply #1 on: June 21, 2010, 02:59:46 PM »

The way I do it:

I use data structures to hold events. I hold a ds_list of strings. I make a script to look for a string, which is the event in question, and return true and remove the string if it is there.

Then, to take advantage of the system, I make triggers(GM8+ only) to handle the events, a la:
Code:
{ 
  return check_event(eventList, "Move Right");
}

It's a very clean interface. The best part is since I use lots of inheritance in Game Maker, I can easily build off of parent objects with triggers, and easily build on already existing triggers for events.

Now, if you need your event to give data packages it's a little more complex, but not much. You simply create a ds_grid that holds a string, and then how ever many variables you want. It takes more code to interface with the grid than a list, but it's not hard at all.

[EDIT]
I see you're talking about something like an external scripting language to interface with your game. My idea is more of a back-end to what you want to do. A front end shouldn't be too hard from there.(it depends how you want to do it, I suppose)

by the way, I love the look of your game. Kiss
« Last Edit: June 21, 2010, 03:03:23 PM by Jakman4242 » Logged

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


View Profile
« Reply #2 on: June 21, 2010, 10:13:14 PM »

Wow, this *just* came up a little while ago.

http://forums.tigsource.com/index.php?topic=12902.0

Something along the lines of Jakman's method should work.  I made a pretty crazy system last year that was a ds_list of scripts.  A special event object would run through the ds_list, running one script at a time.  When the the script finished, the event object would move onto the next item in the ds_list and execute that one.
Logged
oahda
Level 10
*****



View Profile
« Reply #3 on: June 22, 2010, 03:48:18 AM »

Did you make those clouds? They look so good.
Logged

MartyMan
Level 0
***



View Profile
« Reply #4 on: June 22, 2010, 03:52:30 AM »

Thanks for the input guys. After reading what you've both said, plus taking a look at that thread you linked xerus, I screwed around a bit with some code, and I think I've got the basics of a scripted event system coming along. Smiley



What isn't shown are two scripts that make the player move a bit and change the camera to focus on the NPC. The system I've got for it feels nice and has about as much typing as I'd expect from something like this, so I don't mind it. I need to finish the Dialog box stuff now, then I can work on some more Scripted Event actions. Coffee

Did you make those clouds? They look so good.

Yeah. At the moment all of the graphics for this game are made by me.
Logged
oahda
Level 10
*****



View Profile
« Reply #5 on: June 23, 2010, 04:32:29 AM »

Do those black bars in the top and the bottom of the screen appear when this cutscene/dialogue is triggered? I love that idea, if that's the case!

... I'm probably going to have to steal that concept.
In any way, it's great to hear that you're succeeding, and, once again, I love the look of this game (not just the clouds)!
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic