Adventure Creator Q&A thread

Tips, techniques and tutorials about creation tools.

Re: Adventure Creator Q&A thread

Postby Mik » Tue, 16Dec27 01:50

Microsoft VS is free atm for individual developers...

https://www.visualstudio.com/vs/

and notepad++ is a great free editor with very useful features (syntax highlighting etc.) and you can add some plugins if needed.

https://notepad-plus-plus.org/
User avatar
Mik
great white shark
 
Posts: 52
Joined: Mon, 16Oct17 18:26
sex: Masculine

Re: Adventure Creator Q&A thread

Postby Super » Tue, 17Jan03 07:26

so I think I'm going to use this for my next game, which I'm planning to be a scifi undertaking... But hit a roadblock on some of my original cursory experiments. Namely, in how to check a variable in order to see if I go to one page or another.

Here is my current code:

Code: Select all
function kreubicLandingDecide()
{
   var par = ReadVar("partner");

   if (par == 1)
   {
      GoToPage("KreubicLandingLuna");
   }
   else
   {
      GoToPage("intro0");
   }

   return false;
}


Basically, I want to check to see which partner you are with in order to determine what page you go to. Which obviously will lead to a whole bunch of other complications later on but ya.

Now, what I usually do when I don't know what I'm doing is check your own games in order to see your similar problems. And this is what I discovered from DWE:

Code: Select all
function CheckTin()
{
    var tin = ReadVar("tin");

    if (tin == 0)
    {
        GotoPage("date34");
    }
    else
    {
        GotoPage("date38");
    }

    return false;
}


Now, forgive me if I'm wrong, but I've doubled tripled and quadrupled checked and those are the exact same functions with variables and stats replaced. But when I click on the page that is supposed to bring me to kreubicLandingDecide(), nothing happens.

And I have checked the AC2 program proper, and in DWE the page you use CheckTin() in the fcn box with nothing in the page, while in my project I have kreubicLandingDecide(), which I have checked and double checked and even used an online text difference tool to see was the exact same as the function in game.js. And yes, I do have the partner variable up and working, I originally had problems with setting the variable equal to 1 as a test but I fixed that (turns out I forgot the '. Woops.) but I honestly can't see what is the problem with this other fcn... Wanted to solve myself but hit a brick wall
Super
legend of the South Seas
 
Posts: 528
Joined: Wed, 11Aug24 20:59
sex: Masculine

Re: Adventure Creator Q&A thread

Postby kexter » Tue, 17Jan03 14:28

Super wrote:I've doubled tripled and quadrupled checked and those are the exact same functions with variables and stats replaced.
Nope, they are not the same functions. In your code, you write GoToPage(), while it should be GotoPage() - javascript is case sensitive.
@kextercius
User avatar
kexter
lagoon predator
 
Posts: 182
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator Q&A thread

Postby tlaero » Wed, 17Jan04 00:05

Yes, Kexter is right. Capitalization matters in JavaScript, so "GotoPage" and "GoToPage" are different things.

Here's how to figure something like this out. In Edge (I assume other browsers are similar) hit F12. That will bring up the debugging tools. You'll see Tabs across the top, including "DOM Explorer", "Console", and "Debugger." First click on the console. Reload your page in the main browser window (F5) and go through the steps you're trying to debug. The Console will often print an error that might explain your trouble. It would say something to the effect of "I don't know what GoToPage is" which would help you narrow in on the problem.

If the console doesn't work, go to the Debugger tab. You want to load your game.js page and put a breakpoint in the function you're trying to debug. Then reload the page and see what happens. That's high level, but play with it a bit. If it doesn't make any sense, let us know and we'll walk you through it more explicitly. Learning to use the debugger is probably one of the best time investments you can make, as it'll help you solve these sorts of problems really quickly.

Tlaero
User avatar
tlaero
Lady Tlaero, games and coding expert
 
Posts: 1540
Joined: Thu, 09Jun04 23:00
sex: Female

Previous

Return to The workshop of creators

Who is online

Users browsing this forum: No registered users and 1 guest

eXTReMe Tracker