Adventure Creator original thread

Tips, techniques and tutorials about creation tools.

Re: Adventure Creator main thread

Postby Wolfschadowe » Mon, 14Aug25 16:42

simarimas wrote:So when someone click on a speech area, it gives an angry/happy variable, and also advances to the next page? Like clicking on an area does?
I'm not sure what you are asking here, but I'll give it a shot.

Both the image target areas, and the text areas have the same three fields that are applicable here. Let's take the scenario where you want the player to say "Wow, You're beautiful!". Clicking on that should move to page2.htm and also make her happy. "girlHappy + 1"

The three fields needed are href, onclick, and title.

In this example, make:
href: page2.htm
onclick: varPlus1('girlHappy')
Title: Wow, you're beautiful!

This is the same for Images in the image map, and for what the player is saying in the table entries section at the bottom of AC.

Hope that helps! If I'm misunderstanding your question, feel free to mock me mercilessly then clarify. :)

Wolfschadowe
User avatar
Wolfschadowe
legend of the South Seas
 
Posts: 559
Joined: Thu, 13Mar21 07:37
Location: West Coast, USA
sex: Masculine

Re: Adventure Creator main thread

Postby simarimas1 » Mon, 14Aug25 17:11

Yes, you understand perfectly. Hoever, when I have the onclick filled in, as well as the href, it adds the variable, but does not advance to the href page. Now I do have debug enabled, could this be the issue?
User avatar
simarimas1
great white shark
 
Posts: 52
Joined: Tue, 14Sep09 14:50
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Mon, 14Aug25 18:06

Debug shouldn't cause the issue. It sounds more like there is an error in your game.js function that you are calling with onclick. The browser waits until the onclick function completes before advancing to the page.

The symptom for this is clicking on the link, but nothing happens, not even a page refresh. Check brackets, spelling, and that there is a semi-colon after each step in the funciton.

Wolfschadowe.
User avatar
Wolfschadowe
legend of the South Seas
 
Posts: 559
Joined: Thu, 13Mar21 07:37
Location: West Coast, USA
sex: Masculine

Re: Adventure Creator main thread

Postby simarimas1 » Mon, 14Aug25 18:54

I will check my .js functions. I am quite sure I have done something wrong.

Thanks again for the information and help, I learn something each time.
User avatar
simarimas1
great white shark
 
Posts: 52
Joined: Tue, 14Sep09 14:50
sex: Masculine

Re: Adventure Creator main thread

Postby Super » Mon, 14Aug25 19:11

Try copy pasting your game.js into an online java script checker, they can determine if there's any problems in your syntax
Super
legend of the South Seas
 
Posts: 545
Joined: Wed, 11Aug24 20:59
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Mon, 14Aug25 19:12

If you are looking for examples, download the BEW demo and look in the game.js. There is a section titled "Custom Utility Functions" that might help you out.

Wolfschadowe
User avatar
Wolfschadowe
legend of the South Seas
 
Posts: 559
Joined: Thu, 13Mar21 07:37
Location: West Coast, USA
sex: Masculine

Re: Adventure Creator main thread

Postby simarimas1 » Mon, 14Aug25 19:19

Excellent, I will do so. Thank you
User avatar
simarimas1
great white shark
 
Posts: 52
Joined: Tue, 14Sep09 14:50
sex: Masculine

Re: Adventure Creator main thread

Postby simarimas1 » Sat, 14Aug30 21:26

Ok, I am doing something wrong with the javascript functions, and I have no idea what it is.

According to the tutorials, I have to add the return false; at the end of all my functions in order for them to work in firefox. I think I have done this correctly, but at this point I have no idea.

Here is what I have for my functions at this point.

var gameVars = ["amandahappy", "amandaangry", "amandasexy", "amandaattracted", "amandadrunk", "bridgettehappy", "bridgetteangry", "bridgettesexy", "bridgettedrunk", "bridgetteattracted", "bridgettenogo", "carrieattracted", "carriedrunk", "carriesexy", "carriehappy", "carrieangry", "margrethappy", "margretangry", "margretdrunk", "margretsexy", "margretattracted", "sandrasexy", "sandradrunk", "sandraattracted", "sandrahappy", "sandraangry", "cssSize"];

function varPlusPlus1(first, second)
{
{
varPlus1(first);
varPlus1(second);
}
return false;
}

function varPlusPlusPlusPlus1(first, second, third, fourth)
{
{
varPlus1(first);
varPlus1(second);
varPlus1(third);
varPlus1(fourth);
}
return false;
}

function varPlusPlusMinus1(first, second, third)
{
{
varPlus1(first);
varPlus1(second);
varMinus1(third);
}
return false;
}

Then in Adventure Creator, I have the htm page to advance to for a speech box, as well as varPlusPlus1 ('amandaangry', 'bridgetteangry'); in my onclick. It will not advance to the new htm page, though it does appear to add the onclick. By the way, I have the second set of brackets in each function with 4 spaces before them, and the first and last brackets on line 1. It would not post it like that here.



What the HELL am I doing wrong?
User avatar
simarimas1
great white shark
 
Posts: 52
Joined: Tue, 14Sep09 14:50
sex: Masculine

Re: Adventure Creator main thread

Postby kexter » Sat, 14Aug30 21:43

simarimas wrote:What the HELL am I doing wrong?

The following works for me.

Code: Select all
function varPlusPlus1(first,second) {
    varPlus1(first);
    varPlus1(second);
}

function varPlusPlusMinus1(first, second, third) {
    varPlus1(first);
    varPlus1(second);
    varMinus1(third);
}


