Marble Blast Forums
« Coding questions »

Welcome Guest. Please Login or Register.
Sept 9, 2010, 5:41am




Marble Blast Forums :: Level Building Discussion :: Level Building :: Coding questions
« Page 2 of 2 Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Coding questions (Read 524 times)
ShadowMarble
Beginner Marbler
*
member is offline

[avatar]

The shadow is glitching out.

[msn]

Joined: Jun 2010
Gender: Male
Posts: 25
 Re: Coding questions, or answers rather
« Reply #30 on Jul 29, 2010, 2:09am »

For deleting objects called %obj:
Code:
%obj.getGroup().remove(%obj);
%obj.delete();

If you know the object is in MissionGroup (because you added it there):
Code:
MissionGroup.remove(%obj);
%obj.delete();

I can post some code for finding interiors you've created (by searching MissionGroup), if you don't want to use variables to keep track of them.

It's probable that if this code is called from a method of the object (for example, if you're removing a trigger in its onTrigger method), the code will not work properly. There's a fairly simple fix for this, which I can post.
« Last Edit: Jul 29, 2010, 2:22am by ShadowMarble »Link to Post - Back to Top  IP: Logged

110% of coding is hyperbole.
narvoxx
Experienced Marbler
**
member is offline

[avatar]

not short enough for one line



Joined: Jul 2010
Gender: Male
Posts: 135
 Re: Coding questions, or answers rather
« Reply #31 on Jul 29, 2010, 3:35am »

Ah thanks! this may prove for another fun level :)
Link to Post - Back to Top  IP: Logged

Seizure22
Advanced Marbler
***
[ss:Default Skin]
member is offline



[msn]

Joined: Jun 2009
Gender: Male
Posts: 250
 Re: Coding questions, or answers rather
« Reply #32 on Jul 29, 2010, 10:17am »

loading interiors in the middle of the game would probably cause a bit of lag.

instead, load them all, keep the interiors you aren't using out of visible range, set them to move to visible range when necessary
Link to Post - Back to Top  IP: Logged
narvoxx
Experienced Marbler
**
member is offline

[avatar]

not short enough for one line



Joined: Jul 2010
Gender: Male
Posts: 135
 Re: Coding questions, or answers rather
« Reply #33 on Aug 30, 2010, 11:27am »

Damn, I don't fully understand how marble blast works, but I do some, now I know that the game can remove any powerups the player has, form what I found this is:
Code:
%this.player.setPowerUp(%this.checkPoint.powerUp,true);

Since this is called by GameConnection (from what I know, atleast) %this = GameConnection,
I've also found that GameConnection is the same as %user.client
But I need to abled to call setPowerUp without any of those variable, I need to know their full name, eg I need to be abled to $Game.client.player.setPowerUp(...) or something like that.
Anyone help me out?
Link to Post - Back to Top  IP: Logged

Seizure22
Advanced Marbler
***
[ss:Default Skin]
member is offline



[msn]

Joined: Jun 2009
Gender: Male
Posts: 250
 Re: Coding questions
« Reply #34 on Aug 30, 2010, 12:02pm »

localclientconnection.player.setpowerup();

gameconnections represent the clients connected to the server

since MP is horrible with MBG, you'll probably only be using localclientconnection, which is "your" gameconnection

response to below: you learn things as you go, and this is one of them
« Last Edit: Aug 30, 2010, 12:08pm by Seizure22 »Link to Post - Back to Top  IP: Logged
narvoxx
Experienced Marbler
**
member is offline

[avatar]

not short enough for one line



Joined: Jul 2010
Gender: Male
Posts: 135
 Re: Coding questions
« Reply #35 on Aug 30, 2010, 12:07pm »

awesome thanks!
where did you find that btw?
« Last Edit: Aug 30, 2010, 12:07pm by narvoxx »Link to Post - Back to Top  IP: Logged

« Page 2 of 2 Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Report Abuse | Mobile