I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: Rpup on December 03, 2013, 11:32:21 AM

Title: game maker help
Post by: Rpup on December 03, 2013, 11:32:21 AM
Hi, Im trying to start making some simple fangames on game maker using 'i wanna be the engine yuuutu edition' however whenever i try to run the game using the rooms already created i get error messages.

A picture of the errors is here: https://imgur.com/g0fNon2

these are the errors:

In Object damageblock, in Event CollisionEvent action number 1 at line 2 : Symbol ) expected
In Object damageblock, in Event CollisionEvent action number 1 at line 2 : something bad
In Object damageblock, in Event CollisionEvent action number 1 at line 2 : symbol } expected
In Object damageblock, in Event CollisionEvent action number 1 at line 1 : malformed with statement

Any help is much appreicated,

Thanks


Title: Re: game maker help
Post by: dYnAm1c on December 03, 2013, 11:37:05 AM
The errors show you where something is wrong so you maybe should show us the code of the collission event.
Title: Re: game maker help
Post by: Rpup on December 03, 2013, 11:42:27 AM
https://imgur.com/PRD8Qix

This is the code i think

I didnt change anything from the engine download. Do other engines have these problems aswell?
Title: Re: game maker help
Post by: dYnAm1c on December 03, 2013, 11:49:20 AM
What you posted is the create event not the collission
Title: Re: game maker help
Post by: Rpup on December 03, 2013, 01:41:07 PM
sorry, is this any better? https://imgur.com/Ha4VlHe
Title: Re: game maker help
Post by: lemonxreaper on December 03, 2013, 08:56:35 PM
you are using gamemaker studio, as far as I know the engine is not compatible with that. you need the other kind of gamemaker.
Title: Re: game maker help
Post by: Olivebates on December 04, 2013, 08:10:14 AM
Alright, here's what is wrong: In the object called "damageblock", there is a collision event, where you have executed a code. In that code, you have used the wrong syntax, and for that, game maker can't run the code. In the script, please count the amount of open brackets "(", and the amount of closed brackets ")". If there is not the same amount of each, they should, for the syntax to be correct. Do the same with the squigly brackets "{" and "}", if there is not the same amount of each, then you should also fix that.


That fixed the first and the third error you mentioned. Now, for the second and the fourth error, we will need to see the code, that is in the collision event in the object called "damageblock". Can you take a snapshot of the executed code, in that specific location, and post it.
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 11:42:31 AM
Thanks for the help, I managed to get an older version of game maker and it seems to work.

However I get this fatal error everytime i try to run the game https://imgur.com/T6uzVYE

sorry that im such a noob at this =/

edit: I deleted the stage select room, not sure if that causes it though.
Title: Re: game maker help
Post by: lemonxreaper on December 04, 2013, 11:57:36 AM
why would you do that?!!!??!
of course that's going to cause issues
its an integral part of the saving and loading system.
basically the menu is trying to go to a room that doesn't exist anymore.
Title: Re: game maker help
Post by: Olivebates on December 04, 2013, 12:01:08 PM
The image you just posted, means that in the step event of the object(not the room) called menuSelect, it is trying to send the player to a non-existant room.

To fix your other problems, we just need you to post the code, and we can help you.
We will need to see the code, that is in the collision event in the object called damageblock.
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 12:05:27 PM
im not having any problems with the collision event anymore, but how do i fix the fatal error?

thanks
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 12:07:55 PM
edit: I think i fixed it by changing the code around, will post if i have more issues.

Thanks for the help =)
Title: Re: game maker help
Post by: Olivebates on December 04, 2013, 12:15:06 PM
We will need to see the code, that is in the collision event in the object called damageblock. Not the load file script.
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 12:16:11 PM
I think I worked it out, no fatal anymore.

Il post if I have more problems, thanks
Title: Re: game maker help
Post by: Olivebates on December 04, 2013, 12:19:08 PM
Alright, have fun Game Making!


Also on a side note for future reference, use the Insert Code button when inserting a script into your post.

(https://i894.photobucket.com/albums/ac144/olivebates/Unavngivet-7.png?t=1386177657)
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 12:24:53 PM
Hey again, on my first screen when pressing R to restart it doesnt take me to the start of that screen. Which script do i need to change?

Also the save box isnt appearing when i run the game even though it is on the room editior. Not sure how to fix this
Title: Re: game maker help
Post by: Olivebates on December 04, 2013, 12:54:20 PM
For your first question, you need to have an object, that has an event for "When 'R' is pressed", and put the "restart room" command in that event. Then you place that object in every room of the game. Alternatively to placing it in every room in the game, you can check the box called "persistant" in the object editor window. Then only place the object in the very first room of the game. "persistant" means that the object will carry on, to every other room of the game. The "world" object, is already set as a persistant object. So all you need to do, is put the command into that object.


Your second question; please post the info on the save object that isn't spawning, the same way you did earlier:
sorry, is this any better? https://imgur.com/Ha4VlHe (https://imgur.com/Ha4VlHe)
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 12:58:56 PM

I think i fixed the save box problem however I now have a new problem.

I changed the menuselect code to take you to the first screen, which is fine, however it doesnt seem to be saving the game, so everytime i exit and replay it starts from the first screen again even though it says the time and death count on that menu icon.

Thanks for any help =)
Title: Re: game maker help
Post by: Olivebates on December 04, 2013, 04:10:06 PM
We aren't really sitting with the engine open ourselves, it would help us help you if you would post the code.
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 05:14:16 PM
Hi, sorry about that. Here is the code I menuselect code that i changed

