Having a problem with start button
by Jared Kidd · in Game Design and Creative Issues · 09/28/2008 (5:34 pm) · 8 replies
I'm a noob to the torque game engine and game making and i need help. I am going through the getting started tutorial and when you get to the part about putting loadMyMission(); in the command on start button. i saved it and opened torque back up and clicked on the button and it doesn't load my mission. Please Help.
About the author
i'm 16 and i really enjoy making games and testing them. i started making games when i was 11 using game maker, but then i started using torque when i was about 13 and now i fell in love with game designing and look forward to making a career out of it.
#2
09/28/2008 (7:46 pm)
There isn't any console errors
#3
09/29/2008 (4:57 am)
Did you delete your .dso files to force a recompile?
#4
09/29/2008 (1:46 pm)
I tryed it, but it didn't work. when i click start it says loading mission and takes me to a loading screen, but it just sits there and won't load.
#5
09/29/2008 (2:27 pm)
Post the code so we can check it out
#6
new GuiChunkedBitmapCtrl(MainMenuGui) {
canSaveDynamicFields = "0";
Profile = "GuiContentProfile";
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "640 480";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "./gameonebg.jpg";
useVariable = "0";
tile = "0";
new GuiMLTextCtrl(RSSFeedMLText) {
canSaveDynamicFields = "0";
Profile = "GuiMLTextProfile";
HorizSizing = "width";
VertSizing = "top";
position = "4 390";
Extent = "326 89";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
};
new GuiButtonCtrl(Start) {
canSaveDynamicFields = "0";
Profile = "GuiButtonProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "285 304";
Extent = "112 25";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "LoadMyMission();";
hovertime = "1000";
text = "Start";
groupNum = "-1";
buttonType = "PushButton";
};
};
//--- OBJECT WRITE END ---
// RSS ticker configuration:
$RSSFeed::serverName = "feeds.feedburner.com";
$RSSFeed::serverPort = 80;
$RSSFeed::serverURL = "/garagegames/rss/product/tge/oobe";
$RSSFeed::userAgent = "Torque/1.5";
function RSSFeedObject::onConnected(%this)
{
echo("RSS Feed");
echo(" - Requesting RSS data at URL: " @ $RSSFeed::serverURL );
// Reset some useful state information.
$RSSFeed::lineCount = 0;
$RSSFeed::requestResults = "";
// Request our RSS.
%this.send("GET " @ $RSSFeed::serverURL @ " HTTP/1.0\nHost: " @ $RSSFeed::serverName @ "\nUser-Agent: " @ $RSSFeed::userAgent @ "\n\r\n\r\n");
}
function RSSFeedObject::onLine(%this, %line)
{
// Collate info.
$RSSFeed::lineCount++;
$RSSFeed::requestResults = $RSSFeed::requestResults @ %line;
}
function RSSFeedObject::getTagContents(%this, %string, %tag, %startChar)
{
// This function occasionally makes Torque hard crash. It doesn't
// seem to do it anymore but be careful!
// Ok, get thing between <%tag> and %tag> after char #
// %startChar in the passed string.
%startTag = "<" @ %tag @ ">";
%endTag = "" @ %tag @ ">";
%startTagOffset = strpos(%string, %startTag, %startChar);
// Compensate for presence of start tag.
%startOffset = %startTagOffset + strlen(%startTag);
// Ok, now look for end tag.
%endTagOffset = strpos(%string, %endTag, %startOffset - 1);
// If we didn't find it, bail.
if(%endTagOffset < 0)
return "";
// Evil hack - store last found item in a global.
%this.lastOffset = %endTagOffset;
// And get & return the substring between the tags.
%result = getSubStr(%string, %startOffset, %endTagOffset - %startOffset);
// Do a little mojo to deal with " and some other htmlentities.
%result = strreplace(%result, """, "\"");
%result = strreplace(%result, "&", "&");
return %result;
}
function RSSFeedObject::onDisconnect(%this)
{
// Ok, we have a full buffer now, hopefully. Let's process it.
echo(" - Got " @ $RSSFeed::lineCount @ " lines.");
// We want the feed title and the first three headlines + links.
// Feed title - get the first occurence in the string.
%title = %this.getTagContents($RSSFeed::requestResults, "title", 0);
%titleLink = %this.getTagContents($RSSFeed::requestResults, "link", 0);
echo(" - Feed title: '" @ %title @ "'");
echo(" - Feed link: '" @ %titleLink @ "'");
// Ok, get the first three headlines, if any...
for(%i = 0; %i<3; %i++)
{
%headline[%i] = %this.getTagContents($RSSFeed::requestResults, "title", %this.lastOffset);
%headlineLink[%i] = %this.getTagContents($RSSFeed::requestResults, "link", %this.lastOffset);
// Skip the content - it's not going to do anything but confuse us.
%garbage = %this.getTagContents($RSSFeed::requestResults, "content:encoded", %this.lastOffset);
// And debug spam...
echo(" - Headline #" @ %i @ " : '" @ %headline[%i] @ "'");
echo(" - Headline Link #" @ %i @ " : '" @ %headlineLink[%i] @ "'");
}
// Generate contents for our ML control.
RSSFeedMLText.setText("" @ %title @ "\n");
for(%i=0; %i<3; %i++)
RSSFeedMLText.addText("" @ %headline[%i] @ "\n", false);
RSSFeedMLText.addText("" @ "[ Read more... ]" @ "", true);
}
function kickOffRSS()
{
new TCPObject(RSSFeedObject);
RSSFeedObject.connect($RSSFeed::serverName @ ":" @ $RSSFeed::serverPort);
}
function MainMenuGui::onWake(%this)
{
// Kick off an update on next tick.
if(!$pref::RSS::disableFeedCheck)
schedule(50, 0, kickOffRSS);
}
thats the mainmenuGui
09/29/2008 (2:42 pm)
//--- OBJECT WRITE BEGIN ---new GuiChunkedBitmapCtrl(MainMenuGui) {
canSaveDynamicFields = "0";
Profile = "GuiContentProfile";
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "640 480";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "./gameonebg.jpg";
useVariable = "0";
tile = "0";
new GuiMLTextCtrl(RSSFeedMLText) {
canSaveDynamicFields = "0";
Profile = "GuiMLTextProfile";
HorizSizing = "width";
VertSizing = "top";
position = "4 390";
Extent = "326 89";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
};
new GuiButtonCtrl(Start) {
canSaveDynamicFields = "0";
Profile = "GuiButtonProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "285 304";
Extent = "112 25";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "LoadMyMission();";
hovertime = "1000";
text = "Start";
groupNum = "-1";
buttonType = "PushButton";
};
};
//--- OBJECT WRITE END ---
// RSS ticker configuration:
$RSSFeed::serverName = "feeds.feedburner.com";
$RSSFeed::serverPort = 80;
$RSSFeed::serverURL = "/garagegames/rss/product/tge/oobe";
$RSSFeed::userAgent = "Torque/1.5";
function RSSFeedObject::onConnected(%this)
{
echo("RSS Feed");
echo(" - Requesting RSS data at URL: " @ $RSSFeed::serverURL );
// Reset some useful state information.
$RSSFeed::lineCount = 0;
$RSSFeed::requestResults = "";
// Request our RSS.
%this.send("GET " @ $RSSFeed::serverURL @ " HTTP/1.0\nHost: " @ $RSSFeed::serverName @ "\nUser-Agent: " @ $RSSFeed::userAgent @ "\n\r\n\r\n");
}
function RSSFeedObject::onLine(%this, %line)
{
// Collate info.
$RSSFeed::lineCount++;
$RSSFeed::requestResults = $RSSFeed::requestResults @ %line;
}
function RSSFeedObject::getTagContents(%this, %string, %tag, %startChar)
{
// This function occasionally makes Torque hard crash. It doesn't
// seem to do it anymore but be careful!
// Ok, get thing between <%tag> and %tag> after char #
// %startChar in the passed string.
%startTag = "<" @ %tag @ ">";
%endTag = "" @ %tag @ ">";
%startTagOffset = strpos(%string, %startTag, %startChar);
// Compensate for presence of start tag.
%startOffset = %startTagOffset + strlen(%startTag);
// Ok, now look for end tag.
%endTagOffset = strpos(%string, %endTag, %startOffset - 1);
// If we didn't find it, bail.
if(%endTagOffset < 0)
return "";
// Evil hack - store last found item in a global.
%this.lastOffset = %endTagOffset;
// And get & return the substring between the tags.
%result = getSubStr(%string, %startOffset, %endTagOffset - %startOffset);
// Do a little mojo to deal with " and some other htmlentities.
%result = strreplace(%result, """, "\"");
%result = strreplace(%result, "&", "&");
return %result;
}
function RSSFeedObject::onDisconnect(%this)
{
// Ok, we have a full buffer now, hopefully. Let's process it.
echo(" - Got " @ $RSSFeed::lineCount @ " lines.");
// We want the feed title and the first three headlines + links.
// Feed title - get the first
%title = %this.getTagContents($RSSFeed::requestResults, "title", 0);
%titleLink = %this.getTagContents($RSSFeed::requestResults, "link", 0);
echo(" - Feed title: '" @ %title @ "'");
echo(" - Feed link: '" @ %titleLink @ "'");
// Ok, get the first three headlines, if any...
for(%i = 0; %i<3; %i++)
{
%headline[%i] = %this.getTagContents($RSSFeed::requestResults, "title", %this.lastOffset);
%headlineLink[%i] = %this.getTagContents($RSSFeed::requestResults, "link", %this.lastOffset);
// Skip the content - it's not going to do anything but confuse us.
%garbage = %this.getTagContents($RSSFeed::requestResults, "content:encoded", %this.lastOffset);
// And debug spam...
echo(" - Headline #" @ %i @ " : '" @ %headline[%i] @ "'");
echo(" - Headline Link #" @ %i @ " : '" @ %headlineLink[%i] @ "'");
}
// Generate contents for our ML control.
RSSFeedMLText.setText("
for(%i=0; %i<3; %i++)
RSSFeedMLText.addText("
RSSFeedMLText.addText("
}
function kickOffRSS()
{
new TCPObject(RSSFeedObject);
RSSFeedObject.connect($RSSFeed::serverName @ ":" @ $RSSFeed::serverPort);
}
function MainMenuGui::onWake(%this)
{
// Kick off an update on next tick.
if(!$pref::RSS::disableFeedCheck)
schedule(50, 0, kickOffRSS);
}
thats the mainmenuGui
#7
09/29/2008 (3:25 pm)
Make sure that you have function LoadMyMission(), and make sure that it calls the right mission file. There was a problem with the Getting Started tutorial having a misspelling or something like that in it at that point.
#8
09/29/2008 (5:43 pm)
So what do i need to put
Employee Michael Perry
ZombieShortbus