Adventure Creator original thread

Tips, techniques and tutorials about creation tools.

Re: A tool to help write "Virtual Date" games

Postby tlaero » Sun, 13Jun02 20:57

Bitwise is a way to get more data packed into fewer variables. You'll need it if you go over the max number of variables, but it doesn't implicitly help you otherwise. I use it in my games because I like the efficiency of having an "events" variable that holds all the boolean events but it's not strictly necessary.

Wolf, this is the function you're looking for. It's kind of specific so I'm not planning to add it to _functions.js, but you can put it in your _games.js.

Code: Select all
function SetSubAchieve(sub, achieve)
{
    if (typeof (gamePersists) != "undefined")
    {
        setVar(sub, 1);
        var allSet = true;
        for (var index in gamePersists)
        {
            var str = gamePersists[index];
            var contains = str.indexOf(achieve);
            if (contains != -1)
            {
                var val = readVar(str);
                if (val == 0)
                {
                    allSet = false;
                }
            }
        }

        if (allSet)
        {
            setAchieve(achieve);
        }
    }
}


Here's how to use it.
First, the full name of the achievement must be part of every subachievement associated with it. Ie: Achievement = "test" and subAchieves = "testFaith", "testEmily", "testShadow"
Second, all the subachieves must be in gamePersists.
Third, use this function to set a subAchieve. If all of them are set, it'll set the achievement too. Ie:
SetSubAchieve("testFaith", "test");

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

Re: A tool to help write "Virtual Date" games

Postby Wolfschadowe » Mon, 13Jun03 02:05

Got it set up in my _game.js and it works perfectly. I also created a setSubAchieveIfDiff(sub, achieve, diff) by wrapping a difficulty statement around it which also works great. I found that I can also re-curse achievements as necessary with creative naming. For example, I have two 'tutorial' achievements. One for completing the intro, and an intro mastery achievement for both completing the intro and reading the instructions, which introduces the concept of mastery.

with gameAchieves=["intro", "introDone"];
and
gamePersists=["introDoneAch","introInstr"];

I can use the function to set the intro complete using setSubAchieve("introDoneAch","introDone"), and then check for mastery with setSubAchive"introDoneAch","intro") if the introInstr is also set, then it triggers the intro mastery achivement. (intro).

I think this has me set up for a while! Thanks for all your help Tlaero!

Wolfschadowe.
Last edited by Wolfschadowe on Mon, 13Jun03 04:05, edited 1 time in total.
User avatar
Wolfschadowe
legend of the South Seas
 
Posts: 559
Joined: Thu, 13Mar21 07:37
Location: West Coast, USA
sex: Masculine

Re: A tool to help write "Virtual Date" games

Postby tlaero » Mon, 13Jun03 04:03

Happy to help, Wolf.

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

Re: A tool to help write "Virtual Date" games

Postby ares » Sun, 13Jun16 19:33

What would it take to add an inventory to the adventure creator?

I understand it would be a major modification. However, it might make the adventure creator that much flexible. In terms of story, it would allow to make them more adventure and less visual novel. It would also enhance greatly the quality of puzzles so that the games would become a more complete experience. Kind of things you can do with TADS or Inform. Of course, it would make the adventure creator more suitable for non-aif adventures.

The idea would be to add an inventory pannel, say located on the left of all the game pages. Inside the pannel there would be clickable pictures of your current inventory. Hotspots in those pictures would be always available. However, if nothing can be done in the current scene with that inventory element you would simply go to "page1a.html" which displays the same main picture and the message, "Nothing can be done with that right now.".
ares
great white shark
 
Posts: 50
Joined: Sun, 13Apr14 22:30
sex: Masculine

Re: A tool to help write "Virtual Date" games

Postby tlaero » Mon, 13Jun17 00:42

It's code, so anything is possible. I'll think about it.

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

Re: A tool to help write "Virtual Date" games

Postby luke » Mon, 13Jun17 12:20

From the thread Meeting Keeley
tlaero wrote:I [...] added sounds (as long as you're on a browser that follows industry standards--Firefox doesn't)

The point is that Firefox only use open source standard, which is not the case with the "industry standards" (i understand mp3).
Que la Force de Shark soit avec toi / May the Shark Force be with you
User avatar
luke
Moderator
 
Posts: 1734
Joined: Thu, 07Jun07 23:00
Location: In my clothes
sex: Masculine

