Web Based Adventure (WBA)

Tips, techniques and tutorials about creation tools.

Re: Web Based Adventure (WBA)

Postby Super » Tue, 17Jan03 19:09

Two things can you add asap?

1. Ability to set the value of one variable equal to the value of another, like set your current health equal to max health so that max health can be increased and be able to increase easily
2. Get rid of dotted outline over hotspots because I feel that's a bit eh Haha

Also, does quicksave work now because I'd like an easier way to save...

Oh! And variable types, can you sort them by groups? Cause I'll almost certainly have a shitload of variable sin this project...
Super
legend of the South Seas
 
Posts: 545
Joined: Wed, 11Aug24 20:59
sex: Masculine

Re: Web Based Adventure (WBA)

Postby SoulMate » Tue, 17Jan03 22:01

Super wrote:Two things can you add asap?

1. Ability to set the value of one variable equal to the value of another, like set your current health equal to max health so that max health can be increased and be able to increase easily
2. Get rid of dotted outline over hotspots because I feel that's a bit eh Haha

Also, does quicksave work now because I'd like an easier way to save...

Oh! And variable types, can you sort them by groups? Cause I'll almost certainly have a shitload of variable sin this project...


Hi Super,

1. I'll add that in future versions. For now you can add 2 lines of code in game.js in function setVar(variable, val, func) { (line 349 in WBA V2.5)
Code: Select all
        } else if (func.toLowerCase() === 'readvar') {
            gameData.vars[idx].value = readVar(val);


The whole setVar function then becomes
Code: Select all
    function setVar(variable, val, func) {
        var valueNum = parseInt(val, 10),
            newVal,
            idx,
            i;

        for (i = 0; i < gameData.vars.length; i += 1) {
            if (gameData.vars[i].variable === variable) {
                idx = i;
                break;
            }
        }
        if (!isSet(idx)) {
            idx = gameData.vars.length;
            gameData.vars.push({variable: variable, initial_value: 0, value: 0, type: ''});
        }

        if (!isNaN(valueNum)) {
            val = valueNum;
        }

        if (!func || func === '=') {
            gameData.vars[idx].value = val;
        } else if (func === '+') {
            gameData.vars[idx].value += val;
        } else if (func === '-') {
            gameData.vars[idx].value -= val;
        } else if (func.toLowerCase() === 'readvar') {
            gameData.vars[idx].value = readVar(val);
        }
        newVal = gameData.vars[idx].value;

        if (isSet(events.varChange)) {
            for (i = 0; i < events.varChange.length; i += 1) {
                if (events.varChange[i][0] === variable) {
                    events.varChange[i][1](newVal, variable);
                } else if (events.varChange[i][0] === '*') {
                    events.varChange[i][1](newVal, variable);
                }
            }
        }
    }


Then in WBA Build, configure as follows:
Image

2. I think you mean the solid line when hovering, and the semi-transparent solid line on mobile devices. They are gone in V2.5.
In older versions you could add those two lines in custom.css:
Code: Select all
body.touch .fakemap-area { border: none; }
.fakemap-area:hover { border: none; }



3. About the quicksave. It's a technical limitation of a webbrowser.
There are solutions, but these requires installation of a webserver with PHP/Python/.NET etc
I'm thinking about Python, which has a SimpleHTTPServer module, which does not require much setup
Ideas are welcome!


4. There are already variable types, but aside from assigning a type there is no 'grouping'.
Also there is limited restriction in naming variables, so you can use a variable format like groupname_variablename as the name of the variable.
If you desire other behavior, can you explain a little more what problems you face and what solutions you see?
SoulMate
great white shark
 
Posts: 79
Joined: Wed, 14Apr23 17:56
sex: Masculine

Re: Web Based Adventure (WBA)

Postby Super » Tue, 17Jan03 23:14

For variable groupings, I meant some way be it tabs or folders or whatever to keep myself from going insane with them. Perhaps a way to toggle which type shows or not?

Icons would be MUCH appreciated in making more complicated games like we seem to be doing so yay.

Not to mention being able to switch alternate images will make choosing image maps for alt images much easier and less of a guessing game

Seems I misunderstood changing images. Would it be possible to have it so you can click on alternate images in the images tab so you can see what it'd look like in the game view so you can easily set hit targets that only appear in alternate images instead of approximating where said hit targets would be? Like, say, if a wrench appears in hotel3a but not hotel 3 depending on previous actions, You can add the hot spot for picking up the wrench in hotel3a by simply clicking the alt image and then adding the hit box instead of needing to approximate where the wrench would be in 3a on the 3 image? I suppose I could temporarily change hotel3 to hotel3a's image, but that would be harder for me inthe long run. But thanks so much, icons are already a great help
Super
legend of the South Seas
 
Posts: 545
Joined: Wed, 11Aug24 20:59
sex: Masculine

Re: Web Based Adventure (WBA)

Postby SoulMate » Wed, 17Jan04 22:17

Super,

Can you send me a copy of the game you're making. And a description of a task to do where i would face the problem. A task like: In Chapter 2, Christel could have found a racket. I saved this in a variable, but doesn't know the name. In the page i'm currently working i would like to check if she has the racket.

If i experience it myself, i can come up with better solutions.

For the hotel3 / hotel3a problem. Would a clone/copy option be a solution? I think it's not to hard to clone/copy and image_icon, image_map, response, title from one page to another.
SoulMate
great white shark
 
Posts: 79
Joined: Wed, 14Apr23 17:56
sex: Masculine

Re: Web Based Adventure (WBA)

Postby sylakone2 » Thu, 17Jan05 09:01

Hey Soulmate

How are you doing?

I really like the new update.

Unfortunately after I upgraded model freinds to the new version I have now lost the really nice Overlay yuo improved a while a go.

Any ideas of how to get it back?

I tried copying the css folder from and older version as that was one of the files that was changed which was not in the list of items to protect from the old version.

Cheers

Sy
Cheers Sy
User avatar
sylakone2
lagoon predator
 
Posts: 224
Joined: Mon, 12Jan09 13:08
Location: Australia, SA
sex: Masculine

Re: Web Based Adventure (WBA)

Postby SoulMate » Fri, 17Jan06 14:56

Hi Sylakone,

I'm sorry to hear. I think this is because i removed some HTML elements which were not needed by default. Those element are now only created when necessary.

If i'm remembering correctly, you use the <div id="stats">. In custom.js you probably have a line that looks like
Code: Select all
var $stats = $('#stats');


If you change that line to the code below, it should be solved.
Code: Select all
var $stats = $('<div id="stats"></div>').appendTo('#image-wrapper');


If that doesn't help, send me your custom.js and i'll figure it out for you.
SoulMate
great white shark
 
Posts: 79
Joined: Wed, 14Apr23 17:56
sex: Masculine

Re: Web Based Adventure (WBA)

Postby Super » Fri, 17Jan06 19:12

Could you add the ability to check if strings are the same? For instance, in the show if, have it work so that if a variable shows only if a string is the correct one? Not only would this allow passcodes and whatever potentially, but it will allow me to check varialbes more easily.

For instance, I have a current mood variable to check whoever you're talking to's reaction to what you just said and have an image and text to match it using show if. However, because I have to have "Currentmood = 0" or "1" or whatever, it requires me to remember which number is what. Which is doable for that but as I get more complex, being able to check strings would make it a ton easier. So instead of having "Current mood = 1" and remembering 1 equals mad, I can just have "currentmood = mad".

Unless this is already possible and I'm just overthinking it.
Super
legend of the South Seas
 
Posts: 545
Joined: Wed, 11Aug24 20:59
sex: Masculine

Re: Web Based Adventure (WBA)

Postby SoulMate » Sat, 17Jan07 14:15

Super,

I haven't tested it yet, but strings instead of numbers should already be supported if im correctly.
At the moment i have no time to test it, maybe tomorrow.
SoulMate
great white shark
 
Posts: 79
Joined: Wed, 14Apr23 17:56
sex: Masculine

Re: Web Based Adventure (WBA)

Postby SoulMate » Tue, 17Jan17 10:29

A new release is available

Update V2.6
- Added possibility to use :variable as value
- Random choices got a new weight attribute
- Fixed image_maps and image_icons without hover text
- Fixed image_icons with no href of click

https://mega.nz/#!qZ0g3QwB!Xvf5fv9jx6t67x7mlNHYGqZ2cs-6Mw0KCejiw9ybp7o

Use of :variable:
Normally for requirements or show_if statements, you can use 'health > 60'. But what if 60 is not static, but also variable?
That's where ':variable' comes to rescue. You now can configure 'health > :minHealth', which compares the current value of minHealth and health

It also works for setting a variable, for example when you go to sleep. 'health = :maxHealth' or 'health + :reviveHealth'
@Super: This is the replacement/improvement of 'health readVar maxHealth' i showed you earlier.

Use of random weight (thanks to Super for the idea):
Untill now, when redirecting to a random page, each page had the same change of being chosen. This is not always desirable. Therefore a new weight attribute is added.
You now can do the following:
HREF: win WEIGHT: 1
HREF: lose WEIGHT: 3

This gives you 1/4 chance of winning and 3/4 change of losing.
The weight attribute also works with the :variable explained above.

Image
SoulMate
great white shark
 
Posts: 79
Joined: Wed, 14Apr23 17:56
sex: Masculine

Re: Web Based Adventure (WBA)

Postby sylakone2 » Tue, 17Jan17 14:14

Hey Soulmate.

Thanks for adding some new features I look forward to using them.

Cheers

Sy
Cheers Sy
User avatar
sylakone2
lagoon predator
 
Posts: 224
Joined: Mon, 12Jan09 13:08
Location: Australia, SA
sex: Masculine

Re: Web Based Adventure (WBA)

Postby Super » Tue, 17Jan17 22:22

That was fast and should be helpful :p

Still considering the other thing I mentioned?
Super
legend of the South Seas
 
Posts: 545
Joined: Wed, 11Aug24 20:59
sex: Masculine

Re: Web Based Adventure (WBA)

Postby SoulMate » Wed, 17Jan18 20:12

Definitely, but that takes a lot more time ;-)
SoulMate
great white shark
 
