MODULE: Hypertext v1.3 - Change font mid-sentence, web-like pages, Speech bubble

Started by SSH, Fri 08/12/2006 17:07:08

Previous topic - Next topic

SSH

Quote from: Dualnames on Tue 11/03/2008 10:50:00
Kill me for digging this but it's very important if someone cares to use it for AGS 3.0

First if new-strings is set to true it means that you have to replace a lot of functions in the module. 780 lines is a lot..
Yes, this module only works in AGS3.0+ if you turn of the strict settings, to allow the old RawDraw functions to work. Upgrading my modules to 3.0 is on my todo list!

Quote
Secondly when you add pages you have to make sure that the line of code isn;t bigger than 500.

Yes, AGS scripts have a line length restriction, but you can Add to the same page repeatedly and the new text gets added to the end.

Quote
Don;t do this:
Hypertext.Add("mypage","Get dead really
fast.");

Yes, AGS doesn't allow newlines in strings, but you can use the "[" character, like in normal AGS speech to insert a Line Break

Quote
Also the name of a page shouldn't contain any gaps for your personal convinience.You can;t link it like this _my page|more_.

Page names can contain gaps, but not when used with aliased links like you say. This isn't easy to workaround given the current code. If you want to use a lot of aliased links, try using underscores, dots, or CamelCase in your page names, instead of spaces.

Quote
Also leave a gap before each _ and after one_
ex:
Get dead or what _my page_ .
Or put the full stop inside the '_'s

Quote
If you don;t folllow my advice you'll get a message I got. AGS failed in drawing... and some stuff.

If you get an error, you can post it here and I can sort out the problems! But vague references don't really help!
12

SSH

Bumped for new version: now works in AGS 3.0 wihtout any faffing about, and should also be a bit faster.
12

Dualnames

Damn , you. Did you have to wait for me to make 56 pages to change it?
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SSH

But you can just remove the current module and load in the new one. It shouldn't change the pages you've made at all.
12

riseryn

Hi
thanks for your work :)

I tried to use your module to have speech in bubble.
I have copy/paste example code in a room script(after fadein).
no error at compile time but not bubble although.

Could you please explain how to do this?
I read documentation and this thread but cant manage to understand how to do.

SSH

Please post the code you used and teh AGS version you are using. Also, try putting some other code (e.g.a Display) in the function to make sure it is working.
12

riseryn

Im using 3.01 final

I just copy/paste this code from demo game

Code: ags

function room_AfterFadeIn()
{
Hypertext.SetPrefixStyle(HYPERTEXT_NORMAL, 4, eHypertextSpecial_None, 0, 0, 0);
Hypertext.SetPrefixStyle(HYPERTEXT_LINK, HYPERTEXT_KEEP, eHypertextSpecial_Underline, 240, 0, 40);
Hypertext.SetPrefixStyle(HYPERTEXT_VISITED, HYPERTEXT_KEEP, eHypertextSpecial_Overline, 180, 40, 0);
Hypertext.SetPrefixStyle('=', 8, eHypertextSpecial_Box, 0, 0, 0);
Hypertext.SetPrefixStyle('^', HYPERTEXT_KEEP, eHypertextSpecial_Strikethrough, 255, 255, 255, 0,60,0);
Hypertext.SetPrefixStyle('*', 4, eHypertextSpecial_Bold);
Hypertext.SetPrefixStyle('/', 6);
Hypertext.SetPrefixStyle('+', 7, eHypertextSpecial_Crossout);  
Hypertext.SetPrefixStyle('_', 3, eHypertextSpecial_None, 255, 0, 0);
Hypertext.SetBubbleColour(255, 255, 255, 0, 0, 0);
Hypertext.SetBubble(3, 3, 8, 5, 5, 5);


player.Say("hello");
}


I notice that in demo game code is in hotspot interaction.
Is it mandatory?


Thanks for your answer :)

SSH

You need to use:

Code: ags

Hypertext.Say(player, "Hello")
// not player.Say...

12

riseryn

Thanks 
I now have speech in bubble, however bubble appears top of the screen instead above character head.

My game is 800x600 32bits colour depth direct 3d 9 graphics driver

SSH

12

riseryn

Its Lucasart.
But its the same thing with other mode.
bubble appears on top of the screen

SSH

12

riseryn

I have 2 characters

first x=140 y=209

second  x =177   y=209

i just use this code in after fadein

Code: ags

Hypertext.SetPrefixStyle(HYPERTEXT_NORMAL, 1, eHypertextSpecial_None, 0, 0, 0);
Hypertext.SetBubbleColour(0, 0, 0, 255, 255, 255);
Hypertext.SetBubble(3, 3, 8, 5, 5, 5);





SSH

12

Dualnames

I actually have lucas arts style and it;'s working good. You probably haven't set the module's settings to work the right way.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

riseryn

Quote
You probably haven't set the module's settings to work the right way.
yes  thats all my problem I guess.

Can you give me an example of a proper setting?

EDIT
ok problem solved.
It was caused by scaling level.

SSH will give us a fix soon :)

Dualnames

well, I'm replying either ways. There's a part at the module script(asc) that has at the function game start a list of setting for the Hypertext. Which are default if you don;t put your own.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SSH

The problem was that I didn't take scaling into account in calculating where "above a character" was, so when a character was scaled down small, like riseryn's, the module placed the text above his head as if he were unscaled, meaning a huge gap. Its an easy fix, but I ain't got the code on this computer easily to hand.
12

FrancoFranchi

Sorry for bumping this, but I've been fiddling around with the demo-game and re-reading the documentation but I'm not sure how to deal with this (seemingly basic) question:

How can you call a function after a user has clicked on a specific hypertext link?

I've got the pages set up on a GUI button, that the player needs to click through; once they reach the relevant entry, I need to add an inventory item.  As you call all the Hypertext pages with the 'Add' function at the room load, I'm not sure what you'd use to indicate exactly when a user has reached the right link? I'm sure it's straight-forward but I've hit a stumbling block as a beginner. 

Any help appreciated :)

Sektor 13

So it is not possible to display bubble over "player.say()" ?

This could be usefull module, but i have a lot of text already written. I don't want to go back and rewrite it all (i am too lazy!).

SMF spam blocked by CleanTalk