file Basic Marble Blast Coding Q&A

  • Aayrl
  • Aayrl's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Big Deal!
  • Posts: 1118
  • Thank you received: 370
10 Nov 2009 00:02 - 07 Jan 2014 02:28 #1
I felt silly posting replies onto member's coding tutorials. My alternative is to create a thread where users can post their coding questions, and hopefully get them answered. Please post here if you have any questions referring to the Marble Blast coding language and we'll see what feedback we can present to you.

~Aayrl
Last edit: 07 Jan 2014 02:28 by Aayrl.

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

  • Posts: 227
  • Thank you received: 0
10 Nov 2009 00:41 #2
Ah! I have SOO many questions!
how do you create a line in the prefs.cs file? Like when you pick up an item? (in itemdata datablock)

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

  • Aayrl
  • Aayrl's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Big Deal!
  • Posts: 1118
  • Thank you received: 370
10 Nov 2009 06:57 #3
I'm not sure what you're looking for, you've given me two seperate coding files to work with here (inventory.cs and prefs.cs). One operates the powerups and your current inventory status, whilst the other controls your times and settings.

Please clarify the question more for me

~Aayrl

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

  • Aayrl
  • Aayrl's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Big Deal!
  • Posts: 1118
  • Thank you received: 370
10 Nov 2009 11:56 #4
Yeah I gotta question for you, why do you always put ~Aayrl after every post you make? it's a serious question

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

  • Aayrl
  • Aayrl's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Big Deal!
  • Posts: 1118
  • Thank you received: 370
10 Nov 2009 14:25 #5
It's my signature before my forum signature..

..just a habit

~Aayrl

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

  • Posts: 227
  • Thank you received: 0
11 Nov 2009 00:06 #6
ok.
prefs in client
like adding a high score line.
pref::usedtimetravel[blah.mis]?=1;
abit like that

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

  • Aayrl
  • Aayrl's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Big Deal!
  • Posts: 1118
  • Thank you received: 370
11 Nov 2009 03:37 #7
From my understanding, the prefs.cs file in the client folder is merely a saved data recall station. Your game saves your settings and scores here, and recalls them later as written in various other coding. MainMenuGUI for example recalls data from this file to display your best times.

Per se, there is no way to 'add' lines into here manually, it's all done automatically by the marbleblast.exe program.

~Aayrl

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

  • Posts: 227
  • Thank you received: 0
11 Nov 2009 04:13 #8
no, like make a new kind of high-score

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

  • Aayrl
  • Aayrl's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Big Deal!
  • Posts: 1118
  • Thank you received: 370
11 Nov 2009 14:47 #9
Such...as...a new level genre...like Expert levels?

Again, this is attained not through the prefs.cs file, but another technique. If you create and title a new subfolder under your levels folder, name it, and give the playmenugui a place to access it (Another button), the game then calls upon level data stored into that folder, and saves it into the prefs.cs as a different level genre.

If you're talking more along the lines of a new 'time' for high scores, such as Platinum and Ultra, this is also done in several other bits and pieces of coding inside each level file and the game.cs. Again, the game calls upon the data stored here, and uses the prefs.cs as a place of memory/storage.

~Aayrl

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

  • Posts: 224
  • Thank you received: 10
11 Nov 2009 22:52 #10
That *twitch* ~Aayrl thing is *twitch* going to be the *twitch* death of you...

youtube.com/marbleduck

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

  • Posts: 227
  • Thank you received: 0
12 Nov 2009 00:21 #11
ok thx

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

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
05 Dec 2009 02:26 #12
How do I change the prefs.cs file name, like how MBF and MBP both have their own prefs.cs, how would I get it to make my own?

~HiGuy
EAT IT!

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

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

  • Perishingflames
  • Perishingflames's Avatar
  • Offline
  • Senior Marbler
  • Senior Marbler
  • Posts: 882
  • Thank you received: 21
