Jump to content
  • 0
Sign in to follow this  
drakthuro

718 matrix Starter.java wont handle more stages.

Question

Hi there i had a question about the starter.java from the matrix source. Everytime if i make the dialogue handle more stages then it will just not happen...

Like the regular matrix start lets you choose a combat class **sort of**
The dialogue gives you a optionhandling for 3 classes. knight, mage,rogue

Once you choose one of these classes then it will unlock your character and close all the interfaces handled. But now my problem.

When i made the dialogue longer so after you choose your combat class, you can choose something else. So as example i made option 1 send you to another stage, so to even more options. But this won't happen.

If i add more stages to the dialogue. then it will get stuck on the option that you choose.

as example this code [QUOTE] public void run(int interfaceId, int componentId) {
if (stage == 1) {
if (componentId == OPTION_1) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(1087, 1);
player.getInventory().addItem(1103, 1);
player.getInventory().addItem(1277, 1);
player.getInventory().addItem(1173, 1);
player.getInventory().addItem(1061, 1);[/QUOTE]

But it will not send me to stage 30 since it will get stuck on the option. *yes i made a stage 30 with more options* and i made stage 30 unlock your character and close all interfaces. but still my problem persists.. Any solutions? thank you for your time,.

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Did you add the dialogue into DialogueHandler.java??
It should look like these:
[CODE]
Class<Dialogue> value43 = (Class<Dialogue>) Class
.forName(BossTeleports.class.getCanonicalName());
handledDialogues.put("BossTeleports", value43);
Class<Dialogue> value44 = (Class<Dialogue>) Class
.forName(Minigames.class.getCanonicalName());
handledDialogues.put("Minigames", value44);
[/CODE]
Those are the ones for my boss tele button dialogue and my minigame button dialogue.

Share this post


Link to post
Share on other sites
  • 0
god damn matrix it is everywhere -.-

Share this post


Link to post
Share on other sites
  • 0
iiaceHD that irrelevant to the thread. and yes thorin it is added to the dialoguehandler. The dialogue is handled fine, when you make a new character you get a dialogue to choose a class, everything works. If i make option 1 unlock your character and close the interface then it works flawles, but when i make option 1 send you to another stage then it gets stuck.?

Share this post


Link to post
Share on other sites
  • 0
Maybe the stage number is too high?? Else wise, i see no reason why it wouldnt work, unless you messed up the next stage...

Share this post


Link to post
Share on other sites
  • 0
Nope, i did not set it up, Alright. Here is the full dialogue. don't mind the names it was just for testing wich did not work.

[QUOTE]package com.rs.game.player.dialogues;

import com.rs.game.Graphics;
import com.rs.game.WorldTile;
import com.rs.game.player.Skills;

// Referenced classes of package com.rs.game.player.dialogues:
// Dialogue

public class Starter extends Dialogue {

public Starter() {
}

@Override
public void start() {
stage = 1;
sendOptionsDialogue("Choose your hero class",
"I want to be a knight.",
"I want to be a sinister.",
"I want to be a elementist.",
"I want to be a Druid.",
"More classes.");

}

@Override
public void run(int interfaceId, int componentId) {
if (stage == 1) {
if (componentId == OPTION_1) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(1087, 1);
player.getInventory().addItem(1103, 1);
player.getInventory().addItem(1277, 1);
player.getInventory().addItem(1173, 1);
player.getInventory().addItem(1061, 1);
} else if (componentId == OPTION_2) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(1059, 1);
player.getInventory().addItem(1061, 1);
player.getInventory().addItem(1063, 1);
player.getInventory().addItem(1095, 1);
player.getInventory().addItem(1129, 1);
player.getInventory().addItem(839, 1);
player.getInventory().addItem(882, 50);
player.sm("Your current combat class is: Sinister.");
player.getInventory().refresh();
} else if (componentId == OPTION_3) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(556, 30);
player.getInventory().addItem(558, 30);
player.getInventory().addItem(577, 1);
player.getInventory().addItem(579, 1);
player.getInventory().addItem(1011, 1);
player.getInventory().addItem(1061, 1);
player.getInventory().refresh();
player.sm("Your current combat class is: Elementist.");
} else if (componentId == OPTION_4) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(556, 30);
player.getInventory().addItem(558, 30);
player.getInventory().addItem(577, 1);
player.getInventory().addItem(579, 1);
player.getInventory().addItem(1011, 1);
player.getInventory().addItem(1061, 1);
player.getInventory().refresh();
player.sm("Your current combat class is: Elementist.");
} else if (componentId == OPTION_5) {
stage = 20;
}

} else if (stage == 20) {
sendOptionsDialogue("Choose your hero class",
"I want to be a Hunter.",
"I want to be a Cook.",
"I want to be a Squire.",
"I want to be a Summoner",
"Previous Classes");
} else if (stage == 10) {
if (componentId == OPTION_1) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(1087, 1);
player.getInventory().addItem(1103, 1);
player.getInventory().addItem(1277, 1);
player.getInventory().addItem(1173, 1);
player.getInventory().addItem(1061, 1);
player.getInventory().refresh();
player.sm("Your current combat class is: Hunter.");
} else if (componentId == OPTION_2) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(1059, 1);
player.getInventory().addItem(1061, 1);
player.getInventory().addItem(1063, 1);
player.getInventory().addItem(1095, 1);
player.getInventory().addItem(1129, 1);
player.getInventory().addItem(839, 1);
player.getInventory().addItem(882, 50);
player.sm("Your current combat class is: Cook.");
player.getInventory().refresh();
} else if (componentId == OPTION_3) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(556, 30);
player.getInventory().addItem(558, 30);
player.getInventory().addItem(577, 1);
player.getInventory().addItem(579, 1);
player.getInventory().addItem(1011, 1);
player.getInventory().addItem(1061, 1);
player.getInventory().refresh();
player.sm("Your current combat class is: Squire.");
} else if (componentId == OPTION_4) {
stage = 30;
player.getInventory().addItem(995, 10000);
player.getInventory().addItem(556, 30);
player.getInventory().addItem(558, 30);
player.getInventory().addItem(577, 1);
player.getInventory().addItem(579, 1);
player.getInventory().addItem(1011, 1);
player.getInventory().addItem(1061, 1);
player.getInventory().refresh();
player.sm("Your current combat class is: Summoner.");
} else if (componentId == OPTION_5) {
stage = 1;

} else if (stage == 30) {
sendOptionsDialogue("Choose your gender",
"I want to be a male",
"I want to be a female");
if (componentId == OPTION_1) {
player.sm("Your current gender is male.");
player.getInterfaceManager().closeChatBoxInterface();
player.unlock();
} else if (componentId == OPTION_2) {
player.sm("Your current gender is female");
player.getInterfaceManager().closeChatBoxInterface();
player.unlock();
}
}
}
}

@Override
public void finish() {
}

}
[/QUOTE]

Share this post


Link to post
Share on other sites
Sign in to follow this  

×