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 - Nixxon

#1
And guess what??

Now it lets me add as much text as I like into the GUI Label.

Unbelievable.

I'm all sorted now. Sorry.

EDIT - I am guessing I didn't have the GUI Label window large enough, so that it was appearing to cut off text. I assumed this was a limit on the text field, instead of just dragging the Label window larger. That's what we're dealing with here :S :S
#2
Thanks Crim,

Essentially, I have 5 messages that fade in / out during an intro scene.

Currently, I am using GUI background graphics.

The background graphic number changes each time there's a new fade it. This works ok.

Code: ags
gIntro.BackgroundGraphic = 215;
Wait(120);
gIntro.Transparency = 100;
while (trans > 0)
{
        trans--;
        gIntro.Transparency = trans;
        Wait(1);
}
Wait(160);
while (trans < 100) {
  trans++;
  gIntro.Transparency = trans;
  Wait(1);
}



I just thought, it would be better to use GUI Text Box or GUI Label instead as I can change the text on the fly if required, without having to re-save and import sprites if I choose to update some of the story text.

It also looks cleaner and more consistent with the AGS fonts within the game.

I tried two methods, and both worked with caveats.

1. (using GU Text Box)
Replacing  - gIntro.BackgroundGraphic = 215;
With - TextBox1.Text = "Story Message 1"; //etc.

= The text is not centered.


2. (using GUI Label)
Replacing  - gIntro.BackgroundGraphic = 215;
With - StoryLabel1.Visible = true;

= Limit on how many characters you can use in the Text input field on labels.




#3
Hi Gang,

Is there a way to align-center TextBox text?

It's the last hurdle after getting some intro text to finally work.

I see in the manual there are options for -

TextBox.Font
TextBox.ShowBorder
TextBox.TextColor

The GUI labels have an option for alignment, however there is a character limit on those.

#4
Thanks Slasher,

The walk behind was working fine, setting the base will definitely help down the road.

#5
Thanks Guys,

It's a bit of complicated scene.

The problem is that the walkbehind is affecting the object.

I've even created a new object in front, set it's baseline to 999 and it's still being masked by the walkbehind. Driving me a bit crazy at the moment.

I'll try and post a detailed image.

EDIT - Don't you hate it when you delete and object and pretty much kill your room script....

EDIT - I've imported a brand new object and that's worked as a temporary walk behind. Not sure what was wrong with the original object I was trying to use.

Basically, there's an object, then a character in front of that object, then another object in front of that.
#6
Hey Gang,

I note that Character.IgnoreWalkbehinds and Object.IgnoreWalkbehinds have been deprecated in version 3.5

