Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - bx83

#581
Hi,

I've been wanting to write a piece of text in the game to describe an object, and bring it up on an overlay at the bottom-centre of the screen. Something like this:


I've been searching, but still can't find how to do it. Also I've been having problems with overlays... which basically means I don't know how to use them :P

Here's my code for the mouse graphic - it updates to an 'active cursor' when we're over something we want to look at/talk to/interact with/etc:
Code: ags

function UpdateMouseGraphic ()
{
  int newGraphic;
  int lt = GetLocationType(mouse.x, mouse.y);

  if (mouse.Mode==eModeUseinv) return;

  if (mouse.Mode==eModeWalkto) {
    newGraphic=3; //stand still
    if (gInventory.Visible==true) {
		} else if (GetWalkableAreaAt(mouse.x, mouse.y) !=0) {
      newGraphic=2054;  //walking
    }
  }
  
  else if (mouse.Mode==eModeLookat) {		//LOOKAT
    newGraphic=105; //eye close
    Hotspot *hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
    Object *ob = Object.GetAtScreenXY(mouse.x, mouse.y);
		InventoryItem *inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

		if (gInventory.Visible==true && inve!=null) {
			if (inve.IsInteractionAvailable(eModeLookat)) {
				newGraphic=2056;  //eye open
			}
			
		//looking at hotspot
    } else {
			if (lt == eLocationHotspot) {
				if (hs != hotspot[0]) {
					if (hs.GetProperty("hidden")==false) {
						if(hs.IsInteractionAvailable(eModeLookat)) { 
							 newGraphic=2056;	//eye open
						}
					}
				}
			}
			
			//looking at object
			else if (lt == eLocationObject && ob.IsInteractionAvailable(eModeLookat) && ob.Visible == true) {
				newGraphic=2056;  //eye open
			}
		}
	}
	
  else if (mouse.Mode==eModeInteract) {		//INTERACTION
    newGraphic = 2;  //interact off
    Hotspot *hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
    Object *ob = Object.GetAtScreenXY(mouse.x, mouse.y);
		
 		InventoryItem *inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

		//interacting with inventory item
		if (gInventory.Visible==true && inve!=null) {
			if (inve.IsInteractionAvailable(eModeLookat)) {
				newGraphic=286;
			}
		} else {

			//interacting with hotspot
			if (hs != hotspot[0]) {
				if (hs.GetProperty("hidden")==false) {
					if (hs.IsInteractionAvailable(eModeInteract)) {
						newGraphic=286;
					}
				}
			}
			
			else if (lt == eLocationObject) {
				if (ob.Visible==true) {
					if (ob.IsInteractionAvailable(eModeInteract)) {
						newGraphic=286;
					}
				}
			}
		}
	}
	
	else if (mouse.Mode==eModeTalkto) {		//TALKTO
		newGraphic = 2058;  //talk off
		Character *ch = Character.GetAtScreenXY(mouse.x, mouse.y);
		Object *ob = Object.GetAtScreenXY(mouse.x, mouse.y);
		InventoryItem *inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
		
		if (gInventory.Visible==true && inve!=null) {
		} else {
			if (lt == eLocationCharacter) {
				if (ch != null) {
					if (player.ID != ch.ID) {
						newGraphic = 213; //talk on
					}
				}
			}
			else if (lt == eLocationObject && ob.Visible && ob.IsInteractionAvailable(eModeTalkto)) {
				newGraphic=213;
			}
		}
  } 

  if (newGraphic != mouse.GetModeGraphic(mouse.Mode)) {
    mouse.ChangeModeGraphic(mouse.Mode, newGraphic);
  }
	
}


I'm assuming that after each MouseMode check, I put the decription in after every "newGraphic = ACTIVE_ICON" line:
Code: ags

...
if (mouse.Mode==eModeTalkto) {		//TALKTO
newGraphic = 2058;  //talk off
Character *ch = Character.GetAtScreenXY(mouse.x, mouse.y);
		
if (lt == eLocationCharacter) {
	if (ch != null) {
		if (player.ID != ch.ID) {
			newGraphic = 213; //talk on
                        Overlay "this is a "+character.Description;
		}
	}
}
...


Is this correct? Should I do something simple like this?
What is the correct Overlay code?
#582
Well, did the frames myself. Quicker than I thought it would be, but working off the TSV file means I have to use a custom delay for *every frame* - I didn't bother. Most of it works. I just put the stop frame code in at the points where there was a pause, 80% of the rest is like semi random speech. Meh.
I await your edit, probably, in 3 months or whatever :P
#583
Yep, as I thought.
I was thinking of that (separate speech animation), but this could be veeeeery tedious. But it looks like my only option, for the moment.
I can wait a month though, I have until the end of the year and this is minor.

Also, I can pay...? ;)

PS - You could attach this to a run-one-time function? Like is (message=="JUSTTHIS") then do this else do everything as normal.
#584
Well I've run into a problem :(