Posts: 79
Joined: Wed, 14Apr23 17:56
sex: Masculine

Re: Web Based Adventure (WBA)

Postby Super » Thu, 17Jan19 01:23

Figured as such, lol I'll try and work around it for now
Super
legend of the South Seas
 
Posts: 545
Joined: Wed, 11Aug24 20:59
sex: Masculine

Re: Web Based Adventure (WBA)

Postby SoulMate » Sat, 17Feb04 19:22

Update 2.7 is released.
- Random choice supports show_if
- set_var on page load or item click supports show_if
- Improved check on what page each variable is used
- Added option to clone elements to other pages

https://mega.nz/#!DUlDzRKC!zqbh81YEtxuZTQhVF3Ak7VeMvPCyOxNJy0uCHuLJXGA
SoulMate
great white shark
 
Posts: 79
Joined: Wed, 14Apr23 17:56
sex: Masculine

Re: Web Based Adventure (WBA)

Postby sylakone2 » Sun, 17Feb05 04:10

Hi Soul.

I am not sure why this has been happening but for some reason after the last few updates My text has gone strange.
See below pic.

https://mega.nz/#!l00hmA5J!UBMbMcNuQHTAMJrIO3CKS82I9fDYmt7j0Fc5pmutbHc

Any ideas

Cheers

Sy
Cheers Sy
User avatar
sylakone2
lagoon predator
 
Posts: 224
Joined: Mon, 12Jan09 13:08
Location: Australia, SA
sex: Masculine

PreviousNext

Return to The workshop of creators

Who is online

Users browsing this forum: No registered users and 3 guests

cron
eXTReMe Tracker