Adventure Creator original thread

Tips, techniques and tutorials about creation tools.

Re: Adventure Creator main thread

Postby Mortze » Wed, 15Jul08 16:11

Hello.
I wonder if - and I'm sorry if there is already an answer somewhere here - there is a way to have different colours in the textes. Say, a description in the normal yellow, followed by what a npc would say in pink?
Also, if that doesn't exist, couldn't it be worht a thought for creators who would like to make games with moral aligned dialogues like in Mass Effect, blue for paragon, red for mercenary and white for neutral?
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, 15Jul08 16:56

discofox wrote:Could someone help me out and explain why you can't see "Your current score is _." but you can see "Save" and "Restore"? Thanks.
That's because it's black text on black background. Add the following to _style.css to make the text white:
Code: Select all
body { color: white; }
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby kexter » Wed, 15Jul08 17:15

Mortze wrote:I wonder if [...] there is a way to have different colors in the texts. Say, a description in the normal yellow, followed by what a npc would say in pink?
You can do it the following way:
Code: Select all
<span style="color: #FF69B4">"I love you, Pumpkin."</span>
<span style="color: #FF7619">"I love you, Honey Bunny."</span> he says then stands up holding a gun, <span style="color: #FF7619">"All right, everybody be cool, this is a robbery!"</span>
<span style="color: #FF69B4">"Any of you fucking pricks move, and I'll execute every motherfucking last one of ya!"</span>

This will show up in game as:
"I love you, Pumpkin."
"I love you, Honey Bunny." he says then stands up holding a gun, "All right, everybody be cool, this is a robbery!"
"Any of you fucking pricks move, and I'll execute every motherfucking last one of ya!"

