Adventure Creator original thread

Tips, techniques and tutorials about creation tools.

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

Postby Wolfschadowe » Sun, 13May12 23:24

The easiest way to reproduce it is by resizing. For example, if you have an existing area and are resizing it, the process is to right click on the area target and drag. If a dummy like me right clicks and drags up and to the left to the point where the area disappears and let's go of the mouse, an area is generated that persists through multiple page creations, but is unusable and undeleteable from AC, yet still generates the yellow border. There may be other ways to create the effect, like dragging an area off the picture, but I haven't tested that.

I'm not sure if it's realistic to prevent this from happening. Nothing is foolproof, because there are always better fools. One method may be to have a minimum area size.

Just being able to resolve the issue through AC would be fine rather than trying to prevent it though, like a "clear all area entries" option.

Wolf
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, 13May13 04:14

<sheepishly> I just checked. When you do that, I let the size go negative. Boxes with negative sizes are invisible. I'll have to fix that.

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 tlaero » Mon, 13May13 07:12

Okay, I'm going to do both: stop it from happening and give you a delete all areas option. It'll come in the next version of AC.

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, 13May13 17:16

Thanks Tlaero,

If you are going to be tinkering a bit with it anyway, would you mind looking into the image wildcards? I may have messed myself up with my naming convention, but currently it filters to n* on BEW where the images are named n1-bar25, n1clubsofa002, etc. Having the wildcard filter at n* certainly helps, but as the days progress, it will help less over time. If it could filter to a minimum of three initial characters or so, that would be very helpful. instead of n*, I would see n1c* or n1-*, or m2c*.

To help see where I'm going and tweak, if you do decide to tinker with the image wildcard, future conventions will be m2coffee001, d2office001, n2bar001, n2diner001, m3coffee001, etc...

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 » Tue, 13May14 04:08

It goes until it hits a number. Not a lot I can do to help you there. )-:

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 » Tue, 13May14 04:35

tlaero wrote:It goes until it hits a number. Not a lot I can do to help you there. )-:
No worries. Thanks for checking into it. [img]images/icones/icon7.gif[/img]

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 » Tue, 13May14 06:13

I just realized that that's why game view isn't sorting correctly too. It also only smart sorts on the first number it finds. Sorry. )-:

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 » Tue, 13May14 21:30

tlaero wrote:I just realized that that's why game view isn't sorting correctly too. It also only smart sorts on the first number it finds. Sorry. )-:
I didn't even know that the game view wasn't sorting correctly. I just figured it was using the old style mixed-mode alphabetizing where text is a, b, c, d, numbers are 1,2,5,10,11 and mixed is a1, a10, a11, a2, a5. It's only recently in my personal experience that O/S's got smart enough to sort a1, a2, a5, a10, a11, so I never noticed anything odd.

As for the photo wildcard, I really don't worry about it. When I'm on a roll of page creation, it's pretty easy for me to store something like n1clubsyl* in the clipboard and use CTRL+V -> Enter when opening the images in AC. In fact I have several spare buttons on my mouse, and one is mapped to ENTER. since the proper field has focus when the open image window, er... opens, I just hit CTRL+V with my left hand, Mouse 6 (mapped to Enter), double click the image I want, done. The whole process only takes 2 or 3 seconds, depending on how fast I spot the correct image.

As for the game view, I have no problem with it whatsoever, so no apologies allowed on either part. [img]images/icones/icon13.gif[/img].

The only thing I can think of that would make game view better would be an option to wrap text.

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 » Wed, 13May15 06:39

Yeah, I hate the way windows orders numbered files, so I wrote GameView to do it better. It'll order n1, n2, n10, n20 instead of n1, n10, n2, n20. But it only goes to the first number. You're making your life difficult with these n1b3 style names.

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 tlaero » Fri, 13May17 07:10

Okay, I just uploaded AC 3.5. https://hotfile.com/dl/223229286/efe5aa ... r.zip.html

This version keeps you from making negative sized hit targets and lets you delete all areas (right click on the picture on something that's not an area).

_functions.js got a lot of updates too. I added the infrastructure to do Achievements, stats pages, and the ability to save and restore from a stats page. Also, if you set a variable called "gameDelim" to something unique (like your game's name) your saves and achievements won't conflict with other AC games. The example shows how to do all of this, but if anything isn't clear, don't hesitate to ask questions here.

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, 13May17 07:15

Tlaero,

You are awesome as usual. Any special tricks to upgrading from previous versions, or just copy _functions.js over and resave pages?

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 » Sat, 13May18 02:50

Copy the _functions.js over, but you don't need to resave the pages. The general HTML didn't change. The important changes are to add gameDelim and gameAchieves to your _game.js. After that, look at _save.htm, _restore.htm, _stats.htm, and achive1.htm.

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 » Sat, 13May18 04:07

Seems to work perfectly. I've decided to implement Achievements to BEW after seeing how it works in your example file. I expanded a bit by turning the stats page into a menu page with options like restarting the game, going to help instructions and similar activities. I also kept the save and load functionality, but added one save/load in the score line and labeled it quicksave and quickrestore.

The achievement system gives us another tool for difficulty incentives. Would it be possible to modify the setAchieve() function to have a minimum difficulty threshold? For example, if I want to allow an achievement only on hard difficulty, I would enter setAchieve('woot",1) so that the 'woot' achievement is only set if difficulty is set to 2 (hard). Likewise, setAchieve('woot',0) would set for medium and hard levels, although once you throw easy into that format it might get tricky. It's not the specific format I'm looking for, just the concept.

Of course, I can do this easily now by calling a _game.js function from PreLoad or onclick:, for example,
Code: Select all
function woot;
{
     var diff = readVar('difficulty');
     var hard = 2 //usually declared globally

     if (diff == hard)
     {
          setAchieve('woot');
     }
     return false
}


What I'm looking for is a one liner that I could throw into PreLoad or onclick that gives a minimum difficulty threshold to set the achievement.

Your tool keeps getting better and better! Sometimes I feel bad that I keep asking for more stuff. Thanks again for all your time that you put into it!

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 » Sat, 13May18 18:24

I'm happy to help, Wolf.

Oh cool, I never noticed the "Code" delimiter on the board.

I'd like to keep the _functions.js achievements functions generic, but you can add this to your _game.js
Code: Select all
function setAchieveIfDiff(achieve, diffNeeded)
{
    var difficulty = readVar("difficulty");
    if (difficulty >= diffNeeded)
    {
        setAchieve(achieve);
    }
}


Then in your preload, you can do:
setAchieveIfDiff("woot", 2);

And it will only set the achievement if the difficulty is hard.

Does that make sense?

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 » Sat, 13May18 21:46

Thanks Tlaero,

I think you may have just opened a whole new world for me. If I wanted to create a function that would add 1 one one variable and subtract 1 from a second all within a single onclick statement I could put this into _game.js:

Code: Select all
    function varPlusMinus1(add, subtract)
    {
        varPlus1(add);
        varMinus1(subtract);
        if (difficulty >= diffNeeded)
        {
            setAchieve(achieve);
        }
    }


Then in onclick, I would enter:
varPlusMinus1("angry","reputation")
Which would add one to the angry variable, and subtract one from the reputation variable, correct?

Then there's endless variations, for example, varPlusPlus1(add,add), varPlusPlusPlusMinus(add1, add2,add3,minus1), not that I'll actually use all the examples, but the concept is sound. I can use this technique for common tasks and calculations. I think you just saved me a whole lot of code writing. [img]images/icones/icon14.gif[/img]

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 9 guests

eXTReMe Tracker