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: 86
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: 545
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
Moderator
 
Posts: 214
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: 1829
Joined: Thu, 09Jun04 23:00
sex: Female

Re: Adventure Creator Q&A thread

Postby Mortze » Wed, 17Jan25 19:29

I have a question and I'm sorry if the answer has already been given somewhere.

If I wanted to start making a game and adopting the "release update, or release episode monthly" approach, would AC be a good engine, in terms of saved progress as I release each new content?
Let's say I release game 0.01 and sometime after I release game 0.02. Will the players be able to use their progress in game 0.01 when starting playing game 0.02?
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator Q&A thread

Postby tlaero » Thu, 17Jan26 04:44

Yeah, no problem at all. You just use the same GameDelim for all of the releases and your saves will automatically transfer from one to the next.

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

Re: Adventure Creator Q&A thread

Postby Mortze » Thu, 17Jan26 13:34

tlaero wrote:Yeah, no problem at all. You just use the same GameDelim for all of the releases and your saves will automatically transfer from one to the next.


Thnak you. That is important.
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator Q&A thread

Postby Hindemith » Fri, 17Dec15 19:50

Hey,

So I searched on the forums, but couldn't find anyone asking this: How do I get the player to write a name for his/her character and then store it and use it?

Cheers,
Hindemith
Hindemith
great white shark
 
Posts: 31
Joined: Tue, 16Jul19 17:59
sex: Masculine

Re: Adventure Creator Q&A thread

Postby tlaero » Fri, 17Dec15 21:05

Hi Hindemith. In AC2, you can call any javascript function you'd like on you pages by wrapping it in [[]]. For instance, if you have a function called "GetName()" you can put something like this in your toptext.
Please enter your name: [[GetName()]]

Here's what you need to add to your game.js to allow the user to enter his name.

First add a "name" variable to gameVars. Something like this:
Code: Select all
var gameVars = ["events0", "happy", "angry", "name", gInStats, gCssSize];


Then add these three functions later in the file. Make sure you change the "name1" page in SetName() to the page you want to go to when the user sets his name.
Code: Select all
// Functions for getting, setting, and displaying the player's name.
// In your toptext write this [[GetName()]]
function GetName()
{
    var str = "<input type='text' id='name' /><button onclick='SetName()'>Set</button>";
    return str;
}


function SetName()
{
    var name = document.getElementById("name").value;
    if (name != "")
    {
        SetStorageString("name", name);
        // This is the page to jump to when the user clicks the "Set" button
        // Change "name1" to the page you want to use.
        GotoPage("name1");
    }
}

// This function lets you output the name the user selected.  Use it like this [[Name()]]
// For instance, you might have text that says:
// "Hello [[Name()]]. It's nice to meet you."
function Name()
{
    var name = ReadStorageString("name");
    return name;
}


Finally, when you want to use the name the user typed, write [[Name()]] in the text.

Let me know if you have any trouble with that.

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

Re: Adventure Creator Q&A thread

Postby Hindemith » Thu, 17Dec21 16:16

It worked great, thanks! Now I have another question: Is it possible to create on screen buttons with the areas? Or at least have the areas display a text just so the player doesn't need to search the screen to discover all the possible areas?
Hindemith
great white shark
 
Posts: 31
Joined: Tue, 16Jul19 17:59
sex: Masculine

Re: Adventure Creator Q&A thread

Postby tlaero » Fri, 17Dec22 23:33

That wasn't the intent of the areas. They're supposed to be hidden with the intent of the user needing to search for them.

I guess I need a more concrete explanation of what you're trying to do.

Are you looking to make the areas visible everywhere, or in just a certain spot, like a menu? If in a menu, your best bet is to use the ability to put pictures in the areas. You can look at the _stats page in the example for that.

If you're looking to have all hit targets be visible all the time, I think your best bet would be to play with the .css file and make the areas have a translucent color.

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

Re: Adventure Creator Q&A thread

Postby Hindemith » Fri, 17Dec22 23:53

Sorry, it was dumbly asked question.

What I want are buttons, so the player can choose from a given set of interactions. Maybe if I put .png text images with the actions on the areas, will it work? I don't want the areas to have a plain image covering it entirely. Is there a way to make the images in areas somewhat transparent, but leave the imageless areas intact?

edit: Got it to work! In the _engine.js file, where the function "AddArea" is defined, there is the "img" variable that stores the image loaded to the area. So, right bellow

Code: Select all
if (typeof (imagePath) != "undefined" && imagePath != "") {
        img = document.createElement("img");
        img.src = imagePath;
        img.style = style;
        img.className = areaID + " " + gImageBorder2Class;
        img.id = gImageId + globalAreaId;


you should insert another line

Code: Select all
   img.style.opacity = "x";


being x the amount of opacity (1 being fully opaque and 0 fully transparent). This way you can create areas with images to function as semi-transparent buttons, while you leave the areas without image completely hidden.

edit2: It would still be better to somehow create real buttons, but this will do for the moment
Hindemith
great white shark
 
Posts: 31
Joined: Tue, 16Jul19 17:59
sex: Masculine

Re: Adventure Creator Q&A thread

Postby tlaero » Sat, 17Dec23 20:20

I still need to know what you're trying to do. If you need buttons on every page the solution will be quite different than if you just need them on one or two "menu" like pages.

Something I'm doing in SavingChloe is setting the globalAreaId to 0 in the Preload of one of the pages. That lets me know the id of each of the images on the page and lets me manipulate them. The same trick would work for knowing the idea of the div section, which would let you do pretty much anything you want. But, again, this works for a "special" page or two. It would be unwieldy if you wanted to do it on every page.

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

Re: Adventure Creator Q&A thread

Postby Hindemith » Sun, 17Dec24 00:11

I wanted to have buttons for interactions on specific scenes, somewhat like Date Ariane's renpy version on the couch scene. Since they are real buttons, the text remains opaque, while the click area is somewhat transparent. With areas, I have to load an image with a text to serve as a pseudo button, but all of it becomes somewhat transparent (which is not ideal, but works)
Hindemith
great white shark
 
Posts: 31
Joined: Tue, 16Jul19 17:59
sex: Masculine

Re: Adventure Creator Q&A thread

Postby tlaero » Sun, 17Dec24 01:58

I'm going to suggest that buttons as hit targets is the wrong way to go. In the original version of Date Ariane, she had invisible hit targets and it worked very well. Renpy doesn't really support invisible targets so she had to remove them in the re-release. She mostly didn't have hit targets at all in SITA and got a fair amount of feedback that we liked having the hit targets better. So she compromised in the Renpy Date Ariane by putting in the visible buttons. As both a developer and player, I feel that invisible hit targets are better for gameplay. For a menu, buttons make sense. But gameplay buttons make the UI too visible and detract from the game.

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

PreviousNext

Return to The workshop of creators

Who is online

Users browsing this forum: No registered users and 18 guests

eXTReMe Tracker