file Basic Marble Blast Coding Q&A

  • Posts: 227
  • Thank you received: 0
12 Jul 2010 03:30 #31
Wow... fail.
It's still not working with either.
The .cs is just trying to make a new item (used a Torque book) that has no collision, and has a particle emitter (the emitter works).
Basic new .cs syntax pl0x.

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 19:24 #32
you can't change the script syntax without modifying the source code

you could post the script here to troubleshoot

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

  • Posts: 20
  • Thank you received: 0
15 Jul 2010 03:04 #33
Alright, maybe you can help me with this:

I want to create a Dialogue Box, have the player enter something in, and then get the result. I really have no idea how to do this on my own without changing the Highscore name.

The first part is simple enough (unless I should do it a different way):

EnterNameText.setText(<just:center><font:Expo:50>Hello!\n<font:DomCasualD:32>Enter in Something!);
Canvas.pushDialog(EnterNameDlg);
EnterNameEdit.setSelectionRange(0, 100000);

But how do I figure out what the player entered in?
Thanks!

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
15 Jul 2010 17:47 #34
EnterNameEdit.getValue();

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

  • Posts: 20
  • Thank you received: 0
15 Jul 2010 22:41 #35
Jul 15, 2010, 10:47am, seizure22 wrote:EnterNameEdit.getValue();

Alright. I was trying something like that, but couldn't figure out how to make it so that when I hit OK on the box it would know.

So like I typed in a name, and then when I hit OK it would do:
addhelpline(EnterNameEdit.getValue());

Anyways, this still changes the Highscore name. Any help?

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
15 Jul 2010 23:54 #36
you'd be best to save a copy of the gui, rename it so you don't have dupes (you'll need to change the dlg name, which would be the first object in the .gui, and you'll need to change the name somewhere else(search for popdialog in the .gui)), and remove the variable field on EnterNameEdit

then, just use that instead of the original one

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

  • RDs.The-dts-guy
  • RDs.The-dts-guy's Avatar
  • Offline
  • Developer
  • Developer
  • Blender pls
  • Posts: 719
  • Thank you received: 188
26 Jul 2010 11:31 #37
Ayrl or seizure 22 can you create code that makes marble jumping without stoping even after it passes checkpoint ( i want to add code to mis file and make level )

Some guy that does DTS shapes and levels.

AWESOME time HINT : When making PQ level place your custom interiors and textures in platinum/data/interiors_pq/custom
makes life easier for you and everyone else :)

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
26 Jul 2010 23:49 #38
add to top of .mis

Code:function blahblah()
{
if (isObject(MissionInfo))
jump();
else
return;
schedule(1, 0, blahblah);
}
blahblah();

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

  • Posts: 124
  • Thank you received: 1
22 Aug 2010 10:57 #39
Bump!

I have a question. I have this code:

Code:function mouseFire()
{
%rotation = getWords(%obj.getTransform(),3);
%ortho = vectorOrthoBasis(%rotation);
%up = getWords(%ortho,6);
if (getGravityDir() !$= %up) {
Parent::onPickup(%this, %obj, %user, %amount);
setGravityDir(%ortho);
}
}


When I press the powerup key, it changes the gravity to 180. How do I make it so that when I press the powerup key, it changes the gravity to 180 minus the current gravity (essentially a gravity switch)?

Edit: Never mind, I saw whirligig's post.

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

  • Posts: 124
  • Thank you received: 1
26 Aug 2010 22:41 #40
What is the function to stop all scheduled tasks?

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
27 Aug 2010 21:34 #41
none that I know of

if you want to cancel something specific, assign the schedule to a string

Code:$stuff = schedule(1, 0, function);

then to cancel it

Code:cancel($stuff);

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
31 Aug 2010 16:23 #42
Question:

