|
Post by Stal on Jul 12, 2010 1:30:51 GMT
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.
|
|
|
Post by Seizure22 (Witty Title) on Jul 12, 2010 17:24:29 GMT
you can't change the script syntax without modifying the source code
you could post the script here to troubleshoot
|
|
|
Post by picklecow10 on Jul 15, 2010 1:04:38 GMT
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!
|
|
|
Post by Seizure22 (Witty Title) on Jul 15, 2010 15:47:20 GMT
EnterNameEdit.getValue();
|
|
|
Post by picklecow10 on Jul 15, 2010 20:41:53 GMT
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?
|
|
|
Post by Seizure22 (Witty Title) on Jul 15, 2010 21:54:31 GMT
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
|
|
|
Post by [DWARF] RDs.empire on Jul 26, 2010 9:31:18 GMT
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 )
|
|
|
Post by Seizure22 (Witty Title) on Jul 26, 2010 21:49:07 GMT
add to top of .mis
function blahblah() { if (isObject(MissionInfo)) jump(); else return; schedule(1, 0, "blahblah"); } blahblah();
|
|
asuul714
Experienced Marbler
[ss:Default Skin]
Posts: 196
|
Post by asuul714 on Aug 22, 2010 8:57:39 GMT
Bump!
I have a question. I have this 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.
|
|
asuul714
Experienced Marbler
[ss:Default Skin]
Posts: 196
|
Post by asuul714 on Aug 26, 2010 20:41:04 GMT
What is the function to stop all scheduled tasks?
|
|
|
Post by Seizure22 (Witty Title) on Aug 27, 2010 19:34:49 GMT
none that I know of
if you want to cancel something specific, assign the schedule to a string
$stuff = schedule(1, 0, "function");
then to cancel it
cancel($stuff);
|
|
Marblemaster1 (Frosty)
Professional Marbler
Master of the Spam Board, that is[ss:Default Skin]
I have CDO. It's just like OCD, except the letters are in alphabetical order AS THEY SHOULD BE.
Posts: 361
|
Post by Marblemaster1 (Frosty) on Aug 31, 2010 14:23:12 GMT
Question:
In the beginner levels, some of the help triggers have in the 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*
|
|
narvoxx
Experienced Marbler
not short enough for one line
Posts: 167
|
Post by narvoxx on Aug 31, 2010 15:17:11 GMT
Question: In the beginner levels, some of the help triggers have in the 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) 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": 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"[img]http://i92.photobucket.com/albums/l14/Perishingflames/disgust1.gif[/img]<<< polyhedron = lots of number not important to us; };
|
|
|
Post by Stal on Aug 31, 2010 19:15:43 GMT
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
|
|
Marblemaster1 (Frosty)
Professional Marbler
Master of the Spam Board, that is[ss:Default Skin]
I have CDO. It's just like OCD, except the letters are in alphabetical order AS THEY SHOULD BE.
Posts: 361
|
Post by Marblemaster1 (Frosty) on Aug 31, 2010 19:19:35 GMT
Cool, it works! Thanx! No, I'm not making a mod, just a level. EDIT: OMG ninja'd
|
|
narvoxx
Experienced Marbler
not short enough for one line
Posts: 167
|
Post by narvoxx on Aug 31, 2010 19:57:49 GMT
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 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 dataBlock = "whatevertriggertypeyouused"; to dataBlock = "FunkyPhysicsTrigger"; You will find the above in: 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: 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
|
|
|
Post by Alexis on Sept 6, 2010 18:59:52 GMT
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...
|
|
narvoxx
Experienced Marbler
not short enough for one line
Posts: 167
|
Post by narvoxx on Sept 6, 2010 19:33:23 GMT
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
|
|
|
Post by Stal on Sept 7, 2010 8:25:10 GMT
The "Play" button issues a command, doesn't it? I guess it's like load("missionpath"); or whatever.
|
|
|
Post by Otto on Sept 7, 2010 12:36:36 GMT
use doCreateGame(findNamedFile("missionfilename", ".mis")); If you're in a game already, quit the mission first with disconnect();
|
|
|
Post by Alexis on Sept 7, 2010 15:15:50 GMT
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.
|
|
Mario
Suspended
[ss:Blue Groove (MF)]
Posts: 113
|
Post by Mario on Sept 7, 2010 21:20:22 GMT
What is the code to make tha "MarbleTrailEmiter" more large?
|
|
narvoxx
Experienced Marbler
not short enough for one line
Posts: 167
|
Post by narvoxx on Sept 7, 2010 22:03:37 GMT
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:
TrailParticle.<propertyname> = <integer or real>; or
MarbleTrailEmitter.<propertyname> = <integer or real>; Depending on what you want to change, example:
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.
|
|
Mario
Suspended
[ss:Blue Groove (MF)]
Posts: 113
|
Post by Mario on Sept 9, 2010 0:14:23 GMT
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
|
|
|
Post by Seizure22 (Witty Title) on Sept 9, 2010 1:15:17 GMT
marble/server/scripts/marble.cs
|
|
narvoxx
Experienced Marbler
not short enough for one line
Posts: 167
|
Post by narvoxx on Sept 9, 2010 8:03:19 GMT
You'll want to keep a backup of the files you want to edit, just duplicate and rename it "<name> backup.cs"
|
|
|
Post by Stal on Sept 9, 2010 9:46:48 GMT
Can you make a code that makes the screenshot key (crt-P) Q or E? Thanks.
|
|
|
Post by Alexis on Sept 9, 2010 16:28:52 GMT
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."
|
|
|
Post by Stal on Sept 10, 2010 0:07:16 GMT
Because i just tried to open a level i didn't unlocked and it's worked. Seems like it's possible
|
|
|
Post by Seizure22 (Witty Title) on Sept 10, 2010 17:49:39 GMT
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
|
|