The speech is said simultaneously; but only the second speech bubble (SayBubble as opposed to SayBackgroundBubble) is getting the lipsync right.
I use TotalLipSync 5.0 - Here

Why is this happening? No other combination of the code get's the 1st person (Julius) to lipsync correctly. What is it with Bakground?

Exactly as in my game:
Code: ags

SetGameOption(OPT_CROSSFADEMUSIC, 0);      
game.bgspeech_stay_on_display = 1;
chan1 = aCombinedLine_110_1321.Play(eAudioPriorityNormal, eOnce);
cJulius.SayBackgroundBubble("&1321 We are very sorry to makers of Everyone Loves Raymond. He is not our own creation and wholly the property of 'Where's Lunch', 'Worldwide Pants', and 'HBO Independent Productions'. Thankyou for viewing our slapstick play. Peace out.",true);
cNerd.SayBubble("&110 We are very sorry to makers of Everybody Loves Raymond. He is not our own creation and wholly the property of 'Where's Lunch', 'Worldwide Pants', and 'HBO Independent Productions'.");
cJulius.StopBackgroundBubble();
aCombinedLine_110_1321.Stop();
SetGameOption(OPT_CROSSFADEMUSIC, 2);


Yes, the .TSV's are correct and exist in Compiled/sync and Compiled/Windows/sync.

UPDATE: I was missing a piece of code that allowed SayBackgroundBubble to animate:

Code: ags

bool SB_sayBackgroundAnimateImpl(this Character*, String message)
{
    this.SaySync(message);        //<--- THIS LINE
    return true;
}


Now, the speechbubble is displayed (behind another speechbubble with exactly the same text and no background..?), and speech animation is animated.
BUT NOW nothing is simultaneous; because (I assume) TotalLipSync has a function which animates the lines... that's a blocking function! :cheesy::cheesy::cheesy:
So everything blocks, and 1 line is said after the other, Background or not.
So I don't know, I give up. :/
#585
Solved - it's a number. You just check the loop; don't bother converting. If you use the "eDirection" variables, these aren't strings - they are a "string" *representation* of a list numbers.
:)
#586
I'm sure I'm missing something really, really obvious. Here's the code:

in GlobalScript:
Code: ags

function CheckLoop (this Character*)
{
	if (this.Loop==0) { return "eDirectionDown"; }
	if (this.Loop==1) { return "eDirectionLeft"; }
	if (this.Loop==2) { return "eDirectionRight"; }
	if (this.Loop==3) { return "eDirectionUp"; }
	if (this.Loop==6) { return "eDirectionDownLeft"; }
	if (this.Loop==7) { return "eDirectionUpLeft"; }
	if (this.Loop==4) { return "eDirectionDownRight"; }
	if (this.Loop==5) { return "eDirectionUpRight"; }
}


First, this function takes the loop of an 8-directon character, then returns a String depending on what it is.
Yes, I checked this was in the header: all correct.

In OLD_ROOM:
Code: ags

    savex=cJulius.x;                           //save character's current X position  
    savey=cJulius.y;                           //save character's current Y position
    savedirection=cJulius.CheckLoop();         //get direction of character as String, and save it also
    cJulius.ChangeRoom(NEW_ROOM, 2000, 2000);  //change to new room


This saves the position in a room to temporary variables (savedirection is a String), and then changes to a new room NEW_ROOM, with the character (cJulius) off-screen (background is 1024x768).

In NEW_ROOM:
Code: ags

cJulius.ChangeRoom(OLD_ROOM, savex, savey, savedirection);


When we go *back* to OLD_ROOM with the above command, the temporary storage of the character's last position is restored, and we travel back to room OLD_ROOM.

Error is:
(line 3, GlobalScript, first if statement in CheckLoop) Type mismatch: cannot convert 'string' to 'int'

OLD_ROOM is a normal room
NEW_ROOM is a 'detail' or 'feature' room - it doesn't have Characters and Objects, rather it is a close-up of an object in a room; a puzzle in this "room" is solved, then we go back to our normal story-driven, visible character room and get on with things.
#587
I don't use Git, I have windows, don't want to learn something after the whole of AGS just to keep a backup. This game is my life, made backup a while ago.
But anyway, yes I'll look into Git :P
BTW is it built in as the Source Control in General Settings (?) or do you just use it where you've saved the game?
#588
Also, to set the game fade in/fade out option correctly:

Code: ags

    SetGameOption(OPT_CROSSFADEMUSIC, 0);
    [do all code from example above]
    SetGameOption(OPT_CROSSFADEMUSIC, 2);


