file Basic Marble Blast Coding Q&A

More
24 Aug 2012 22:26 #271 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
But Explode didn't call the export function, so why did it work?

Anyway it's very interesting. But i don't understand your two last sentences.

Please Log in or Create an account to join the conversation.

More
25 Aug 2012 17:19 #272 by Explode
Replied by Explode on topic Basic Marble Blast Coding Q&A
Aug 24, 2012, 3:18pm, jeff wrote:And you can do that with any variable, you don't have to just export prefs. Also lamp could have also just made a new .cs file too

What he said. Also, I think lamp has an export system in the project I used to test it in T3D.

Please Log in or Create an account to join the conversation.

More
25 Aug 2012 17:50 #273 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
I just said i didn't understand his two last sentences, which you just quoted me as an answer.

I don't see, Jeff, what you mean by you don't have to just export prefs.

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
25 Aug 2012 18:36 #274 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
I was saying that you can save any $global variable to a file, it does not have to start with $pref::

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
25 Aug 2012 18:54 #275 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Yes, but if it starts with $pi:: is it necessary to add the export() line in the onExit function?

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
25 Aug 2012 18:55 #276 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
No, export is only used for saving variables, like saving highscore data and stuff. once again the :: means nothing, its just organization.

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
25 Aug 2012 19:00 #277 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Aug 25, 2012, 11:55am, jeff wrote:export is only used for saving variables, like saving highscore data and stuff

I know, i wanted to know if export was necessary to save the variable when you quit the game. As i can see it is.

I didn't mean to especially use the variable during MB's execution (which is not complicated), just to save its value when you quit the game.

Anyway thanks a lot, i think i've understand.

Please Log in or Create an account to join the conversation.

More
01 Jan 2013 01:16 #278 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Bump. I have two questions to ask.


How can i remove the intro before the main menu? I think i have to delete or modify the function runPresentation(); but i can't find it anywhere? Is it already in a compiled file?

What's the function to repeat a function for a chosen time?

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
01 Jan 2013 01:18 #279 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
#2 schedule(time delay in milliseconds, 0, methodname, args);

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
01 Jan 2013 01:23 #280 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Thanks a lot, it will be useful ^^.

What does the second argument mean?

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
01 Jan 2013 01:55 #281 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
Never looked it up, but its suppost to deal with objects...just use 0, I always use zero.

If you need to schedule a method on an object, use:

%obj.schedule(time in ms, method, args);

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
01 Jan 2013 02:02 #282 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Ok thanks.

Please Log in or Create an account to join the conversation.

More
03 Jan 2013 16:58 #283 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Bump

I have another question. I would like to create a GUI which give you the list of missions in the missions folder, and you can select a mission and click on a button to play it. What is a GUI object to make this kind of list ? And what are the methods i'll have to use for it ? Thanks.

BTW is there a reference with the list of GUI objects and their methods in torquescript?

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
03 Jan 2013 23:02 #284 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
you can google the torqueScript reference manual.

use a guiTextListCtrl()

to add a row, do:

nameOfObject.addRow(nameOfObject.rowCount(),text to be added);

to get a row, use an index, starting with row 0

%row = nameOfObject.getRowTextById(nameOfObject.getSelectedId());

to clear a list, use this:

nameOfObject.clear();

any further questions just ask, i'll be happy to assist!

~Jeff

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
03 Jan 2013 23:44 #285 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Thank you Jeff but i don't get some things...

When i want to add a row:

(nameOfObject.addRow(nameOfObject.rowCount(),text to be added);)

What object is the second argument and with what i want to do, the text to be added is a mission name?

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
04 Jan 2013 00:11 #286 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
Thats what you want to add, you can make it a string, an object, pass in a variable, do whatever you want.

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
04 Jan 2013 15:53 #287 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Thanks, last thing, what's the second name of object ? Ad why did you put rowcount() after it ?

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
05 Jan 2013 06:45 #288 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
name of object is just the name you gave the scroll gui object =)

rowcount tells the engine HEY, I NEED ANOTHER ROW, BUMP ME UP A LEVEL kind of deal.

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
05 Jan 2013 15:09 #289 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Awesome.. it's working fine. Thanks again

