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

Topics - bx83

#81
You can *check* if an interaction is available:
Code: ags
IsInteractionAvailable(eModeTalkto)


I was wondering if you can turn off interactions that are already?
You have an interaction for a character (cCharater_Talk() has been set and filled in with some code); how do you turn this off/on at will?
Or do you have to set a custom property and use this to turn it on or off through various mouse cursor trickery?
#82
Here's the error:

Here's the code:
Code: ags

function room_Load()
{
  if (music_chan==null) {
      music_chan=aNorthfield_pasturisedPastorale_v6_0.Play(eAudioPriorityNormal, eRepeat);
  } else {
    if (music_chan.PlayingClip!=aNorthfield_pasturisedPastorale_v6_0){
      music_chan=aNorthfield_pasturisedPastorale_v6_0.Play(eAudioPriorityNormal, eRepeat);
    }
  }
}


And here's proof the audio was imported:



WTF I may ask?

#83
Is there any way to get the ID of an inventory item?
I want to combine two objects:

Code: ags

cCharacter.Loseinventory(iStuff1);
cCharacter.Loseinventory(iStuff2);
cCharacter.Addinventory(iThing);


However, if I use cCharacter.Addinventory(iThing,0) this creates it at the top of the inventory (not necessarily where original two items were) and cCharacter.Addinventory(iThing) will create it at the bottom (also inconvenient) or some random location.

How can I guarantee that if I add iThing, it will end up where iStuff1/2 were?
#84
I'm trying to use timers as a way of achieving a non-blocking fade-in/out. This is because I want the screen to go gradually black *at the same time* as a piece of fading-out audio ending; not immediately after.
This timer/audio playing is done instead of:

cCharacter.Say("&1 Blah blah blah blah blah blah....");
FadeOut();
Wait(GetGameSpeed()*1);
FadeIn();
cCharacter.Say("&2 .....blah blah blah blah blah blah....");
FadeOut();
Wait(GetGameSpeed()*1);
FadeIn();
cCharacter.Say("&3 .....blah blah blah blah blah blah.");

...because speech is always blocking, so the screen fade-out starts after the audio finishes.
The audio itself fades-out, so for this to happen at the same time as the screen fade-out is ideal.

This is what I've come up with at the moment, which obviously doesn't work.
I've also tried SayBubble() instead of SayBackground() - but of course speech is blocking, so even timers and timer-checking is not worried about.

GlobalScript.asc:
Code: ags

function BuddhistCowIslandSpeech()
{
  game.bgspeech_stay_on_display = 1;

  gTitleCard.BackgroundGraphic=3144;       //size-of-background black graphic
  gTitleCard.Transparency=100;  //invisible
  gTitleCard.Visible=true;

  SetTimer(TIMER_BUDDHIST_FADE_IN_OUT, GetGameSpeed()*22);
  BuddhistFadeInOut=100;
  
  BuddhistFadeInOut_1=true;
  
  aBUDD64.Play(eAudioPriorityNormal, eOnce);    //This audio is the speech part to the following line - so normally it would be: cBuddhistCow.Say("&64 Mooaclah was bored.....
  cBuddhistCow.SayBackground("Mooaclah was a bored creature, with many supernatural powers, and a life many years beyond our own; seriously, he had a better chance than someone who eats fruit and vegetables and does an hour of cardio a day. Like hundreds of times. He was old. One day, Mooaclah knew he couldn't control his kingdom on videogames and pizza alone, so he created many cow-shaped vessels to store his power...");

  //no time to pause here since SayBackground is non-blocking. But... Say is blocking. So....?

  SetTimer(TIMER_BUDDHIST_FADE_IN_OUT,GetGameSpeed()*1);
  BuddhistFadeInOut_1=false;
  BuddhistFadeInOut_2=true;
	
  aBUDD66.Play(eAudioPriorityNormal, eOnce);
  cBuddhistCow.SayBackground("...and they fought, spears and chains clashing against eachother until the god Arktus was finally vanquished; he changed quickly into a mountain sized pile of dirt, and we name him now ''Moorardna'', or, ''the third mountain''. After a time, it became the second age of Agnor, and pending a great flood (caused by the introduction of a new mountain), he built a large boat and fit all of the animals on board.");
	
  aBUDD67.Play(eAudioPriorityNormal, eOnce);
  cBuddhistCow.SayBackground("Horses, cows, ducks and crows; deer and peacock and dog; and some which no longer exist, such as the monkey...");
	
  SetTimer(TIMER_BUDDHIST_FADE_IN_OUT, GetGameSpeed()*5);
  BuddhistFadeInOut_2=false;
  BuddhistFadeInOut_3=true;
  
  aBUDD69.Play(eAudioPriorityNormal, eOnce);
	cBuddhistCow.SayBackground("...and so Elargro said to the one true king, ''Escapod, bring my golden to--");
	SetTimer(TIMER_BUDDHIST_FADE_IN_OUT,GetGameSpeed()*1);
  BuddhistFadeInOut_3=false;
  BuddhistFadeInOut_4=true;
  
  gTitleCard.Visible=false;    //turn off the black GUI; everything back to normal at this point
}