Or with a much cleaner approach:
Add these to _style.css:
Code: Select all
.pumpkin { color: #FF7619; }
.honey-bunny { color: #FF69B4; }

And the you'd just have to specify the class for the spans, and you could tweak the colors later if you don't like them simply by modifying the CSS. So the above stuff would be just:
Code: Select all
<span class="honey-bunny">"I love you, Pumpkin."</span>
<span class="pumpkin">"I love you, Honey Bunny."</span> he says then stands up holding a gun, <span class="pumpkin">"All right, everybody be cool, this is a robbery!"</span>
<span class="honey-bunny>"Any of you fucking pricks move, and I'll execute every motherfucking last one of ya!"</span>


Mortze wrote:Also, if that doesn't exist, couldn't it be worth a thought for creators who would like to make games with moral aligned dialogues like in Mass Effect, blue for paragon, red for mercenary and white for neutral?
With the above trick you can do this manually. Or try something like the following snippet (add it to the end of your _game.js of "Dreaming with Elsa", it's tied to the black-and-white, etc variables and it will highlight most "renegade/paragon" dialogue options):
Code: Select all
function gameBottomInit() {
  "use strict";
  var i, s, divs;
  // Annotate dialogue responses.
  divs = document.getElementsByTagName("table")[0].getElementsByTagName("a");
  for (i = 0; !!divs && i < divs.length; i++) {
    if (typeof divs[i].onclick === "function") {
      s = divs[i].onclick.toString();
      if (s.indexOf("'white'") > -1) {
        divs[i].parentNode.style.boxShadow = "0 0 5px 0 #08f inset";
      } else if (s.indexOf("'black'") > -1) {
        divs[i].parentNode.style.boxShadow = "0 0 5px 0 red inset";
      } else if (s.indexOf("'gray'") > -1) {
        divs[i].parentNode.style.boxShadow = "0 0 5px 0 #fff inset";
      } else if (s.indexOf("'silver'") > -1) {
        divs[i].parentNode.style.boxShadow = "0 0 0 1px #ccc inset";
      } else if (s.indexOf("'tin'") > -1) {
        divs[i].parentNode.style.boxShadow = "0 0 0 1px #880 inset";
      }
    }
  }
  showScore();
  debug();
}
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby Mortze » Wed, 15Jul08 19:21

[img]images/icones/icon9.gif[/img]
I wish I hadn't asked that! :crazy:

Now seriously, thank you for the reply. I understand the logic and it is simply to do. But personally that's too much work for a lazy bum like myself.

BTW, nice Tarantino reference [img]images/icones/icon7.gif[/img]
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator main thread

Postby discofox » Wed, 15Jul08 21:42

Thanks for the reply, kexter. [img]images/icones/icon7.gif[/img]
User avatar
discofox
Pilot fish
 
Posts: 3
Joined: Wed, 15Jul08 03:13
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Thu, 15Jul09 05:08

Thanks for answering that, Kexter. I definitely like the css way better. You're guaranteed to change your mind on the colors at least 3 times during development of the games, so you need to be able to change them in one place. (-:

You could also use the spans mechanism, but type less if you used a few wrapper functions that take the string and add the span around it. I don't have time to write the functions now, but in AC, it would look like this.

Make a choice. [[P('This is paragon text')]] but [[R('this is renegade text')]].

Then, in your _games.js you'd make two simple functions, P and R, that wrap the strings in spans and document.write them out.

I've toyed with the idea of having different characters speak in different colors, but I keep coming back to the fact that we've gone millennia with written works where multiple people speak in dialog, all in the same color, and the readers understand. So the cost/benefit never seems to be there.

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 luke » Thu, 15Jul09 12:15

kexter wrote:"I love you, Pumpkin."
"I love you, Honey Bunny." he says then stands up holding a gun, "All right, everybody be cool, this is a robbery!"
"Any of you fucking pricks move, and I'll execute every motherfucking last one of ya!"

This dialog remind me something... A great movie with a great soundtrack...
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: Adventure Creator main thread

Postby Wolfschadowe » Thu, 15Jul09 19:25

luke wrote:
kexter wrote:"I love you, Pumpkin."
"I love you, Honey Bunny." he says then stands up holding a gun, "All right, everybody be cool, this is a robbery!"
"Any of you fucking pricks move, and I'll execute every motherfucking last one of ya!"

This dialog remind me something... A great movie with a great soundtrack...
Makes me crave a Royale with Cheese, for some reason.

I like the function idea that Tlaero mentioned. It would probably look something like:

Code: Select all
function pink(text) {
var pinkstuff;
pinkstruff = ',color=#FF69B4]' + text + '[/color]';
return pinkstuff;
}
I suspect if you use contractions with this, you would need to write them with a "/" for example in toptext [[pink("We can\'t go running because it\'s raining.")]] The slash tells the code to use the single quote as an apostrophe instead of ending the concatenate in the function itself. I'm sure Kexter or Tlaero will quickly correct me if I got the context wrong. :)

EDIT - Kexter was nice enough to send me corrections via PM. Thanks Kexter!
kexter wrote:
Code: Select all
function pink(text) {
  return '<span class="pink">' + text + '</span>';
}


This should be adequate, with a CSS definition for the "pink"-class:
.pink { color: #FF69B4; }


He's just skipping the somewhat redundant declaration and filling of the variable, and also didn't use bbcode, like I did, that won't work in AC. :)
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 kexter » Thu, 15Jul09 20:39

Wolfschadowe wrote:kexter was nice enough to send me corrections via PM.
Correction to the correction.
Code: Select all
function pink(text) {
  document.write('<span class="pink">' + text + '</span>');
}
This is how it works in baseline-AC. And only for the top/bottom text and the dialogue options. Not for the areas/hotspots.
The above stuff that Wolfschadowe did (returning the text, BBCode), only work in the BEW-codebase.

@tlaero:
Feature request: Unify [[func()]]-handling in AC as well, drop document.write() and use the function return values everywhere.
Proposal: Build everything with functions, instead of inline writing it. So basically add the setText(), setImage(), and addResponse() functions akin to addArea(). And aggregate all calls at the bottom in a single script-tag.
Code: Select all
<script>
  setText("Main text.");
  setImage("image.jpg");
  addArea(/*...*/);
  addResponse(/*...*/);
  // etc...
</script>
@kextercius
User avatar
kexter
Moderator
 
Posts: 214
Joined: Sun, 13Dec29 11:01
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Fri, 15Jul10 02:42

I suggest against calling the function "pink." You should call it by what it is (IE P for paragon or E for Emily). That way when you change your mind and make Emily's text blue instead of pink, you only have to change it in one place.

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 luke » Fri, 15Jul10 12:05

Wolfschadowe wrote:Makes me crave a Royale with Cheese, for some reason.

[img]images/icones/icon7.gif[/img]
It's because of the metric system...
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: Adventure Creator main thread

Postby Mortze » Thu, 15Jul23 16:26

Hello.

Have a litle doubt here.

I am trying something where the player has a choice of two lines. The first gets one variable to go +1, and the second will make the variable go +2.
The +1 works but the +2 doesn't.
I put varPlus2('variable'). Is that correct? If not is there another way to make a variable go up more than 1 point?

Cheers!
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator main thread

Postby Wolfschadowe » Thu, 15Jul23 17:10

In this case, you would need varPlus('variable', 2). varPlus1() is simply a shortcut for varPlus('variable', 1). Using varPlus() you could do any number, like varPlus('variable', 21013)....which must have been one HELL of a kiss. [img]images/icones/icon17.gif[/img]
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 Mortze » Thu, 15Jul23 17:41

Worked lovely. Thanks!
User avatar
Mortze
legend of the South Seas
 
Posts: 648
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: Adventure Creator main thread

Postby tlaero » Mon, 15Jul27 02:02

Hey Wolf,

I'm implementing the comment block you asked for. I'm currently planning to put it into Game View and Dump Game View, but not Dump Game Text. My primary use for dumping the game text is spell checking, and it doesn't seem that you'd want to flag spelling errors in the page comment. What do you think?

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

eXTReMe Tracker