Adventure Creator original thread

Tips, techniques and tutorials about creation tools.

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

Postby Super » Sun, 13Dec08 20:55

Yeah, I assumed it'd be impossible. I just sometimes want to change things in the last slide, and wanted an easy way to go back to the next slide. No big deal, I don't have big enough a directory for it to be too much of a problem.
Super
legend of the South Seas
 
Posts: 545
Joined: Wed, 11Aug24 20:59
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Fri, 13Dec20 07:32

I just uploaded a new version of AC.
http://www.mediafire.com/download/six8f ... reator.zip

Changes in 4.5
_functions.js has an AnimRunFunc function for running a function every n loops through an animation.
GameView filtering. You can now have GameView show you a subset of the html files.
AC and GameView positions are now saved.
GameView shows image functions.


The main change is I added filtering for game view. Say you've got a billion files <cough>Wolf</cough> and you want GameView to show you a subset of them. Or, say you want to show every file with a varPlus1 in it. Etc.

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

Re: Adventure Creator main thread

Postby Wolfschadowe » Fri, 13Dec20 07:38

tlaero wrote:I just uploaded a new version of AC.
--snip--
The main change is I added filtering for game view. Say you've got a billion files <cough>Wolf</cough> and you want GameView to show you a subset of them. Or, say you want to show every file with a varPlus1 in it. Etc.
Very cool! I was just about to call it a night, but now I need to take this out for a spin. Thanks Tlaero! Yet another feature I wanted badly, but didn't even know it!

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 Dakutis » Fri, 13Dec27 06:43

Hi Tlaero I need your help.
I didn't know this is possible to do or not, but I need that in score menu I can show what day of the week is. Like:
Day 7, Sunday. Time 16.... (where - " 7", "Sunday", "16" is variable parameters).
I want to use format like Day 1, Monday...............Day 7, Sunday. Day 8, Monday and so on.
I think I need something like:


if
Day == 7
{
setVar("DayD",Sunday); ///(DayD = Sunday, monday....)
}

But where to write it and if it is possibe I don't know. At first, is it possible that in gamescore will be words or only numbers.
http://dakutisgames.weebly.com/
User avatar
Dakutis
lagoon predator
 
Posts: 116
Joined: Wed, 12Nov07 14:17
Location: Lithuania, Kaunas
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Fri, 13Dec27 07:23

Hi Dakutis,

What you are probably looking for is at the bottom of the _game.js file in the score section you should see a function called outputString(str).

That writes the score line. You can load the variable str with any string. An example below prints the text "Your current score is" and then appends whatever is loaded into the 'score' variable to the end.

Code: Select all
str = "Your current score is " + score;
outputString(str)
You could do something like:

Code: Select all
str = "Day" + dayNumber + ", " + dayName + ", Time" + timeNumber;
outputString(str)


Does that help?

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 Dakutis » Fri, 13Dec27 07:56

Yes I know that but, how to do that:
when Day = 1 then "dayName" was Monday and other day - Tuesday.
what function I need and where I have to write it?
http://dakutisgames.weebly.com/
User avatar
Dakutis
lagoon predator
 
Posts: 116
Joined: Wed, 12Nov07 14:17
Location: Lithuania, Kaunas
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Fri, 13Dec27 08:06

You could use a switch case, or an if, elseif, else statement. For example:

Code: Select all
if (day == 1)
{
dayName = "Monday";
}
else if (day == 2)
{
dayName = "Tuesday";
}
else if (day == 3)
{
dayName = "Wednesday";
}
....
else if (day == 6)
{
dayName = "Saturday";
}
else
{
dayName = "Sunday";
}
I skipped a few days to save time, but that should give an idea. You put the function to control that anywhere in game.js, and then call the function from the score section. Name the function whatever you like.

:) Hope that helps.

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 Wolfschadowe » Fri, 13Dec27 08:33

One, maybe two places.

First, if you need them, you will want to fill in the days I skipped, Thursday and Friday.

The other problem is that it is case sensitive. Day does not equal day. change Day to lowercase day for the variable name. Leave the capatalized "Day" in the readVar("Day"); alone.

function calcDayD() should start

var day = readVar("Day");

or...you could change all the lowercase day entries in the if/else if/if to be capatalized Day. I'm lazy, so I'd just make the single change.

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 Dakutis » Fri, 13Dec27 08:47

Wolfschadowe wrote:One, maybe two places.

First, if you need them, you will want to fill in the days I skipped, Thursday and Friday.