In the beginner levels, some of the help triggers have in the code:
Code:Press <func:bind moveforward> to move forward
or something like that. I want to replace <func:bind moveforward> with a code so that the help trigger tells you how many gems you have. (Yeah, I know it tells you. I'm remaking something non-MB in the form of an MBP level.) Does anyone know how? *coughwhirlgigcoughseizurecoughpicklecowcough*

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.

  • Posts: 46
  • Thank you received: 0
31 Aug 2010 17:17 #43
Aug 31, 2010, 9:23am, marblemaster1 wrote:Question:

In the beginner levels, some of the help triggers have in the code:
Code:Press <func:bind moveforward> to move forward
or something like that. I want to replace <func:bind moveforward> with a code so that the help trigger tells you how many gems you have. (Yeah, I know it tells you. I'm remaking something non-MB in the form of an MBP level.) Does anyone know how? *coughwhirlgigcoughseizurecoughpicklecowcough*

Different ways to do this so mine might not be optimal,
put at top of .mis (if it's for a mod you may be abled to place it somewhere so you don't need to put it in every level)
Code:datablock TriggerData(GemHintTrigger)
{
tickPeriodMS = 100;
};

function GemHintTrigger::onEnterTrigger(%this,%trigger,%obj)
{
// Tell player how many gems he has
%gemcount = localclientconnection.gemCount;
%msg = '\c0You picked up a gem. You now have %1 gems!';
messageClient(localclientconnection, 'MsgItemPickup', %msg, %gemcount);
}

Then, add any type of trigger with the LE or whatever, maybe give it a name so you know which one you are looking for, then change datablock to GemHintTrigger:
Code:new Trigger(MaybeYouWantANameHereToFindItEasyer) {
position = don't really care about this;
rotation = don't really care about this either;
scale = the size as you may know, not what we need;
>>>>dataBlock = GemHintTrigger;<<<<
polyhedron = lots of number not important to us;
};

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

  • Posts: 227
  • Thank you received: 0
31 Aug 2010 21:15 #44
Can you make a trigger that changes a marble physics property? (jumpimpulse, gravity etc) while your in it and goes back to normal when you exit? Just putting the lines doesn't work

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
31 Aug 2010 21:19 #45
Cool, it works! Thanx!
No, I'm not making a mod, just a level.
EDIT: OMG ninja'd

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.

  • Posts: 46
  • Thank you received: 0
31 Aug 2010 21:57 #46
Aug 31, 2010, 2:15pm, mbgdemon wrote:Can you make a trigger that changes a marble physics property? (jumpimpulse, gravity etc) while your in it and goes back to normal when you exit? Just putting the lines doesn't work


About the same as above ok, a little longer, and damn I need to put this is my thread but not right now
Code:datablock TriggerData(FunkyPhysicsTrigger)
{
tickPeriodMS = 100;
};

function FunkyPhysicsTrigger::onEnterTrigger(%this,%trigger,%obj)
{
// Change Physics
defaultmarble.maxRollVelocity = 15;
defaultmarble.angularAcceleration = 75;
defaultmarble.brakingAcceleration = 30;
defaultmarble.gravity = 20;
defaultmarble.staticFriction = 1.1;
defaultmarble.kineticFriction = 0.7;
defaultmarble.bounceKineticFriction = 0.2;
defaultmarble.maxDotSlide = 0.5;
defaultmarble.bounceRestitution = 0.5;
defaultmarble.jumpImpulse = 7.5;
defaultmarble.maxForceRadius = 50;
}

function FunkyPhysicsTrigger::onLeaveTrigger(%this,%trigger,%obj)
{
// Revert Physics
revertphysics();
}

function revertphysics()
{
defaultmarble.maxRollVelocity = 15;
defaultmarble.angularAcceleration = 75;
defaultmarble.brakingAcceleration = 30;
defaultmarble.gravity = 20;
defaultmarble.staticFriction = 1.1;
defaultmarble.kineticFriction = 0.7;
defaultmarble.bounceKineticFriction = 0.2;
defaultmarble.maxDotSlide = 0.5;
defaultmarble.bounceRestitution = 0.5;
defaultmarble.jumpImpulse = 7.5;
defaultmarble.maxForceRadius = 50;
}

The example above is for MBG, for MBP you need to sum up all marble names, from MarbleOne to MarbleFourty, there's also a name for when using a cutom marble, but I don't know it by heart (don't know where to look either).
So if you want to change a single physic, you need to put 80 lines, 40 to change and 40 to revert
In the above example no physics were changed so that'd be total useless code

Also, defined a new function revertphysics() that will set physics to normal, this is because you will need it again ahead.

You can leave out all the physics you do not want to change (you can leave them out in both enter and revertphysics). If you don't copy paste, be sure to add a semi colon ; behind the lines that require one (as demonstrated).

Also, I don't know what most of those properties do, but:
jumpImpulse = jumpImpulse, it's called impulse and not height because in lower gravity with same impulse you can go higher
maxRollVelocity = maximumspeed when not jumping, I don't know what it is in units but I would guess meters/sec (1 tile = 2 meters)
brakingAcceleration = I think how much speed the backwards key gives you, not sure, would prove for a fun tightrope level
bounceRestitution = knockback from hitting stuff, I think if you put this at 0.9 it would be like you have a super bounce on all the time
gravity = gravity ofc

To make a trigger behave like this, again, make a trigger of any kind in the LE (or however you would), give it a name so you can find it (you give it a name by filling in the field next to the Apply button). SAVE the level, go to the .mis and change Code:dataBlock = whatevertriggertypeyouused;
to
Code:dataBlock = FunkyPhysicsTrigger;

You will find the above in:
Code:new Trigger(NoJump) {
position = 3.14159 2.71828 6.62606;
rotation = 1 0 0 0;
scale = 6 6 6;
dataBlock = NoJumpTrigger;
polyhedron = 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000;
};

The above case was a NoJumpTrigger and it's name was NoJump (found between brackets next to new Trigger

Also, because you're changing physics here and not simply displaying a message you need to revert everything if the player restarts the level or when he leaves the level, so you also need to add the following:

Code:function GameConnection::onClientLeaveGame(%this)
{
revertphysics();
if (isObject(%this.camera))
%this.camera.delete();
if (isObject(%this.player))
%this.player.delete();
}

function State::ready()
{
revertphysics();
serverPlay2d(ReadyVoiceSfx);
PlayGui.setMessage(ready);
$Game::StateSchedule = schedule( 1500, 0, setGameState, set);
}


To avoid bugs if you are using checkpoints, make sure the player can't go OOB while in the trigger.
Gl and inform me if you get issues

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

  • Posts: 240
  • Thank you received: 0
06 Sep 2010 20:59 #47
And please someone know the code to open a specified level without the PlayMissionGUI? (Just with typing on the console.log).

Also thank you a lot narvoxx that will help me to do water with low gravity only inside...

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

  • Posts: 46
  • Thank you received: 0
06 Sep 2010 21:33 #48
Oh I forgot, if you are using multiple triggers, you need to give them all a different name (but the same datablock ofc), so you can't have 2 triggers named NoJump in the same level, it'd have to be NoJumpOne & NoJumpTwo both of the datablock NojumpingTrigger.
and np

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

  • Posts: 227
  • Thank you received: 0
07 Sep 2010 10:25 #49
The Play button issues a command, doesn't it? I guess it's like load(missionpath); or whatever.

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

  • Posts: 44
  • Thank you received: 0
07 Sep 2010 14:36 #50
use
doCreateGame(findNamedFile(missionfilename, .mis));
If you're in a game already, quit the mission first with
disconnect();

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

  • Posts: 240
  • Thank you received: 0
07 Sep 2010 17:15 #51
Thank you

EDIT: It is possible to make impossible to open a level that you didn't unlocked with this code? Because i just tried to open a level i didn't unlocked and it's worked.

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

  • Posts: 18
  • Thank you received: 0
07 Sep 2010 23:20 #52
What is the code to make tha MarbleTrailEmiter more large?

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

  • Posts: 46
  • Thank you received: 0
08 Sep 2010 00:03 #53
Code:datablock ParticleData(TrailParticle)
{
textureName = ~/data/particles/smoke;
dragCoeffiecient = 1.0;
gravityCoefficient = 0;
windCoefficient = 0;
inheritedVelFactor = 1;
constantAcceleration = 0;
lifetimeMS = 100;
lifetimeVarianceMS = 10;
useInvAlpha = true;
spinSpeed = 0;

colors[0] = 1 1 0 0.0;
colors[1] = 1 1 0 1;
colors[2] = 1 1 1 0.0;

sizes[0] = 0.7;
sizes[1] = 0.4;
sizes[2] = 0.1;

times[0] = 0;
times[1] = 0.15;
times[2] = 1.0;
};

datablock ParticleEmitterData(MarbleTrailEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.25;
thetaMin = 80.0;
thetaMax = 90.0;
lifetimeMS = 10000;
particles = TrailParticle;
};


Above is the unedited version, to change something type in console or add to .mis:
Code:TrailParticle.<propertyname> = <integer or real>;
or
Code:MarbleTrailEmitter.<propertyname> = <integer or real>;
Depending on what you want to change, example:
Code:TrailParticle.sizes[0] = 4.0;
TrailParticle.sizes[1] = 4.0;
TrailParticle.sizes[2] = 4.0;

Will change all particle size to x4 the image size of the particle. It looks shit.

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

  • Posts: 18
  • Thank you received: 0
09 Sep 2010 02:14 #54
Thanks
it's can be a really stupid quesion.
where I can find the file to edit it?

I don't know the files and codes for Marble Blast

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
09 Sep 2010 03:15 #55
marble/server/scripts/marble.cs

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

  • Posts: 46
  • Thank you received: 0
09 Sep 2010 10:03 #56
You'll want to keep a backup of the files you want to edit, just duplicate and rename it <name> backup.cs

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

  • Posts: 227
  • Thank you received: 0
09 Sep 2010 11:46 #57
Can you make a code that makes the screenshot key (crt-P) Q or E? Thanks.

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

  • Posts: 240
  • Thank you received: 0
09 Sep 2010 18:28 #58
Ok... well i re-ask my question because nobody will read anymore my post ^^.

It is possible to make impossible to open a level that you didn't unlocked with this code? Because i just tried to open a level i didn't unlocked and it's worked.

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

  • Posts: 227
  • Thank you received: 0
10 Sep 2010 02:07 #59
Sept 9, 2010, 11:28am, alexthepromacgamer wrote:Because i just tried to open a level i didn't unlocked and it's worked.
Seems like it's possible

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
10 Sep 2010 19:49 #60
tricky question, but the core part is:

possible to make impossible

@Alex

yes but there is no easy check to do so, but the basis is that you need to compare qualified missions and make sure the level # falls <= the qualified # in the prefs file

@offline

moveMap.bind(keyboard, ctrl f8, commandnamehere);

in config.cs

not sure if that'll work

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

Moderators: Doomblah
Time to create page: 2.007 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.