Adventure Creator original thread

Tips, techniques and tutorials about creation tools.

Re: Adventure Creator main thread

Postby kexter » Tue, 15Sep29 09:26

Yes, we are talking about the 4-line TextBox (HeaderDataBar.tbTopText), that has "Text:" written next to it.
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby Mortze » Tue, 15Oct06 23:55

Hi guys,

I come to you two reasons:

1/ Inquire if it would be useful to have in AC some (upper) text options like italic, bold, and colours for the text. I know, and somebody explained it here, that there is a way to do that but it involves code. AC is done to facilitate dumb artists in code like myself I ask if that would help overall creators

2/ I'm looking for help concerning a function I have to code. Here is what I need.
The scene is for the player to do several actions. Some are good, others are bad. He starts with a score of 10. Every bad action reduces 2 points, every good one adds 2 points.
I need a way that, when he reaches 0 the scene is over.
But since the player can choose good and bad choices on several html files there is some sort of random. He can reach 0 with 5 pages or it can take more pages.

For positive points I don't need a function so much, because they are limitless. The scene doesn't end with a positive point limit. Positive points will only be important to define a scene end A or B. And that is easy to do with a check point and point count function.

Now, please, please ,please. Try to explain to me your wisdom. Better, don't explain it. Just write the code. Simpler for me :lol: Thank you so much!
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator main thread

Postby kexter » Wed, 15Oct07 01:09

Mortze wrote:Inquire if it would be useful to have in AC some (upper) text options like italic, bold, and colours for the text. I know, and somebody explained it here, that there is a way to do that but it involves code.
For BEW I've implemented BBCodes ([i], [b], and [color] tags) but that does not help you with standard AC. You can use <i> and <b> tags for italic and bold text, for anything fancier you have to use <span> tags with custom styling - but that's probably what you've already read a few pages back.

Mortze wrote:2/ I'm looking for help concerning a function I have to code.
I'm just guessing here but if you have a single variable which is set to 10 at the start of the scene, and then on various responses you increase or decrease it by 2 (if you always modify it by two then why not simply modify it by just 1?) then what you want to achieve could probably be done by simply using the Choose() function. So instead of directly jumping to a page (by either specifying a href in AC or using GotoPage('page') in an onclick) you would add Choose('variable', 0, 'goodpage.htm', 'sceneend.htm') to the onclick field of the hotspot or response. This goes to 'goodpage.htm' if 'variable' is greater than 0, else it goes to 'sceneend.htm'. Maybe this will help you, maybe it won't. If it seems too complex then the question you should ask yourself is: do you really have to do it that way? Could it be done in a simpler way?
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Wed, 15Oct07 02:14

For italics in toptext, I just put in html codes. Like, "I didn't know you wanted to do <i>that</i>!"

For the reduction one, I'd write a quick function like this:

Code: Select all
function badResponse()
{
    varMinus("score", 2);

    var score = readVar("score");

   if (score == 0)
   {
       GotoPage("end.htm");
   }

   return false;
}


I suppose I should have had the var functions return the resulting value, though the tradeoff in function complexity for a non-coder is questionable.

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 Mortze » Wed, 15Oct07 02:22

Thanks Kexter and Tlaero.

I should add the function on the onclick field even if I put an href destination?
In another words, for a specific page the player has 2 choices to make, so I define 2 target areas. One leads to a penalisation, the other to more points. So to keep track of the player points I have to put that function always in the onclick field in every pages right?
This is complicated but it will add some interactivity to the game, the way Jason could do with Elsa in the last scene.
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator main thread

Postby kexter » Wed, 15Oct07 02:46

Mortze wrote:I should add the function on the onclick field even if I put an href destination?
With Tlaero's badResponse()-way, you need to add hrefs as usual then add the badResponse() to the onclick fields of bad responses.