The other problem is that it is case sensitive. Day does not equal day. change Day to lowercase day for the variable name. Leave the capatalized "Day" in the readVar("Day"); alone.

function calcDayD() should start

var day = readVar("Day");

or...you could change all the lowercase day entries in the if/else if/if to be capatalized Day. I'm lazy, so I'd just make the single change.

Wolfschadowe


No I get "false" in the place where have be Sunday, Monday...
http://dakutisgames.weebly.com/
User avatar
Dakutis
lagoon predator
 
Posts: 116
Joined: Wed, 12Nov07 14:17
Location: Lithuania, Kaunas
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Fri, 13Dec27 08:55

Your post with code disappeared, but it sounds like the dayName variable isn't being carried outside of the function. Did you store it with setVar at the end of the function?

If your global variable is nameOfDay

setVar(nameOfDay, dayName);

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 Dakutis » Fri, 13Dec27 09:10

I find mistake its was the end of function, I write there
}
return false;
}

One more question, I want that daysName go and further (like: Day 8 Monday, Day 14 Sunday ) how better to do that? One way is to continue function
else if (day == 8)
{
dayName = "Monday";
}
............
but then its will be very long function.
http://dakutisgames.weebly.com/
User avatar
Dakutis
lagoon predator
 
Posts: 116
Joined: Wed, 12Nov07 14:17
Location: Lithuania, Kaunas
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Fri, 13Dec27 09:21

I'm not really a coding expert, but I would probably add this to the beginning for the function just before the first if statement:

Code: Select all
while (day > 7)
{
day = day - 7;
}
this will check the day value, and if it is greater than 7, it will subtract 7. So it will change Day 14 to Day 7 (14 - 7 = 7), and Day 8 to Day 1 (8-7 = 1). If the day is day 16, it will do it twice (16 - 7 = 9) then (9 - 7 = 2).
This keeps subtracting seven from the day until the day is 1-7.

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 Dakutis » Fri, 13Dec27 09:46

Wolfschadowe wrote:I'm not really a coding expert, but I would probably add this to the beginning for the function just before the first if statement:

Code: Select all
while (day > 7)
{
day = day - 7;
}
this will check the day value, and if it is greater than 7, it will subtract 7. So it will change Day 14 to Day 7 (14 - 7 = 7), and Day 8 to Day 1 (8-7 = 1). If the day is day 16, it will do it twice (16 - 7 = 9) then (9 - 7 = 2).
This keeps subtracting seven from the day until the day is 1-7.

Wolfschadowe.


Yes it working, cool [img]images/icones/icon14.gif[/img] you save me from few hundrends code lines.

Now very difficult task. In my game all important stats is in the top of every page (like Day , time, money and few more) but I want that player could see and others stats (I can't put all in main line with others because they all don't fit in one line, and I can give him more than one line. So I want to create stats page and some stats put there. Question - how do that. What I need to write in _game.js and in that new page?
http://dakutisgames.weebly.com/
User avatar
Dakutis
lagoon predator
 
Posts: 116
Joined: Wed, 12Nov07 14:17
Location: Lithuania, Kaunas
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Fri, 13Dec27 09:55

Dakutis wrote:Yes it working, cool [img]images/icones/icon14.gif[/img] you save me from few hundrends code lines.

Now very difficult task. In my game all important stats is in the top of every page (like Day , time, money and few more) but I want that player could see and others stats (I can't put all in main line with others because they all don't fit in one line, and I can give him more than one line. So I want to create stats page and some stats put there. Question - how do that. What I need to write in _game.js and in that new page?
I'm glad I could help. [img]images/icones/icon7.gif[/img]

Your next thing is too much for me to discuss here because I don't have all the knowledge. I recommend looking at the example folder in AC. That has a stats page and shows using a variable called inStats to change the score line. It also shows how to save the current page before going to stats so that the player can return to where they left off. I used that example to code into my game. Also, you can look at Tlaero's latest, Coffee with Keisha, that also has an example of how to go to a stats page.

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 Dakutis » Fri, 13Dec27 10:08

Wolfschadowe thanks for your help, I will look at Tlaero example, and if I do not understand - I will wait what Tlaero wrote.
http://dakutisgames.weebly.com/
User avatar
Dakutis
lagoon predator
 
Posts: 116
Joined: Wed, 12Nov07 14:17
Location: Lithuania, Kaunas
sex: Masculine

PreviousNext

Return to The workshop of creators

Who is online

Users browsing this forum: No registered users and 2 guests

eXTReMe Tracker