Code: [Select]
//カーソル移動
if(keyboard_check_pressed(global.leftbutton) == true){
  sound_play(sndJump);
  select -= 1;
  if(select < 1){
    select = 3;
  }
}else if(keyboard_check_pressed(global.rightbutton) == true){
  sound_play(sndJump);
  select += 1;
  if(select > 3){
    select = 1;
  }
}else if(keyboard_check_pressed(global.jumpbutton) == true){
  global.savenum = select;
  room_goto(sampleroom04);
}



I was also wondering how to play music with the play music icon. I dont want to play music from the game maker event because I dont want it to keep repeating. I read an earlier topic about this and it said to type if !sound_isplaying(song) { sound_loop(song); } on the creation code

Only problem is this is the code for the music player
 
Code: [Select]
//音楽を鳴らす
/**
詳しくは、Roomに配置されているplayMusicを
Ctrl押しながら右クリックをして
「CreationCode vを選択して中を覗いて下さい。
そこで、再生するSoundが宣言されています。
**/

so im not really sure how to get my track playing with that code

Thanks
Title: Re: game maker help
Post by: infern0man1 on December 04, 2013, 05:26:19 PM
Hi, sorry about that. Here is the code I menuselect code that i changed

Code: [Select]
//カーソル移動
if(keyboard_check_pressed(global.leftbutton) == true){
  sound_play(sndJump);
  select -= 1;
  if(select < 1){
    select = 3;
  }
}else if(keyboard_check_pressed(global.rightbutton) == true){
  sound_play(sndJump);
  select += 1;
  if(select > 3){
    select = 1;
  }
}else if(keyboard_check_pressed(global.jumpbutton) == true){
  global.savenum = select;
  room_goto(sampleroom04);
}



I was also wondering how to play music with the play music icon. I dont want to play music from the game maker event because I dont want it to keep repeating. I read an earlier topic about this and it said to type if !sound_isplaying(song) { sound_loop(song); } on the creation code

Only problem is this is the code for the music player
 
Code: [Select]
//音楽を鳴らす
/**
詳しくは、Roomに配置されているplayMusicを
Ctrl押しながら右クリックをして
「CreationCode vを選択して中を覗いて下さい。
そこで、再生するSoundが宣言されています。
**/

so im not really sure how to get my track playing with that code

Thanks



First off, yuuutu edition originally leads to rSelectStage. From there you hop into a portal, which then saves your game afterwards.
alternatively, use menuSelect2. it doesn't require rSelectStage



for playMusic, the code stated is a bunch of broken-japanese characters that was used to help explain what to do originally. Don't do anything within the object. Just place it in the room and either ctrl+right click or just right click the playMusic object. then, in the object's creation code, use the if !sound_isplaying(...){sound_loop(...);}

Hope this helps
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 05:51:58 PM
thanks, that really helps =D
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 06:06:10 PM
what should i add to this code to lower the music volume?

Code: [Select]
if !sound_isplaying(track01) { sound_loop(track01); }
Title: Re: game maker help
Post by: lemonxreaper on December 04, 2013, 07:09:21 PM
edit the audio with an external program such as audacity. really though a lot of what you are asking is gamemaker basics. I advice you look up a tutorial or read the manual. asking for help for specific things is understandable. but you cant ask for help at every turn.
Title: Re: game maker help
Post by: Rpup on December 04, 2013, 07:30:52 PM
='( sorry
Title: Re: game maker help
Post by: lemonxreaper on December 04, 2013, 07:49:15 PM
its fine honestly, don't worry about it.
I didn't intend that message to be as harsh as it may have come across.
I just suggest looking up the relevant material such as basics and basic functions as there's multiple sources, its written with your level of coding ability in mind and you find it faster without having to wait for replies as well as saving people time and being more self rewarding. beyond that though feel free to ask questions. if its something you don't understand or a idea you are unsure of how to pull off or the odd technical difficulty :P
Title: Re: game maker help
Post by: Sephalos on December 05, 2013, 01:21:06 AM
When I first got into Game Maker I had almost no coding experience. So, I sat down one night and read the Game Maker help manual.

(click to show/hide)

I didn't remember everything at first. So I would refer back to the manual whenever I needed a reminder. Eventually, everything becomes second nature and you can code with ease. The rest just comes up to logical thinking and math.
Title: Re: game maker help
Post by: dYnAm1c on December 05, 2013, 06:09:43 PM
There are also some tutorials for coding and scripting in Game Maker Studio, not sure of the other versions, which are quite good.