file Gyrocopter that lasts longer

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
31 Oct 2012 01:55 #1
How do I make a Gyrocopter in a level last longer than 5 seconds? Is there some sort of code I can add?

Thanks.

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.

  • Beack
  • Beack's Avatar
  • Offline
  • Professional Marbler
  • Professional Marbler
  • Beack ewe
  • Posts: 477
  • Thank you received: 0
31 Oct 2012 02:13 #2
powerups.cs located in marble/server/scripts/powerups.cs


Under the Helicoter Datablock

Quote://

datablock AudioProfile(doHelicopterSfx)
{
filename = ~/data/sound/doHelicopter.wav;
description = AudioDefault3d;
preload = true;
};

datablock AudioProfile(PuGyrocopterVoiceSfx)
{
filename = ~/data/sound/puGyrocopterVoice.wav;
description = AudioDefault3d;
preload = true;
};

datablock ItemData(HelicopterItem)
{
// Mission editor category
category = Powerups;
className = PowerUp;
powerUpId = 5; (try changing that to other value than 1)


hope this helps and don't forget delete the .dso

EDIT:

Ni idea, it crashed the game runtime error

The weirdest signature that I ever requested

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

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
31 Oct 2012 02:29 #3
Thanks for the help, but that looks like it makes all gyrocopters in the game last longer/shorter. I want to make a single gyrocopter in a level work differently.

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.

  • Beack
  • Beack's Avatar
  • Offline
  • Professional Marbler
  • Professional Marbler
  • Beack ewe
  • Posts: 477
  • Thank you received: 0
31 Oct 2012 02:45 #4
That's a bit different (and too advanced to me ), maybe it's a dynamic such delay, powerUpTime tht you can add manually in the level editor.

Ni idea to be honest :/

The weirdest signature that I ever requested

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

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
31 Oct 2012 03:19 #5
First, you need to install higuy's powerup hack which is in the mbdk. Then, you need to make a datablock of the powerup like Beack said to do by changing the powerupID value to a higher number. This will only work with the hack. Then, you would have to basically write code that calls the engine powerup through torqueScript and use something called a schedule to delay it for how long you want:

schedule(%time,0,doThis);

%time is the time in milliseconds, doThis is a method that is called upon during a delay time. This will take some thinking, but this is the ROUGH idea on how to tackle this.

EDIT:

When will you need the code by? This will be very tricky and I dont know if I would have time to code it, we'll see. Just let me know and hopefully I can get around to it eventually.

If you want to make it effect all gyrocopters temporarilly, just do this:

defaultmarble.poweruptime[5] = 999999999999999999;

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.

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
31 Oct 2012 03:42 #6
Untested, but probably working
Code:
datablock ItemData (LongerGyro : HelicopterItem) {
longer = true; //Don't modify
time = <insert time here>; //Modify
};

function Marble::setPowerUp(%this, %item, %reset) {
//Original code
PlayGui.setPowerUp(%item.shapeFile);
%this.powerUpData = %item;
%this.setPowerUpId(%item.powerUpId,%reset);
//Modifications

//If the datablock tells us it's longer
if (%item.getDatablock().longer) {
//If we have no value stored, store one
if (%this.getDatablock().origPUT[%item.powerUpId] $= )
%this.getDatablock().origPUT[%item.powerUpId] = %this.getDatablock().powerUpTime[%item.powerUpId];
//Modify powerUpTime[]
%this.getDatablock().powerUpTime[%item.powerUpId] = %item.time;
} else {
//Reset it
//If we need to reset
if (%this.getDatablock().origPUT[%item.powerUpId] !$= ) {
//Replace the original value
%this.getDatablock().powerUpTime[%item.powerUpId] = %this.getDatablock().origPUT[%item.powerUpId];
//Clear the stored value
%this.getDatablock().origPUT[%item.powerUpId] = ;
}
}
}

May not work in all cases (such as switching marble datablocks)

Maybe?

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

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

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
04 Nov 2012 02:13 #7
Quote:First, you need to install higuy's powerup hack which is in the mbdk.

We searched around and couldn't find the hack. Can you point us to it? Once we get it, are there instructions on how to install it?



Quote:When will you need the code by? This will be very tricky and I dont know if I would have time to code it, we'll see. Just let me know and hopefully I can get around to it eventually.

If you want to make it effect all gyrocopters temporarilly, just do this:

defaultmarble.poweruptime[5] = 999999999999999999;

Buzz will need it by the time he gets finished with his level Freedom. So not very soon at all.



Quote:Untested, but probably working
Code:

datablock ItemData (LongerGyro : HelicopterItem) {
longer = true; //Don't modify
time = <insert time here>; //Modify
};

function Marble::setPowerUp(%this, %item) {
//Original code
PlayGui.setPowerUp(%item.shapeFile);
%this.powerUpData = %item;
%this.setPowerUpId(%item.powerUpId,%reset);
//Modifications

//If the datablock tells us it's longer
if (%item.getDatablock().longer) {
//If we have no value stored, store one
if (%this.getDatablock().origPUT[%item.powerUpId] $= )
%this.getDatablock().origPUT[%item.powerUpId] = %this.getDatablock().powerUpTime[%item.powerUpId];
//Modify powerUpTime[]
%this.getDatablock().powerUpTime[%item.powerUpId] = %item.time;
} else {
//Reset it
//If we need to reset
if (%this.getDatablock().origPUT[%item.powerUpId] !$= ) {
//Replace the original value
%this.getDatablock().powerUpTime[%item.powerUpId] = %this.getDatablock().origPUT[%item.powerUpId];
//Clear the stored value
%this.getDatablock().origPUT[%item.powerUpId] = ;
}
}
}

May not work in all cases (such as switching marble datablocks)

Maybe?

Thanks, Hi Guy! Do I add this code to the .mis file ?

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
04 Nov 2012 02:25 #8
@ajdallas ignore my post about the hack, hence HiGuy just made you code a few days ago and the fact that he used a different approach. Yes, try adding it to the .mis file, but put it DIRECTLY at the top hence there is a datablock that needs loaded. If you put that at the end it won't work.

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.

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
04 Nov 2012 03:00 #9
We added the code block to an .mis file of a different level (Beginner level 9 of MBG) and changed the time to 20000 (20 seconds). Then, Buzz saw the new LongGyro powerup in the editor and he tried that, which added the powerup. Still no difference in the time. Is there anything we're doing wrong?

Thanks again for your help.

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
04 Nov 2012 03:04 #10
By adding the thing to make it 20 seconds do you mean you added my code? Cause if you did that is what is messing it up. Like said, ignore that code i posted, it was a temporary thing.

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.

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
04 Nov 2012 03:29 #11
No, it wasn't yours. It was Hi Guy's code.

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
05 Nov 2012 04:02 #12
HiGuy forgot one thing, replace this code:

function Marble::setPowerUp(%this, %item) {
//Original code
PlayGui.setPowerUp(%item.shapeFile);
%this.powerUpData = %item;
%this.setPowerUpId(%item.powerUpId,%reset);
//Modifications


with this

function Marble::setPowerUp(%this, %item, %reset) { // %reset was forgotten
//Original code
PlayGui.setPowerUp(%item.shapeFile);
%this.powerUpData = %item;
%this.setPowerUpId(%item.powerUpId,%reset);
//Modifications

Post again and tell me if that makes a difference.

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.

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
05 Nov 2012 04:14 #13
Whooooooooooooooooooops... Had an extra .getDataBlock() in the code (told you I didn't test it ), also had the problem Jeff noted.
Modified and tested it, and now it's working.

Extra note:
If you want to save the mission under a new name / path, you'll have to re-add the code in at the top of the mission.

Updated code:
Code:datablock ItemData (LongerGyro : HelicopterItem) {
longer = true; //Don't modify
time = <insert time here>; //Modify
pickUpName = a Long Helicopter; //You can even edit this too :)
};

function Marble::setPowerUp(%this, %item, %reset) {
//Original code
PlayGui.setPowerUp(%item.shapeFile);
%this.powerUpData = %item;
%this.setPowerUpId(%item.powerUpId,%reset);
//Modifications

//If the datablock tells us it's longer
if (%item.longer) {
//If we have no value stored, store one
if (%this.getDatablock().origPUT[%item.powerUpId] $= )
%this.getDatablock().origPUT[%item.powerUpId] = %this.getDatablock().powerUpTime[%item.powerUpId];
//Modify powerUpTime[]
%this.getDatablock().powerUpTime[%item.powerUpId] = %item.time;
} else {
//Reset it
//If we need to reset
if (%this.getDatablock().origPUT[%item.powerUpId] !$= ) {
//Replace the original value
%this.getDatablock().powerUpTime[%item.powerUpId] = %this.getDatablock().origPUT[%item.powerUpId];
//Clear the stored value
%this.getDatablock().origPUT[%item.powerUpId] = ;
}
}
}

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

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

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
05 Nov 2012 04:54 #14
Thank you so much! It's working now. You guys are great.

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.

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
05 Nov 2012 05:56 #15
No problem, happy to help

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

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

  • Posts: 14
  • Thank you received: 0
07 Nov 2012 21:39 #16
thanks Hi Guy I've Want this too

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

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
28 Nov 2012 02:54 #17
Can a similar code be applied for other powerups such as Shock Absorbers and Super Bounces (changing the amount of time the PU effects the marble)? If so, what changes should I make?

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
28 Nov 2012 03:09 #18
looks like to me you just have to make more of these (example):

datablock ItemData (LongerShock : ShockAbsorberItem) {
longer = true; //Don't modify
time = <insert time here>; //Modify
pickUpName = a Long Shock Absorber; //You can even edit this too
};


however, do not use this for superspeed and superjump, as i believe those should not be touched because iirc you can't control the effect, just the particle time.

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.

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
28 Nov 2012 04:30 #19
Thanks. Buzzmusic tried your code and this version he changed it to:

Code:datablock ItemData (LongerBounce : SuperBounceItem) {
longer = true; //Don't modify
time = 2; //Modify
pickUpName = a Super Bounce; //You can even edit this too
};

He used the new powerups and the amount of time they affected the marble didn't change. They still worked for 5 seconds. Any other ideas?

Thanks again.

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
02 Dec 2012 19:18 #20
I will get back to you on this [sorry, I kind of forgot about this thead :S]. I am not sure what the problem is to be honest. Just hang in there!

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.

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
02 Dec 2012 20:17 #21
Thanks Jeff, glad you're still trying to fix the code. Buzz and I appreciate it.

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.

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
25 Dec 2012 04:51 #22
Hey, Jeff. I don't mean to rush you, but I kind of need this Shorter Marble Recoil code soon since I'll be going on a 5 day campout on the 27th and I'd like to get my level done before that if possible. It's been a while since you last replied, and I understand if you're busy or if you forgot about this, but this is just a reminder. Hope you'll have the time. Thanks! Happy Holidays. - Buzzmusic100

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
25 Dec 2012 05:08 #23
Found your problem, you have it set for 2 milliseconds, change it to 2000 (2 seconds) and it will work fine. Tested it.

(I'm so sorry I forgot about this. Merry Christmas!)

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.

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
25 Dec 2012 21:25 #24
Buzzmusic100:


Thanks Jeff. But it still didn't work. It lasted for 5 seconds (which is the default time) and I wrote 2000 (2 seconds) both in MBG and MBP. Here's the code I used:

datablock ItemData (LongerBounce : SuperBounceItem) {
longer = true; //Don't modify
time = 2000; //Modify
pickUpName = a Super Bounce; //You can even edit this too
};

I added the LongerBounce powerup in the level editor and in the code so I'm pretty sure I have the right powerup. I also tried giving it a time greater than 5 seconds and that didn't work either. The weird thing is, you said you tested it. Maybe you could send me the .mis file you used for testing and I can see what the difference is?

Thanks again.

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
25 Dec 2012 21:30 #25
I don't have the .mis anymore, I deleted it. Make sure you are placing all the code in the same file. Don't split up the code, and place it at the top of it. Are you doing that? Reply first, then if all else fails, maybe you could send me your .mis so I can take a look at it.

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.

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
26 Dec 2012 00:04 #26
Yes, I put the code at the beginning of the file as you suggested. One of the .mis files I have with the longer SB is attached in this post. Hope you can take a look at it. - Buzzmusic100

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
26 Dec 2012 00:24 #27
Yup, found your problem. You need to copy HiGuy's code into the .mis file or else it has no effect.

As HiGuy posted:

Code:function Marble::setPowerUp(%this, %item, %reset) {
//Original code
PlayGui.setPowerUp(%item.shapeFile);
%this.powerUpData = %item;
%this.setPowerUpId(%item.powerUpId,%reset);
//Modifications

//If the datablock tells us it's longer
if (%item.longer) {
//If we have no value stored, store one
if (%this.getDatablock().origPUT[%item.powerUpId] $= )
%this.getDatablock().origPUT[%item.powerUpId] = %this.getDatablock().powerUpTime[%item.powerUpId];
//Modify powerUpTime[]
%this.getDatablock().powerUpTime[%item.powerUpId] = %item.time;
} else {
//Reset it
//If we need to reset
if (%this.getDatablock().origPUT[%item.powerUpId] !$= ) {
//Replace the original value
%this.getDatablock().powerUpTime[%item.powerUpId] = %this.getDatablock().origPUT[%item.powerUpId];
//Clear the stored value
%this.getDatablock().origPUT[%item.powerUpId] = ;
}
}
}

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.

  • Buzzmusic
  • Buzzmusic's Avatar Topic Author
  • Offline
  • Developer
  • Developer
  • I make levels and songs.
  • Posts: 678
  • Thank you received: 145
26 Dec 2012 03:09 #28
It works! Thanks for all your help, Jeff. Buzz and I really appreciate it.

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.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
26 Dec 2012 03:32 #29
You're welcome. Hey it's Christmas time, what do you expect.

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.

Moderators: Doomblah
Time to create page: 2.610 seconds