05 Dec 2009 03:38 #13
marble/main.cs, change all (3?) instances of prefs.cs to ___prefs.cs

and may want to do that for common/main.cs as well.

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

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
06 Dec 2009 01:28 #14
Thank you PF! It worked!

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

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

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
  • Posts: 3502
  • Thank you received: 913
06 Dec 2009 01:44 #15
Loc--wait, what?

"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.

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

  • Posts: 227
  • Thank you received: 0
07 Dec 2009 00:13 #16
I meant like how in MBP they have an easter egg high score line in the MBPprefs.cs.

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

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
06 Jun 2010 02:21 #17
BUMP! How would you get the current value of a GuiTextEditCtrl (after the user has entered text)?

(Figured the bump was o.k. since it's a Q&A thread...)

HiGuy

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

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

  • Seizure22
  • Seizure22's Avatar
  • Offline
  • Intermediate Marbler
  • Intermediate Marbler
  • Posts: 79
  • Thank you received: 0
06 Jun 2010 05:26 #18
I think it's this:

(object name).getValue();

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

  • Marblemaster1
  • Marblemaster1's Avatar
  • Offline
  • Advanced Marbler
  • Advanced Marbler
  • Custom Code Enthusiast
  • Posts: 237
  • Thank you received: 8
12 Jun 2010 03:32 #19
I have a question:

Where is the code that controls the powerup functions?

QuArK is still a good map editor

You know what's boring? Opaque marble skins. You know what's not? Glass Marbles!

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

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
  • Posts: 3502
  • Thank you received: 913
12 Jun 2010 03:42 #20
Powerups.cs, but the engine contains superjump, superspeed, superbounce and shockabsorber values and those we cannot decrypt, so no one knows how to modify these.

"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.

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

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
18 Jun 2010 00:49 #21
How do you get the selected level number?
Also, which file would PM_MissionList be in?

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

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

  • Seizure22
  • Seizure22's Avatar
  • Offline
  • Intermediate Marbler
  • Intermediate Marbler
  • Posts: 79
  • Thank you received: 0
18 Jun 2010 03:08 #22
PM_MissionList.getSelectedId();
PlayMissionGui

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

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
18 Jun 2010 14:16 #23
Thanks seizure!
One more: Edit: Figured out the Yes/No. Edit 2: Got the mission type. How can I compare it to a string e.g.
Code:if ($MissionType == Advanced) {
...
}

so that it will only return Yes for what it's equal to?

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

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

  • Posts: 10
  • Thank you received: 0
18 Jun 2010 17:37 #24
Code:if ($MissionType $= Advanced) {
...
}

$= will compare strings. You can use !$= to test if two strings are NOT equal.

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

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
18 Jun 2010 18:15 #25
OMG Thank you!

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

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

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
07 Jul 2010 17:48 #26
How would I run a string as a script?

I've tried
ececute(blah);
run(blah);
runCommand(blah);
(replace blah with a real command)

HiGuy

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

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

  • Seizure22
  • Seizure22's Avatar
  • Offline
  • Intermediate Marbler
  • Intermediate Marbler
  • Posts: 79
  • Thank you received: 0
07 Jul 2010 19:52 #27
eval(blah(););

Syntax is tricky, post again if you're having trouble.

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

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
11 Jul 2010 16:16 #28
Thanks seizure22!

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

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

  • Posts: 227
  • Thank you received: 0
12 Jul 2010 01:42 #29
How do I get the main.cs (server) to exec new .cs files? Or do I need some special formatting in the new files? >_< (exec(etc.cs); isn't working)

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

  • Seizure22
  • Seizure22's Avatar
  • Offline
  • Intermediate Marbler
  • Intermediate Marbler
  • Posts: 79
  • Thank you received: 0
12 Jul 2010 02:06 #30
for root folder files

exec(./etc.cs);

for other folder files

exec(marble/server/scripts/blah.cs);

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

Moderators: Doomblah
Time to create page: 2.031 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.