Re: A tool to help write "Virtual Date" games

Postby me3 » Mon, 13Jun17 15:28

that isn't true, Firefox supports MP3 in html5 audio tags. FF 20+ (ff 20 might need to have this manual activated) should support this but it's dependent on your OS supporting it. this is due to the patented nature of the mp3, and with ff being open source oriented they couldn't include that in their code etc. So things should work in FF too, if done correctly.
me3
great white shark
 
Posts: 89
Joined: Sun, 07Dec02 00:00

Re: A tool to help write "Virtual Date" games

Postby Dakutis » Tue, 13Jun18 06:59

ares wrote:What would it take to add an inventory to the adventure creator?

I understand it would be a major modification. However, it might make the adventure creator that much flexible. In terms of story, it would allow to make them more adventure and less visual novel. It would also enhance greatly the quality of puzzles so that the games would become a more complete experience. Kind of things you can do with TADS or Inform. Of course, it would make the adventure creator more suitable for non-aif adventures.

The idea would be to add an inventory pannel, say located on the left of all the game pages. Inside the pannel there would be clickable pictures of your current inventory. Hotspots in those pictures would be always available. However, if nothing can be done in the current scene with that inventory element you would simply go to "page1a.html" which displays the same main picture and the message, "Nothing can be done with that right now.".


Yes thats would be cool.
http://dakutisgames.weebly.com/
User avatar
Dakutis
lagoon predator
 
Posts: 116
Joined: Wed, 12Nov07 14:17
Location: Lithuania, Kaunas
sex: Masculine

Re: A tool to help write "Virtual Date" games

Postby tlaero » Wed, 13Jun19 04:07

Mozilla claimed that they weren't supporting MP3 because they couldn't afford the license, but, at best, that was disingenuous. The os has had the ability to play MP3s for free for years and years. Mozilla didn't do what they did for the betterment of their customers, and certainly not for the betterment of the web. They did it for their quasi-religion that instructed them to try to kill anything that wasn't "open." So for years developers like me have been forced to spend our scarce resources re-rendering our sounds just for Firefox. And for years, users like you have been restricted to web content without sounds.

Firefox is the primary reason why my first four games were silent. If you like the sounds in CfK, blame Firefox for blocking you from having them earlier. Thankfully, their market share has fallen enough that they no longer have the clout to singlehandedly halt development of the web. Good riddance I say.

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

Re: A tool to help write "Virtual Date" games

Postby Greebo » Wed, 13Jun19 19:35

Well hush ma mouf! Since I don't want to restart the HTML5 "open source wars" I shall keep stumm apart from this comment -- Firefox were not doing it out of quasi-religious zeal. Many of us reckon that standards should be as open as possible and that commercially licensed codecs and the like should not become the default, no matter how pervasive they may have become as a solution. Try examining their actual arguments instead of those you impute to them.
User avatar
Greebo
Great Master of corals
 
Posts: 2096
Joined: Mon, 08Jan21 00:00
Location: England
sex: Masculine

Re: A tool to help write "Virtual Date" games

Postby me3 » Wed, 13Jun19 22:13

In this case the why is rather irrelevant, all the major browser has and have had their horrible sides that's made life hell for web designers and developers. While they've all generally gotten better there's still loads of quirks and differences with all of them that we have to try and account for, not to mention the number of "outdated" browser still in use.
We've been able to adapt and find working solutions in the past, that should hardly be any different now.

Sound on webpages has actually work fine, but that is also fairly irrelevant in the grand design of it all, as sound has been considered a rather annoying thing to have on webpages, games would probably one of the few exceptions where it would be acceptable.
If you want to drag out all the annoying things that browsers have had over the years i'd have to say the differences they've all made us struggle with in regards to javascripts and specially css would be far far worse. Except in a few cases they've mostly been down to older IE versions, mostly due to Microsoft wanting to dictate the path instead of the standards. IE/Microsoft has had to give up on that too in their later versions, but due to the nature of windows, IE and how updating is done and require we're still forced to struggle with all those "problems" as ppl still use all those versions.
"Newest" IE version you can get on XP is 8...neither 9 or 10 works (officially) and IE 8 has loads of issues that designers/developers have to deal with, and there's A LOT of XP users still around, who can blame them tbh, it's a stable and fairly good.