.......

function repeatedly_execute()
{
  //various non-blocking fade-in/out blocks according to which bool is true:

  while(IsTimerExpired(TIMER_BUDDHIST_FADE_IN_OUT)) {
    if (BuddhistFadeInOut_1) {
      BuddhistFadeInOut-=10;
      if (BuddhistFadeInOut<0) BuddhistFadeInOut=0;
      gTitleCard.Transparency=BuddhistFadeInOut;
      SetTimer(TIMER_BUDDHIST_FADE_IN_OUT, 15);
    }
    else if (BuddhistFadeInOut_2) {
      BuddhistFadeInOut+=10;
      if (BuddhistFadeInOut>100) BuddhistFadeInOut=100;
      gTitleCard.Transparency=BuddhistFadeInOut;
      SetTimer(TIMER_BUDDHIST_FADE_IN_OUT, 5);
    }
    else if (BuddhistFadeInOut_3) {
      BuddhistFadeInOut-=10;
      if (BuddhistFadeInOut<0) BuddhistFadeInOut=0;
      gTitleCard.Transparency=BuddhistFadeInOut;
      SetTimer(TIMER_BUDDHIST_FADE_IN_OUT, 15);
    }
    else if (BuddhistFadeInOut_4) {
      BuddhistFadeInOut+=10;
      if (BuddhistFadeInOut>100) BuddhistFadeInOut=100;
      gTitleCard.Transparency=BuddhistFadeInOut;
      SetTimer(TIMER_BUDDHIST_FADE_IN_OUT, 5);
    }
  }
}


Any help anyone can give would be great ;P
#85
I have an inventory with 2 buttons on the side, up and down arrows, which allow you to move through the inventory. When you are at the 'top' or 'bottom' of the inventory (and hence can move no further by clicking the appropriate button), the buttons are still there and still the same graphic.
Is there a way I can I can change the arrow graphic in this situation, to represent it being turned 'off', or make the button invisible?
#86
I'm having trouble, once again, getting the custom dialog rendering options to work.

I first wanted to get an image of the current dialog options, and then keep them there in place while speech continued.
However, since changing the background colour from white to transparent, an 'after image' of my previous option set sits on screen, 'under' the new set of options. (the after-image button graphics are non-functional)

The after image is cleared again when an option is picked.
The after-image lasts between when speech ends, and when the next option is chosen; the speech then starts for this option.

I've tried a few things, and I know the answer is staring me in the face, but I just can't find out where, or what, to put to wipe the after-image options.

Here's a link to my viedo, to demostrate what's happening:
http://redrom.ltd/img/dialog error.webm

Here is my code:
gFakeDialogOptions is a GUI 1366x96 box, that's colour 0
MyDynamicSpriteForTheFakeGUI is a global DynamicSprite*

Code: ags

//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Get Dimensions
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_get_dimensions(DialogOptionsRenderingInfo* info)
{

// Create a 1366x64 dialog options area at (0,704)

  info.X = 0;
  info.Y = 672;
  info.Width = 1366;
  info.Height = 96;
}

//----------------------------------------------------------------------------------------------------------------------
// Draw Dialog Options
//----------------------------------------------------------------------------------------------------------------------

function DrawDialogOptions(DrawingSurface* ds, DialogOptionsRenderingInfo* info)
{
  int i = 1, ypos = 0, xpos = 0;  
  ds.Clear(COLOR_TRANSPARENT);
  while (i <= info.DialogToRender.OptionCount)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      String str = info.DialogToRender.GetOptionText(i);  //get glyph number from option text
      int cur_img = str.AsInt;                            //current image is that number
      ds.DrawImage(xpos, ypos, cur_img);                  //draw this glyph
      xpos += 96;                                         //xpos+=width of glyph
    }
    i++;
  }	
}