- All functions that find room objects under screen coordinates are now being clipped by the viewport (fail if there's no room viewport at these coordinates). This refers to: GetLocationName, GetLocationType, IsInteractionAvailable, Room.ProcessClick, GetWalkableAreaAt and all of the GetAtScreenXY functions (and corresponding deprecated functions).

I've had a trot through the viewport sections in the reference Manual, but it's all a little abstract to me.

Is there an easy way to disable a walk-behind area using a simple script command in the room code?

Much love.
#7
Arrgh, damn it. How did I miss that....

It works beautifully!

#8
Thanks Snarky!

I didn't even think to check the manual on this one, as it was module. Had no idea it would be so easy as to find / replace. That's neat!

I now appear to be getting this crash error however.



I must be implementing the code wrong, as I cannot see how it can loop the commands.

below is an excerpt from the room script.

Code: ags
function region1_WalksOnto()
{
 cEgo.Walk(355,  142,  eBlock,  eAnywhere); //cEgo Walks onto platform
 cEgo.ChangeView(4); // cEgo invisible
 object[3].Visible = true; // Begin lock sequence
 object[3].SetView(16);
 object[3].Animate(3,  3,  eOnce,  eBlock);
 object[1].Visible = false; // turn off light glow
cBase.Say("Perfect, now get out and go over to that control panel");
oTruck.Visible = true; //Click Surveyor
OnPlatform = 1;
BgSpeech.Start(0);
BgSpeech.Add (cBase,  "Get out of the Surveyor");
BgSpeech.Pause (80);  //Two Second Pause
BgSpeech.Add (cBase,  "Stop dicking around");

}


I've tried pasting the BgSpeech code in a few other areas within the room script to no avail.
#9
I'm having some issues with this module.

Error when compiling after importing the script.

BgSpeech.asc(33): Error (line 33): '.ViewportWidth' is not a public member of 'System'. Are you sure you spelt it correctly (remember, capital letters are important)?

Code: ags
static void BgSpeech::Start (BgSpeech_LoopStyle looping, int queueIndexToStartFrom) {
  
  if (t > p ) 
    t = 0;
  else
    t = queueIndexToStartFrom;
  
  oLoop = looping;
  
  if (!wait[t]) {
    if (at[t] == true)
      oSpeech = Overlay.CreateTextual (oX[t], oY[t], System.ViewportWidth - oX[t], 
                                       Game.SpeechFont, character[charID[t]].SpeechColor, oText[t]);
    else 
      oSpeech = character[charID[t]].SayBackground (oText[t]);
  
    if (anim[t]) {
      int l = character[charID[t]].Loop;
      character[charID[t]].LockView (character[charID[t]].SpeechView);
      if (l == 0)
        character[charID[t]].Animate (0, character[charID[t]].SpeechAnimationDelay, eRepeat, eNoBlock);
      else if (l == 1)
        character[charID[t]].Animate (1, character[charID[t]].SpeechAnimationDelay, eRepeat, eNoBlock);
      else if (l == 2)
        character[charID[t]].Animate (2, character[charID[t]].SpeechAnimationDelay, eRepeat, eNoBlock);
      else if (l == 3)
        character[charID[t]].Animate (3, character[charID[t]].SpeechAnimationDelay, eRepeat, eNoBlock);
    }
      
    float c = (IntToFloat(oText[t].Length) / IntToFloat(BGSPEECH_TEXT_READING_SPEED)) * IntToFloat(GetGameSpeed());
    int a = FloatToInt (c, eRoundUp);
    float displayTimeS = IntToFloat(BGSPEECH_MINIMUM_DISPLAY_TIME) / 1000.0;
    displayTimeS = displayTimeS * IntToFloat (GetGameSpeed());
    if (a < FloatToInt(displayTimeS, eRoundUp))
      a = FloatToInt(displayTimeS, eRoundUp);
    SetTimer (1, a);
  }


THIS IS THE ERROR LINE -

Code: ags
    if (at[t] == true)
#10
S'up Gang.

This one is probably a little 'pedestrian'.

I am wanting to have some character background speech display sporadically during a room.

More specifically, the character would speak using 3 or 4 random lines of speech without interrupting the player movement, using the 'Character.SayBackground' command I am assuming.

Ideally, the first string of speech would occur approximately 20-30 seconds after the player character resumes movement in the room.

I thought of doing something in the repeatedly execute. Not sure if that's the best option if a cleaner method is available?

Many thanks.

EDIT: Bugger, looks like I had this exact query a few moons ago and had it sorted. - https://www.adventuregamestudio.co.uk/forums/index.php?topic=52848.0

Actually, I'm still having issues displaying an animation (set character view) to show talking animation. Based on Snarky's last response in the above thread, it isn't really possible without heavy coding and better to use a Module. The most up to date BGspeech module I could find was this - https://www.adventuregamestudio.co.uk/forums/index.php?topic=48086.msg636452160#msg636452160. Unfortunately that gave me a font error in the script on compiling.

I am able to change the character view, however it does not animate. Using the animate.character function throws an error.

SEE LINE 22 -

Code: ags
// room script file
int cBase_speechTimer = 0;
 
// A helper function to simplify the job of background speech with voice
void SayBackgroundClip(this Character*, String message, AudioClip* clip)
{
  this.SayBackground(message);
  if(clip != null)
    clip.Play();
}
 
function repeatedly_execute_always() {
  cBase_speechTimer++;
  if (cBase_speechTimer % 600 == 0) {
    int which = cBase_speechTimer / 600;
    if (cBase.Room != player.Room)
      return; // do nothing
 
    if (which == 1)
    {
      cBase.SayBackground("Unit 19, please report"); // cBase.SayBackgroundClip("&1 DIALOG 1", aPEDO7); --- existing code for speech
      cBase.ChangeView(19); // Changes view, but doesn't animate using loop
    }
    else if (which == 2)
      cBase.SayBackground("message 2"); // cBase.SayBackgroundClip("&2 DIALOG 2", aStonethrow); --- existing code for speech
    else if (which == 3)
      cBase.SayBackground("message 3"); // cBase.SayBackgroundClip("&3 DIALOG 3", aMonstereat); --- existing code for speech

    else
      cBase_speechTimer = 0; // Loop around
  }
}


Any ideas?
#11
Hey Gang,

I am trying to momentarily disable the increased walk speed whilst using double click, set by default with the thimbleweed GUI.

I've found the below in the help file.

I am unable to find any reference to that code in any of the scripts. Trying to add the code and speed value into my room function would not compile.

Code: ags
Verbs.SetDoubleClickSpeed
void Verbs.SetDoubleClickSpeed(int speed)
Defines the double click speed


Ultimately, I would like to disable the function for a particular portion of the game.

Any help would be greatly appreciated!

EDIT.

Oops, not sure how I didn't see the shiny Thimbleweed folder under the scripts tabs - duh.

I've found this and have changed the variable to false, which has worked. It would be nice to be able to re-enable the function during a room script though. not sure if possible?

Code: ags
  // Character speed is doubled on doubleclick
  Verbs.VerbGuiOptions[eVerbGuiRunOnDoubleClick] = false;



EDIT 2.

Well it looks like you can! Using the above line in the room scripts works fine.


SOLVED - Please delete or leave for future reference.

Cheers.
#12
Hello,

I am seemingly unable to draw walk-behind areas directly onto my backgrounds. I've never had this issue before.

I've been creating objects to get around the problem, but it's a little tedious.

Any help would be greatly appreciated.

Images below -

https://ibb.co/vdtcBM7

https://ibb.co/X3L4VTK


SOLVED:

Sorry, it was only walk-behind ID 1 that was locked. My bad.

#13
Brilliant, thank you.

I don't know why, but i thought the cutscene function was removed years ago.

Thank you again,
#14
Hi Guys,

I've had a bit of a search, but can't seem to find anything relevant.

I have carefully scripted intro scene which uses the wait: command to great effect.

upon creating a GUI with a 'skip button', I am having difficulty getting it work. Not only does the push down graphic not appear, it doesn't run the script (player new room).

I've checked the Z order and all appears to be hunky dory.

I've come to the realization it is likely because the entirety of the intro scene is usually script blocked due to the wait command.

Is there anyway to get around this? Can i have this particular button pause the script?

Many thanks.
#15
I'll drink to that.
#17
Thanks Crim,

Makes sense! It appears to be working flawlessly - I'm afraid to touch it.

might be worth noting that I have added this to the first room script (before load). (this is the room our player restarts in after death).

Code: ags
    Button12.Visible = InventoryWindow2.TopItem > 0;
    Button13.Visible = InventoryWindow2.TopItem + InventoryWindow2.ItemsPerRow < InventoryWindow2.ItemCount;


Otherwise the arrows appear until and inventory item is picked up :)
#18
It doesn't like that Crim.

Code: ags
function Button13_OnClick(GUIControl *control, MouseButton button)
{
InventoryWindow2.ScrollDown();
    Button12.Visible = InventoryWindow2.TopItem > 0;
    Button13.Visible = InventoryWindow2.TopItem + InventoryWindow2.ItemsPerRow < InventoryWindow2.ItemCount;
    UpdateInvScrolls();


GlobalScript.asc(767): Error (line 767): Undefined token 'UpdateInvScrolls'
#19
Oh works a charm Crim. Thank you!! :D

FYI.

This is the code on the Global-script -
Code: ags
function UpdateInvScrolls()
{
    Button12.Visible = InventoryWindow2.TopItem > 0;
    Button13.Visible = InventoryWindow2.TopItem + InventoryWindow2.ItemsPerRow < InventoryWindow2.ItemCount;
}
function on_event(EventType event, int data)
{
    if (event == eEventAddInventory || event == eEventLoseInventory)
    {
        UpdateInvScrolls();
    }
}



Code for Scroll Button/s

Code: ags
function Button13_OnClick(GUIControl *control, MouseButton button)
{
InventoryWindow2.ScrollDown();
    Button12.Visible = InventoryWindow2.TopItem > 0;
    Button13.Visible = InventoryWindow2.TopItem + InventoryWindow2.ItemsPerRow < InventoryWindow2.ItemCount;
}
#20
Thanks Crim!

That code looks super clean. I figured the 2004 thread might have been a little long in the tooth ;)

I opted for the repeatedly execute path (cause ehh). I do get this 'doosey' in the first room code however.

Code: ags
// room script file
function UpdateInvScrolls()
{
    Button12.Visible = ginvwindow.TopItem > 0;
    Button13.Visible = ginvwindow.TopItem + ginvwindow.ItemsPerRow - 1 < ginvwindow.ItemCount;
}



Error message

Failed to save room room1.crm; details below
room1.asc(4): Error (line 4): '.TopItem' is not a public member of 'GUI'. Are you sure you spelt it correctly (remember, capital letters are important)?


Woops, nevermind. I had the GUI name not the invwindow name.

Compiled ok, I will see how it goes :D

SMF spam blocked by CleanTalk