I found the sound was fading in/out whether this was sample was set as Sound, Music (which is supposed to have the crossfade effect), or "3 [unknown]" (whatever the hell that is).
#589
Matty: great :) I wait anxiously for the next major release :)  (because installing 2 versions on one computer is... inadvisable)
Crimson: True true; you could include a test picture with the editor (mask_test.BMP), with the first 15 colours shown exactly (like a tv test image), and saved as an 8bit RGB .BMP image? This would be a much simpler solution and would save everyone the hassle of having to create and save an image of an exact specific type.

Actually... there are some things that get me about AGS, namely the regular no-backsies choices.

For example... everything in the Room Editor.
Change the position of the character? Wanna change it back? You can't.
Change border position of walk-behind cut-off position? Oh well, you're screwed.
Change the background of the room, then realised the original was the only copy because you changed it, deleted it, and forgot to export it? You're done.

This results in me keeping copious amounts of backups - could we have this with the undo list applying to the room editor, and not just the text script editor? And any other no-turning-back parts of the Editor?

Please remember: I'm fully willing to pay. One other thing that we could use a change with, that would lessen development time by a factor of 50.
#590
I tried the solution:

Code: ags

game.bgspeech_stay_on_display = 1;
chan1 = aCombinedLines.Play(eAudioPriorityNormal, eOnce);
cJulius.SayBackgroundBubble("a slightly longer line",true);
cNerd.SayBubble("a bit shorter line");
cJulius.StopBackgroundBubble();
aCombinedLines.Stop();


The result was the only one that worked; I tried all the others, but they had a habit of: allowing one character to lipsync, but not the other; giving non-blocking to one character, so that clicking anywhere would have him move, and then cause an error; etc. etc. etc.

Granted, some of these were perversions of what you wrote originally, some were combinations, and some had 'true' as a second argument, or the longer line first/last, *BUT*, this one works all the time ;)
#591
Cool :)

What I meant by drawing tools was to have them in the actual editor; but I could use an external one.
'Better mask control' means 'having masks which are more than 256 colours'.

PS also could you included a more-than-1 undo events (ie. be bale to undo the last 200, rather than 1)
#592
It's convenient. One minute with this in use was enough.
When is this being applied to the main branch, 3.4.1, 3.4.2,..?
Because if it still can be, I'm happy to pay for it rather than having it sit as a possible future arch for another 3 years.
ps. will need better mask control and also image editor tools in-screen (paint brush, erase tool, line-finding/'magnetic' point selection tool in future?)
#593
So I mean.... money? Anyone interested? *Somebody* must be.
#594
Snarky, could I do the following:

Code: ags

cJulius.DisplayABubbleNonBlocking("this is a line")
cSomeoneElse.DisplayABubbleNonBlocking("this is a line, too")
chan1=TheCombinedLineOfTwoPlayers.Play(prioritynormal,once);
#596
Basically, I'm in too deep. I've already made 70% of the game with AGS, can't pull out now. It would mean a complete reconstruction of the script, graphics, waklable areas and walk behinds, integration into a different kind of system, many subtle differences between the two - etc etc etc.

Also, I *like* AGS - I can see it's "potential", so to speak (patronisingly). I want it to be good, and a few small changes would make it better and easier, and thus good competition for paid stuff like unity. If it costs $3,000 out of my budget to save 50hours development time, so be it.
#597
Snarky and Crimson, exactly that. No plugins for this? Is it possible with the sound system, perhaps if I just did play(someline, noblock)?
#598
Crimson, would you? Would it be done quickly, like, a month?

eri0o, look's good, getting it now...
#599
Could this editor change by Tzach be made currently? Like, by you? Like, for money?.... :3
#600
Advanced Technical Forum / Simultaneous Speech
Tue 23/01/2018 21:20:44
Hi,

I've been trying to find this for some time; and I have someone who I was prepared to pay to make a plugin for it, but he's not avilable atm.

Are there any functions, plugins, or anything else, that can produce code which follows these principles:
-saying lines of character A would be said, and block other lines of the same character (so lines A1 A2 and A3 would be said one after the other, A1 A2 A3)
-saying lines of character A and B would have them both spoken simultaneously, so A1 and B1 would be spoken at the same time.

so:

Code: ags

//said one after the other: - "1 and 2"
cA.SimultanneousSpeech("1 ")
cA.SimultanneousSpeech("and 2")

//said simultaneously
//"1 2 3" 
//"4 5 6" 
cA.SimultanneousSpeech("1 2 3")
cB.SimultanneousSpeech("4 5 6")

//all speech is paused, or cache is cleaned - this makes easy to differentiate A B A from all being played simultaneously
PauseAllSpeech()

//B says something
cB.SimultanneousSpeech("something")
PauseAllSpeech()
//A says something else
cA.SimultanneousSpeech("something else")


Instead of PauseAllSpeech(), perhaps using a blocking function like Say would be easier?..

This allows speech, and lipsync (using TotalLipSync) to work independantly of eachother - in other word, on 2 or 3 characters simultaneously.
SMF spam blocked by CleanTalk