//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Render
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_render(DialogOptionsRenderingInfo* info)
{
  DrawDialogOptions(info.Surface, info);
}

//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Repeat Exec
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_repexec(DialogOptionsRenderingInfo* info)
{
  int i = 1, xpos = 0;
  while (i <= info.DialogToRender.OptionCount)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      if (mouse.y >= info.Y && mouse.x >= xpos && mouse.x <= xpos+96)
      {
        info.ActiveOptionID = i;
        return;
      }
      xpos += 96;
    }
    i++;
  }
}

//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Mouse Click
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_mouse_click(DialogOptionsRenderingInfo* info, MouseButton button)
{
  if (info.ActiveOptionID > 0)
  {
    MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
    DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
    DrawDialogOptions(ds, info);
    ds.Release();

    gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
    gFakeDialogOptions.Visible = true;
    info.RunActiveOption();
  }
}


Any help will be welcome.
#87
I'm trying to find out the scaling level of my main character on a particular point of a scaling walkable area.
I've tried:
Code: ags
Display("scaling",cJulius.Scaling);

...but nothing comines out - I just get a window saying "scaling "

Is there a way to get this done?
Checked tha manual - it say's Scaling is a function to get/set the property.
#88
Project:
'The Mystery of Cow Island'

Details:

A comedy adventure game, heavily influened by Sam & Max, Rick and Morty, and general fourth-wall breaking tomfooolery.

Positions Available:

