Game Development Community

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.


#1
09/28/2008 (6:05 pm)
Have you checked your console for any warning or errors?
#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
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 after char #
// %startChar in the passed string.

%startTag = "<" @ %tag @ ">";
%endTag = "";

%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.<br /> %title = %this.getTagContents($RSSFeed::requestResults, "title", 0);<br /> %titleLink = %this.getTagContents($RSSFeed::requestResults, "link", 0);<br /> <br /> echo(" - Feed title: '" @ %title @ "'");<br /> echo(" - Feed link: '" @ %titleLink @ "'");<br /> <br /> // Ok, get the first three headlines, if any...<br /> for(%i = 0; %i<3; %i++)<br /> {<br /> %headline[%i] = %this.getTagContents($RSSFeed::requestResults, "title", %this.lastOffset);<br /> %headlineLink[%i] = %this.getTagContents($RSSFeed::requestResults, "link", %this.lastOffset);<br /> <br /> // Skip the content - it's not going to do anything but confuse us.<br /> %garbage = %this.getTagContents($RSSFeed::requestResults, "content:encoded", %this.lastOffset);<br /> <br /> // And debug spam...<br /> echo(" - Headline #" @ %i @ " : '" @ %headline[%i] @ "'");<br /> echo(" - Headline Link #" @ %i @ " : '" @ %headlineLink[%i] @ "'");<br /> }<br /> <br /> // Generate contents for our ML control.<br /> RSSFeedMLText.setText("<lmargin%:2><font:Arial Bold:20>" @ %title @ "<font:Arial:14>\n");<br /> for(%i=0; %i<3; %i++)<br /> RSSFeedMLText.addText("<a:" @ getSubstr(%headlineLink[%i], 7, 1000) @ ">" @ %headline[%i] @ "</a>\n", false);<br /> RSSFeedMLText.addText("<just:right><a:" @ getSubstr(%titleLink, 7, 1000) @ ">" @ "[ Read more... ]" @ "</a>", true);<br /> <br /> }<br /> <br /> function kickOffRSS()<br /> {<br /> new TCPObject(RSSFeedObject);<br /> RSSFeedObject.connect($RSSFeed::serverName @ ":" @ $RSSFeed::serverPort);<br /> }<br /> <br /> function MainMenuGui::onWake(%this)<br /> {<br /> // Kick off an update on next tick.<br /> if(!$pref::RSS::disableFeedCheck)<br /> schedule(50, 0, kickOffRSS);<br /> }<br /> <br /> <br /> thats the mainmenuGui </div> <div class="clear"></div> </div> <div class="comment"> <div class="author"> <img src="http://static.garagegames.com/static/upload/users/106163.jpg?v=1399054836" class="profilepic" /> <br /> <a rel="Michael Hall" class="associate button profile-link ui-state-default ui-corner-all" href="/account/miniprofile/accountID/106163" onclick="return false;"> <span style="float: left; margin-right: 2px;" class="torque-icon-associate">Associate</span> Michael Hall<br /> <span class="studio-name">Distracted...</span> </a> </div> <div class="body"> <a class="button ui-state-default ui-corner-all" style="padding: 2px; font-size: 10px; margin: 0 2px; height: 16px; text-align: center; float: right;" href="/community/forums/viewthread/79541/1#comment-557871" name="comment-557871">#7</a> <div style="border-bottom: 1px solid #DDD; margin-top: -5px; padding-bottom: 1px; margin-bottom: 5px;"> <em style="padding-top: 2px; float: left;">09/29/2008 (3:25 pm)</em> <div class="clear"></div> </div> <div class="clear"></div> 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. </div> <div class="clear"></div> </div> <div class="comment"> <div class="author"> <img src="http://static.garagegames.com/static/upload/users/111314.png?v=1284461424" class="profilepic" /> <br /> <a rel="Jared Kidd" class="member button profile-link ui-state-default ui-corner-all" href="/account/miniprofile/accountID/111314" onclick="return false;"> <span style="margin-right: 5px; float: left" class="torque-icon">Torque Owner</span> Jared Kidd </a> </div> <div class="body"> <a class="button ui-state-default ui-corner-all" style="padding: 2px; font-size: 10px; margin: 0 2px; height: 16px; text-align: center; float: right;" href="/community/forums/viewthread/79541/1#comment-557909" name="comment-557909">#8</a> <div style="border-bottom: 1px solid #DDD; margin-top: -5px; padding-bottom: 1px; margin-bottom: 5px;"> <em style="padding-top: 2px; float: left;">09/29/2008 (5:43 pm)</em> <div class="clear"></div> </div> <div class="clear"></div> So what do i need to put </div> <div class="clear"></div> </div> <div class="clear"></div> </div> <br /> <div class="clear"></div> <div id="commentForm" style="text-align: center; margin-top: 20px;"> <a name="comment_form" id="comment_form"></a> <a href="/account/login">Login to reply to this thread</a> </div> </div> <div class="clear"></div> </div> <div class="section-footer"></div> </div> <div id="actions-list-container"> <span id="actions-list"> <a href="/community/blogs/add">Post a blog</a><br /> <a href="/community/resources/add">Add a resource</a><br /> <a href="/community/forums/48/newthread">Start a Thread</a><br /> </span> </div> <div id="filter-action-container" style="display: none;"> <span id="actions-list"> <input type="checkbox" class="relevantProductFilter" value="0" /> All Products<br /> <input type="checkbox" class="relevantProductFilter" value="other" /> 3rd Party Addons<br /> <input type="checkbox" class="relevantProductFilter" value="itorque2d" /> iTorque 2D<br /> <input type="checkbox" class="relevantProductFilter" value="itorque3d" /> iTorque 3D<br /> <input type="checkbox" class="relevantProductFilter" value="tge" /> TGE<br /> <input type="checkbox" class="relevantProductFilter" value="tgea" /> TGEA<br /> <input type="checkbox" class="relevantProductFilter" value="torque-2d" /> Torque 2D<br /> <input type="checkbox" class="relevantProductFilter" value="torque3dpro" /> Torque 3D Pro<br /> <input type="checkbox" class="relevantProductFilter" value="torquex" /> Torque X<br /> </span> </div> <!-- /content --> <div class="clear"></div> </div> </div> <!-- /container --> <div class="clear"></div> <br /> <div id="footer-links"> <a href="/">Home</a> <a href="/products">Products</a> <a href="/community">Community</a> <a href="/support">Support</a> <a href="/company">Company</a> </div> <div id="footer"> <p>Copyright © GarageGames.com 2000 - 2022 All Rights Reserved. <a href="/company/tos">Terms of Service</a> - <a href="/company/privacy">Privacy Policy</a></p> </div> <script type="text/javascript"> var STATIC_HOST = 'http://static.garagegames.com'; </script> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> </div> <div id="supersecrethiddendiv"></div> <!-- Quantcast Tag --> <script type="text/javascript"> var _qevents = _qevents || []; (function() { var elem = document.createElement('script'); elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js"; elem.async = true; elem.type = "text/javascript"; var scpt = document.getElementsByTagName('script')[0]; scpt.parentNode.insertBefore(elem, scpt); })(); _qevents.push({ qacct:"p-78WdNPl8jvIsA" }); </script> <noscript> <div style="display:none;"> <img src="//pixel.quantserve.com/pixel/p-78WdNPl8jvIsA.gif" border="0" height="1" width="1" alt="Quantcast"/> </div> </noscript> <!-- End Quantcast tag --> <!-- Twitter JS --> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> </body> </html>