I still need a help for something... i don't know how to get the list of every missions in the missions folder, how can i do that ?

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
05 Jan 2013 20:02 #290 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
missionlistobj.clear();
for (%file = findFirstFile(marble/data/missions/beginner/*.mis); %file !$= ; findNextFile(marble/data/missions/beginner/*.mis)) {
// now do the adding thing, the mission file is stored in %file
}

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
05 Jan 2013 21:54 #291 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
What you gave me is an infinate loop

Fixed it. You forget a %file = findNextFile(marble/data/m[...]


How do i add a scroller?

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
06 Jan 2013 08:35 #292 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
make a guiScrollControl and add the list inside of the scroll control

also sorry about the infinate loop lol, I indeed forgot %file :X

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
06 Jan 2013 19:24 #293 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
Everything is working , thanks Jeff

Please Log in or Create an account to join the conversation.

  • UN1C0DE
  • UN1C0DE's Avatar
  • Offline
  • Beginner Marbler
  • Beginner Marbler
  • Happy Roll
More
13 Jan 2013 15:44 #294 by UN1C0DE
Replied by UN1C0DE on topic Basic Marble Blast Coding Q&A
How can I play a certain background music in a certain level?

Member of Roll Game Team
Programmer / Level Modeller / Background Music Designer
MarbleBlast::HappyRoll YEAH!!!!!!!!

Please Log in or Create an account to join the conversation.

  • Buzzmusic
  • Buzzmusic's Avatar
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
More
13 Jan 2013 18:57 #295 by Buzzmusic
Replied by Buzzmusic on topic Basic Marble Blast Coding Q&A
Convert your song to a .ogg file (if it isn't already) and put it in your marble/data/sound/music directory (if it's in MBP, it's platinum instead of marble). Then in your level, add a dynamics field and call it music. For the value, use the name of your song (with the .ogg extension).

All posts from my account that were made before July 29 2013 are from the point of view of my dad unless it states otherwise.

Please Log in or Create an account to join the conversation.

More
13 Jan 2013 22:55 #296 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
What's the function to unload the current loaded mission? Please don't tell me disconnect() This function also leads me to the playMissionGui.

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Developer
  • Developer
  • PlatinumQuest Programmer
More
13 Jan 2013 23:04 #297 by Jeff
Replied by Jeff on topic Basic Marble Blast Coding Q&A
that is the function ^

If you want to just load another one while playing one, do

loadMission(marble/data/missions/beginner/bla.mis);

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

More
13 Jan 2013 23:10 #298 by Alexis
Replied by Alexis on topic Basic Marble Blast Coding Q&A
The game just crash when i try to load two missions at once.

Well... i was wrong, it's working, thanks

Please Log in or Create an account to join the conversation.

More
21 Mar 2013 03:54 #299 by FruBlox
Replied by FruBlox on topic Basic Marble Blast Coding Q&A
Been a while since the last post, but I do have a question.

For binding functions to keys, how do you prevent running the function multiple times when the key is held down? I want to make it so that:
1 press = 1 function execution

EDIT: Apparently the reason the function is executing twice is because the function runs once when the key is pressed and once more when the key is released. How do I just make it run once and ignore when the key is released?

Please Log in or Create an account to join the conversation.

  • Aayrl
  • Aayrl's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Big Deal!
More
22 Mar 2013 14:06 #300 by Aayrl
Replied by Aayrl on topic Basic Marble Blast Coding Q&A
Not entirely sure if there is a cleaner way of doing this, I'll let Jeff provide input as well.

Because of the nature of the key binding in this engine, it may not be possible to tell it to fire one function per button press. However, we can implement some hackish code;

Setup a global variable, something like $functionname_Toggled = False

Now enclose everything in your function with an if-statement that requires functionname_Toggled to be false. Additionally, inside of your if-statement, near the end, insert $functionname_Toggled = True and a schedule to set $functionname_Toggled = False a couple seconds later. This will force the function to run once and not allow itself to be executed until the schedule re-flags the Boolean to be false once more.

Hopefully this helps,

~Aayrl

Please Log in or Create an account to join the conversation.

Moderators: AayrlKalle29Regislian