UPDATED 2018-12-18
Hey all, looking for a new animator who can reproduce (but with their own style) the characters in my game (Julius, a sensitive english art-student, and Dr Braun, an old man and a scientist a-la Doc Brown out of BTTF).Click the link below for a good starter-guide: http://redrom.ltd/img/animation_J+DB.zip
(If you cant open it, you'll need WinRAR: https://www.rarlab.com/download.htm)
Yes - the jacket, pants, orange hair, and Braun's goggles and dirty jacket are intentional. Reproduce these.


Animations for both are:
-walking in 8 directions
-talking (in 8 directions) - 9 frames (including standing potion) out of the Rhubarb lipsync program:  https://github.com/DanielSWolf/rhubarb-lip-sync
Please note: for the 9 frames of talking positions, they are 8, +1 standing frames, face completely relaxed. So, they are 8 frames, +the standing frame.

Just Julius:
-leaning down to pick something up (in 8 directions)
-leaning across (waist height) to pick something up (in 8 directions)
-give X object out of jacket - passing it to someone at waist height (in 8 directions-taking an object from some one, same way (in 8 directions)
-making something - like the hand-rotate-around graphic in Desponia or World of Wacraft (in 8 directions)
-wearing all combinations of a pirate hat, clothes, and pipe (have a look at what's already been done)
-speaking with pipe in mouth (8 directions)

Just Braun:
-rising from a kneeling position (1 direction, left)
-kneeling back down again(1 direction, left)

-repairing a car ie. leaning down to side of car and using a wrench on something; perhaps leaning down into engine and noodling around (1 direction, left)-speaking, 9 frames as before, in all in these situations of rising/standing/repairing (in 8 directions).



Further animations sometime soon:
-Julius and Dr Braun have angry facial expressions - all 9 frames of lip-sync, in 8 directions
-Julius '8 bit' - like Julius, but 6 frames, 150px max heigh, and '8bit' graphics
-The watercraft animation - Julius places a watercraft (see below) on the sand, walk into it, comfys himself in the unfamiliar seating, and ends up falling into it; watercraft floats to the other side of the stream, beaches, Julius gets out, and then it sinks with a few bubbles


Some Basic Stats:
-Julius has a frame height of 350px (as opposed to character height, which is ~346px)
Braun is 380px full frame height-All animations are 15fps
-All animations must be the same height, with same body position and rotation
-All walking should begin from standing frame and move gradually to the legs-open-fully position (as opposed to standing position, and then frames 1 is with Julie with his legs wide apart)

What will you pay?
AU$3000. (Australian currency, worth about 1/2 of American Dollars) IF YOU WANT MORE, PLEASE NEGOTIATE. I have sums in mind, but if you can give me a good reason to pay more, let me hear it.

Got some tips for style you're looking for?
Yes - check out TramplePie's game Super Most Unexceptional Friends: The Cage of Sadness (http://www.adventuregamestudio.co.uk/forums/index.php?topic=53853.0), or play Sam and Max: Hit The Road. These two are what I'm looking for: custom animations, all drawn by an artist (as opposed to being made 'rag doll' style with a copy of Adobe Animate and some pictures for legs/arms), and all with a cheeky sense of humour.

Is there any further opportunity for animation?
Apart from 1 or 2 Julius animations, not really.

How soon do you need this by?
Latest is March 2019 - need more time? negotiate.

What are you looking for in an animator?
Someone who understands AGS.Someone who speaks English, is reliable, doesn't take advantage of my giving nature, and who delivers when they say they will - or even roughly when they say they will.

What are you NOT looking for?
Someone unreliable, who has a pretty awful grasp of English, and who doesn't repond to emails in the form of 'Hey, how's it going with X animation?' sent every month, when in fact he said he'd be done within 8 days, not 74 days. This was my previous animator.

How do I get my animation to you?
1) write to admin@redrom.ltd
or
2) just post it here

That's it - ask questions if you need more info :)

Ben
#89
I already have a custom conversatoin tree - see here.

But how do I scroll to the left or right is there are too many icons in the single-line list?



As we can see here, the last item is off the screen and so can't (or can barely) be clicked.

ps. I increased the size of the icons from 64 to 96; just replace all of the 64's with 96's in the code linked to ;)
#90
And there it is. I just want to make a transparent GUI for use in a custom dialogue system - at the moment, it shows as white (BackgroundColour/BackgroundColourNumber etc. are all 0's).
#91
I'm sorry to ask this question, I'm probably missing something.

I go to Message -> Read Messages on the website menu.
I see only messages that I can Read (as in /reed/); and that have been Read (as in /red/).
Where are messages *I've* sent? Sent messages that other people have sent are in Read Messages; but email's that *I've* sent are nowhere to be seen! :/

Actions and Preferences, for both Read and Send, don't appear to work - again, I could be wrong.

Unless I am missing something big....???
Or unless this is the wrong forum to discuss it - perhaps someone can direct me to the right forum?
#92
I have this piece of code for The Assayer, who is a non-player character, on a walkable area, and has 1 frame for walking down, 17 left, and 17 right.

in GlobalScript.asc:
Code: ags

  if (cJulius.ActiveInventory==iGoldIngot) {
    cJulius.SayBubble("&242 I would like to value some gold.");
    cAssayer.SayBubble("&2 Really.");
    cAssayer.SayBubble("&3 Hand it to me.");
    //assayer tries the scales
    cAssayer.SayBubble("&4 Let me get the books...");
    cAssayer.Walk(998,676,eBlock,eWalkableAreas);        <--DOES NOTHING
    SetTimer(TIMER_ASSAYER, GetGameSpeed()*6);            <--SET A TIMER FOR 6 SECONDS
    PayForMace=true;
  }


I also have a piece of code which complements this:

in GlobalScript.asc:
Code: ags

  if (cJulius.Room==30) {
    if (IsTimerExpired(TIMER_ASSAYER)) {    //WHEN TIME IS UP...
      cAssayer.Walk(ASSAYER_START_X, ASSAYER_START_Y, eBlock, eWalkableAreas);
      cAssayer.SayBubble("&40 It's 23.9 carats. Yes. *Crap* I'm afraid.");
    }
  }  


However:
If I make one or both pieces of code eNoBlock, or eBlock, it does nothing.
If I make him WalkAnywhere or only on WalkableAreas, it make no difference.
If I make him walk Block-ing, the timer icon does not appear, and I can do other things.

Why does he do nothing when he should be walking? Should I use something else to get him to move? Does it make a difference this is in the GlobalScript and not the room script?
Puzzled.
#93
Just wondering where the ags Dialog scripts (the actual text) is found. It seems odd to me that globalscript can be opened in a text editor, but the dialogue scripts are binary.
#94
Let me ask you guys this.

Can I have:

-The P (or any key except Space/ESC) key become 'paused game' (eg. activates a Display() ); and the Space and ESC keys STAY as Skip (for speech)

And/Or:

-The left mouse click does NOT stay as Skip (for speech) -- something else skip's speech, the 'S' key for example; or nothing at all.

Follow up:
Is there any way to not have speech skip when you press space, or any mouse button, or anything?

Ask me if you require more specificity :P
#95
As usual, a tiny point which baffles me.

When I use the mouse, the cursor changes it's icon (eg. notalk to talk, no interact to interact etc) if it's above something with an InteractionMode of eTalk, eInteract etc. - eg:

Code: ags

...
    else if (mouse.Mode==eModeInteract) {		//INTERACTION
	newGraphic = 2;  //interact off
        Hotspot *hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
	if (hs != hotspot[0]) {
	    if (hs.IsInteractionAvailable(eModeInteract)) {
		newGraphic=286;    //interact on
	    }
	}
...


But for characters, there's no cCharacter.IsInteractionAvailable function.
Could you give me an alternative? Is there one?

There *is* a cCharacter.RunInteraction(eModeWhatever), but this just... runs a charater mode :/  --It doesn't return true/false if there *is* a character mode.
#96

Please go to this post:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=56695.msg636598883#msg636598883

Find the updated animation example zip at:
http://redrom.ltd/img/animation_J+DB.zip
#97
Should I start music in Load or Afterfadein?
Is there a manual page with a list of things that are better off in each function?

It comes from the yet-again dreaded 'how do I transition between two music tracks of the same lengths' question.

BEACH is the beach, the first room, enters after the player starts the game.
CAVE is a cave to the left of the BEACH.

Both music tracks aBeachTheme and aBeachTheme_cave are the same length; they're the same *song* - aBeachTheme_cave have a low volume and 'muted' sound (beccause it's, you know, in a cave).
Both tracks are .OGG format
The Types->Music has a MaxChannels of 1 (so it will always smoothly transition as a new room is entered, and that areas music is played).

BEACH:
Code: ags

function room_FirstLoad()
{
    SetGameOption(OPT_CROSSFADEMUSIC, 1);
    music_chan=aBeachTheme.Play(eAudioPriorityNormal, eRepeat);
    sounds_chan=aOcean_crash.Play(eAudioPriorityNormal, eRepeat);
}

function room_AfterFadeIn()
{
	if (cJulius.PreviousRoom == CAVE) {		//cave
		aWater_dripping.Stop();
		cJulius.Walk(265, 500, eNoBlock, eWalkableAreas);
	}
	

	if (cJulius.PreviousRoom==CAVE || cJulius.PreviousRoom==FARM) {
		beachThemePos=music_chan.Position;
		music_chan=aBeachTheme.PlayFrom(beachThemePos, eAudioPriorityNormal, eRepeat);
	}
}


CAVE:
Code: ags

function room_Load()
{
	if (cJulius.PreviousRoom == 2) {
		beachThemePos=music_chan.Position;
		music_chan=aBeachTheme_cave.PlayFrom(beachThemePos, eAudioPriorityNormal, eRepeat);
	} 
}


HOWEVER - the CAVE and BEACH background music intermiddently stops, upon entering the room. It doesn't crossfade to nothing; just stops. This can happen the 6th or 7th time I enter, or the 2nd. Random.
What's odd is, when the music *is* working again, it will transition back to it at a different position to where I left off. So, it almost as if the beachThemePos is updating with each successive entry; but when it tried to play the music, a random bug hits, and the playing doesn't go.

Bonus question: which runs first, the Room_Load function, or the Room_FirstLoad function?
#98
We all know there is an easy way to *import* these masks, but no easy way to export them (which makes no sense to me, surely you'd just reverse the import porocess...?)
There is no clear way to *export* the masks.

After much pain, I manageed to:
-take a screenshot, on a white background (which you've had to cut to size and re-imported into the editor), of 0% transparency
-copy to clipboard, paste into Paint
-save as a .png file
-open in Photoshop CS6
-change mode to RGB/8bits
-save as a .jpg file
-enlarge the mask to a new screen size
-reimport the mask back into the editor

Here's what might have been easier:
-export the walkable areas/walk behinds etc. into one file
-...

That's it. This would be so, so, so much simpler. But yet there's only one post about this from 2009 with no editor change? I mean WTF? Wouldn't you just reverse the function of import and make it export? Please please tell me something cogent about this.
#99
Beginners' Technical Questions / ignore
Fri 30/03/2018 04:19:20
ignore post
#100
I've made a custom dialog screen; however it dissappears while people are talking (while there's speech), then comes back on when speech is finished.
How can I make it stay up there always?
SMF spam blocked by CleanTalk