And something completely different:

simarimas wrote:Was there a version of this that had a lower resolution requirement? If so, is it possible to get it? As I am just beginning with all this, advanced tools may not be as necessary at this point as much as being able to see the entire tool.

Okay this is most probably going to sound weird, but I hacked together a version of AC which should work on lower resolutions (1024*768 and anything in this region). Basically I just made it start up in 1000x700 (give or take) and enabled the vertical scroll bar so everything should be accessible. Apart from these modifications it's exactly the same as V4.7. If anyone (SILePER, simarimas) wants to give it a try it's here: http://www.mediafire.com/download/qd3d5jx5qidvc66/AdvetureCreator47Mod.zip

Note to tlaero: I just messed around with the logic in the AdventureCreator.ChangeSize() method, it's far from perfect but something similar should work.
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby simarimas1 » Sat, 14Aug30 21:57

Thanks kexter.

That code does work, I haven't checked in Firefox yet, but it works in chrome. Not sure where or how to add the return false if it does not work in Firefox, but will worry about that later.

Also, THANK YOU for the mod to AC. I just opened it on my laptop, and it appears to be just fine. Will let you know if I run into any issues with it.

Thank you much!

Sim
User avatar
simarimas1
great white shark
 
Posts: 52
Joined: Tue, 14Sep09 14:50
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Sat, 14Aug30 23:14

The Return False is only needed in functions that direct the browser to a new webpage.

I.e. anything using windows.location or GotoPage()

If you put it into other functions it will cause sadness. :)

Wolfschadowe
User avatar
Wolfschadowe
legend of the South Seas
 
Posts: 559
Joined: Thu, 13Mar21 07:37
Location: West Coast, USA
sex: Masculine

Re: Adventure Creator main thread

Postby simarimas1 » Sat, 14Aug30 23:31

Ok, very good, thanks Wolf.

Alright, next question. I know I am annoying as hell.

Now I am wanting to create a function, to check if Bridgette is going or not. I have already a variable which goes to 1 if she will not go. Now I need to check that variable, and go to a page if it is 1, or to a different page if it is 0.

So I need an if/else script.

function Bridgenogo()

if (bridgettenogo == 1) {
window.location = "listenbridgettecarrietalk1.htm";
} else {
window.location = "listenbridgettecarrieangry1.htm";
}

Is this correct? and from what you said, I would need the return false in this as well?
User avatar
simarimas1
great white shark
 
Posts: 52
Joined: Tue, 14Sep09 14:50
sex: Masculine

Re: Adventure Creator main thread

Postby kexter » Sun, 14Aug31 00:07

What you want is basically the following:
Code: Select all
function Bridgenogo() {
    var value = readVar("bridgettenogo");
    if (value == 1) {
      window.location = "listenbridgettecarrietalk1.htm";
    } else {
      window.location = "listenbridgettecarrieangry1.htm";
    }
    return false;
}

Also note that there is already a built-in function in Adventure Creator which would do exactly what you want.
Code: Select all
// This function can replace simple "check" files. Give it the variable and a check value, and it
// will navigate to the link1 if the variable is greater than the check.  It wil
// navigate to link2 if the variable is less than or equal to the check.
// ie:  Choose('cinema', 0, 'beenthere.html', 'cinema1.html');
function Choose(name, check, link1, link2) {}

So basically, you would put the following in the relevant onclick field:
Code: Select all
Choose('bridgettenogo', 0, 'listenbridgettecarrietalk1.htm', 'listenbridgettecarrieangry1.htm');
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Sun, 14Aug31 00:12

It looks like you are missing your variable declaration in the function. Assuming your variable is called bridgettenogo, change it to read:

Code: Select all

function Bridgenogo()
{
var nogo = readVar('bridgettenogo');  //Reads the cookie variable and stores it in a script variable I called nogo. You could call it Beavis, doesn't matter.

if (nogo == 1)
{
     window.location = "listenbridgettecarrietalk1.htm";
}
else
{
     window.location = "listenbridgettecarrieangry1.htm";
}

return false;  //because you are using window.location
}



I use the following utility function to save time...

EDIT- Don't add this gotoPage() function. As kexter pointed out later, this is already present in the function.js. For some reason I thought I added it manually since it took me a year to realize it was there! :crazy:

Code: Select all
function gotoPage(page)
{
     window.location=page;
}


Then I just type gotoPage('listenbridgettetalk.htm') anywhere I want a page instead of window.location="listenbridgettetalk.htm" It seems like a small thing, but it helps me a lot, especially when most other things are something(somethingelse) rather than something=something... Plus it's shorter to type. :)

EDIT--haha, ninja'd by Kexter. [img]images/icones/icon7.gif[/img]

Wolfschadowe
Last edited by Wolfschadowe on Sun, 14Aug31 17:54, edited 2 times in total.
User avatar
Wolfschadowe
legend of the South Seas
 
Posts: 559
Joined: Thu, 13Mar21 07:37
Location: West Coast, USA
sex: Masculine

Re: Adventure Creator main thread

Postby simarimas1 » Sun, 14Aug31 00:21

Awesome guys, thanks. One of these days I may grasp this stuff, haha. I will say I at least retain the stuff I learn, so I am beginning to understand some of it.
User avatar
simarimas1
great white shark
 
Posts: 52
Joined: Tue, 14Sep09 14:50
sex: Masculine

PreviousNext

Return to The workshop of creators

Who is online

Users browsing this forum: No registered users and 5 guests

eXTReMe Tracker