But to be a bit cleaner, I'd modify badResponse like this:
Code: Select all
function badResponse(targetPage) {
  varMinus("score", 2);
  return Choose("score", 0, targetPage, "end.htm");
}
And then you wouldn't need to specify hrefs, you'd only need to specify onclicks like this: badResponse('pageXY.htm') and then this would go to pageXY if the score was higher than 0, or to the end of the scene if it was 0 or below. (Rename the function to whatever you'd like to call it and modify "end.htm" as needed.)
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Wed, 15Oct07 03:09

(ridiculous k&r style brackets aside) that's a great function, kexter. I forgot about Choose (sad considering that I wrote it...).

Mortze, kexter is right that you should pass the "good" html page in and have it go between them. If you want to make the function more general, you can pass both the good and bad htms. Of course, if you want to be REALLY general, you can pass the good, bad, and score. But at some point you've made it too much work to type into the onclick. Everything is always tradeoffs.

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 Mortze » Thu, 15Oct08 01:33

Bummer.

Something is not working right with that function.

I tried Kexter's function but it strangly disabled my DeBug mode (and I checked it was on 1).

So tried Tlaero's, but it doesn't seem to work.
I see 2 possible reasons:

1/ I made a mistake copying it, but for the sake of it I'll just copy/paste it here so you can check it

function magstop()
{
varMinus("magsub", 2);

var magsub = readVar("magsub");

if (magsub == 0)
{
Gotopage ("subs90.htm");
}

return false;
}


2/ I put the onclick field wrong.
Just giving an example of what I'm doing:

href subs38.htm onclick varMinus('magsub', 2); checkmagstop()

This is an htm page where the function should work, but it doesn't when I test it.
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator main thread

Postby kexter » Thu, 15Oct08 02:36

If you name the function magstop() then call it like so in the onclick, not checkmagstop(). And it's GotoPage() not Gotopage(). But seriously, my example shouldn't disable debug mode - if the debug stuff is not showing then there's most probably a typo somewhere.
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Thu, 15Oct08 04:16

When debug mode seems to turn off, that's really an indication that you have something wrong in your _game.js file. If it's off on all pages, then you've probably got a an unmatched curly brace. Either too many { or too many }. There should be an equal number of them. If it's only off on the page where you call it in the onclick, it's probably just an issue in the function or the onclick itself. A common issue there is using double quotes instead of single.

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 Mortze » Thu, 15Oct08 12:20

Nope. Didn't worked out. :(

I tried Kexter's function. Copy/pasted it from here. The debug thing is solved so that must have been a typo. But it still doesn't work.

Tried with Tlaero's function and didn't worked too.
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator main thread

Postby kexter » Thu, 15Oct08 13:58

PM me a sample html file you did and your _game.js so I can take a look at what is happening. (No need to send images or anything else.)
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Sun, 15Oct11 04:35

I'm making some changes to AC. I added an option to clean out tiny hit targets and now block you from making hit targets smaller than 35x35. A certain upcoming game had a ton of invisible targets and I wanted to make it easy for the developer to clean them up.

I also made it remove the last extraneous <br> from toptext when you save the file. If you have 3, it'll remove one of them each time you save. (-: If you want extraneous <br>s just add a space after it.

I checked why CTRL-A doesn't work in toptext. It's because we changed it to be a multiline textbox. For whatever reason, multiline textboxes don't support Ctrl-A (per MSDN). I verified it by making the textbox single line, and CTRL-A started working again. I'll stick with multiline, though. Home, shift+End is easy enough to select all the text if you want to do that.

I'll probably add the coloring for the memories in imageviewer for Wolf.

I'd like a way to see the images from a given folder that aren't used in the game. I'm thinking through the right UI for that. Not sure if that'll be in this version or next.

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 Mortze » Sun, 15Oct11 12:45

Cool news.
Does the new AC automatically deletes the target areas lower than 35x35 or must we do something for that to work?
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Sun, 15Oct11 19:36

You'll set a "Remove tiny areas" setting in the Edit menu and then Update All. If you leave the setting on, it'll automatically remove any new ones on a page when you save it. Though, I think I've now got it so that it won't create new ones in the first place...

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

PreviousNext

Return to The workshop of creators

Who is online

Users browsing this forum: No registered users and 27 guests

eXTReMe Tracker