Opera has it's issues too, its javascript handling causes several issues if you try specific things, thankfully not too commonly used things, and it's cookie handling is...horrible.
Thankfully updated version at least work on any OS version so any bugs/etc is probably gonna be fixed and updating isn't an expense...same goes for most browsers with the exception of IE (os dependent and new os == cost)

Over the years i've had countless of this issues to deal with, if it's not one browser it's the other, or it's down to the bloody OS...eventually you get to a point that it's far far far less work, effort and time consuming to just fix it, work around it, or just do it in a different way than to spent time and effort to complain about it. It's rather rare that there isn't a fairly simple solution to the problems and in many cases it's as simple as: "This works 99.9%, and for the 0.1% it doesn't break, it doesn't cause any problems, they simply don't know about/see this function/look/etc, so it's not really a problem"

With how many "new" ways there's to view/access webpages now you'll eventually go crazy if you plan on having a simple "one size/design/function/whatever fits all". There's so many different OS, browsers and handling combinations it's a nightmare.

If you skipped everything else, at least read this next bit.
As for games etc, i'm sure many won't care if there's sound or not, ofc it can add to the game etc, but it can also be annoying, users have different views and opinions, so regardless of format, there should be an on/off switch.
As for the format itself, while there's ways to make just about any work, but the question here has generally be between ogg and mp3.
Unless you specifically use 128kbits MP3 files, ogg would be a better format, at higher or lower bitrates ogg would be better than mp3. I'm not saying that in support of one or the other i'm just pointing it out. To me the format chosen is irrelevant.

So far everything i've ranted on about has been a general, but i want to make one small point to tlaero:
You say that developers like you've had to reencode their sounds just for firefox, i'm gonna assume your "sounds" have been in mp3, and you blame firefox for this.
There's a slightly flaw in that and it can also be twisted around. Firefox isn't the only browser that didn't support mp3, Opera didn't/doesn't either, so you can't just blame firefox for it.
The twist is that consider those on the other side, those that had their sounds in ogg...
IE, chrome and safari supported MP3...Firefox, Opera and chrome supported OGG...so that means that regardless of which of those two formats you had, you would support 3 browsers while fail for 2 others. So neither "side" can technically claim that the other is making things difficult. While this "balance" is like to change (has changed), it's been an issue for a while so your complaints and blame of firefox for it doesn't quite hold up. And the developers on the "other" side of you would face the exact same issues as you.
All in all this goes back to my point about "it's not worth the effort", we as developers will always face issues and we'll just have to learn to live with it, no sense getting worked up about it. :)

(Before anyone thinks to put my in any "camp", i for the most part use mp3 and my primary browser is Firefox, so i'm standing fairly well planted with one foot on either side :P)
Rant ended, hopefully...sorry about the long spam :/
me3
great white shark
 
Posts: 89
Joined: Sun, 07Dec02 00:00

Re: A tool to help write "Virtual Date" games

Postby tlaero » Fri, 13Jun21 03:49

Adventure Creator has support for Ogg if you want to use it.

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

Re: A tool to help write "Virtual Date" games

Postby Wolfschadowe » Fri, 13Jun21 06:09

Hi Tlaero,

Can you advise when I should or shouldn't use "return false;" at the end of a function? I remember reading something on the forums or in your AC documentation that it was to work around a browser bug, but that was long ago. I've written a few of my own functions and sometimes they get a little wonky if I use it, and sometimes they don't. Primarily I use it if there is an 'if' statement present.

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

Re: A tool to help write "Virtual Date" games

Postby tlaero » Fri, 13Jun21 07:00

Firefox, of course. (-:

You need to return false if the function moves you to another html page. Aside from functions you want to call yourself that return something else, it's safe to always do it.

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

Re: A tool to help write "Virtual Date" games

Postby Wolfschadowe » Fri, 13Jun21 07:18

Ok, that helps.

I was getting a problem where if I put return false in some of my functions where there was no page navigation in the function, and the page navigation was handled with href in AC.
he function worked fine if it was placed in preLoad, but if the function was in an AC onclick field, not only did the function stop working, so did the href navigation...in all three browsers. (firefox, IE, chrome.) Move the function back to PreLoad and everything worked again. Removing 'return false' fixed the problem for those functions though.

Now I know, It's only where navigation happens in game.js. :)

Thanks!

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

PreviousNext

Return to The workshop of creators

Who is online

Users browsing this forum: No registered users and 7 guests

eXTReMe Tracker