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 - Pax Animo

#1
The Blackwell Legacy.

I didn't know anything about AGS at the time, so when I came across AGS many years later, I was pleasantly surprised to see it was developed using AGS.
#2
Quote from: Khris on Wed 18/10/2023 09:00:52Here's how to toggle the visibility of a control:

Code: ags
void Toggle(this GUIControl*) {
  this.Visible = !this.Visible;
}

You can now do
Code: ags
  listBoxWhatever.Toggle();

This is perfect for now thank you.

As for the bio_text code I've removed that part as I don't think it will be necessary for now.

On a side note your help introduced me to function overloading, I'm now able to control my GUI is a much neater way, thanks ever so much!
#3
You had me at what is the use case here?, i'm often thinking i know what i want to do but oh my do i get confused at times,

So I'm thinking of a way to control each list box via a single function as in my crazy mind i thought it might make it easier to control.

Something like

Code: ags
function list_box_control(int lstb_id, String bio_text) {
  if (ListBox[lstb_id].visible) ListBox[lstb_id].visible = false;
  else { 
    ListBox[lstb_id].visible = true;
    if (ListBox[lstb_id].SelectedIndex == 0) lCitizensBio.Text = bio_text;  //lCitizenaBio is obviosuly just a lable to print to from the string parameter
    if (ListBox[lstb_id].SelectedIndex == 1) lCitizensBio.Text = bio_text;  //
  }
}

I'm really sorry if it makes no sense, but thank you for your help

Oh this function will be called from a GUI button which has multiple buttons for various citizens and their bio's
#4
Hey Crimson, always the helping hand <3

Wouldn't it be oFirstObject rather than cFirstObject
#5
Heya there TheEyess, maybe something like:

Code: ags
function room_Load() {
    Object[1].Animate(0, eOnce, eNoBlock);
    Object[2].Animate(0, eOnce, eNoBlock);
}

After Object[1].Animate(the loop you want to play. Then if you want it to play once or repeated. Then if it blocks other interactions or not.

Also you may need to set each objects view for which animation they play or the loop within the same view.

exp
Code: ags
Object[1].SetView(1);

Edited: To allow two objects to run without blocking
#6
Hey there, AGS folks

I'm trying to figure out how to control multiple list boxes by turning them on and off via their ID. I've been experimenting with them for a while and looked through the manual, but I must admit I'm still a bit at a loss when it comes to GUI controls in AGS. I'm simply trying to do something as provided below:

Code: ags
function list_box_control(int lstb_id) {
  if (ListBox[lstb_id].visible) ListBox[lstb_id].visible = false;
  else ListBox[lstb_id].visible = true;
}

i've looked at GUIControl.Visible
bool GUIControl.VisibleGets/sets whether the GUI control is visible. This is true by default, but you can set it to false in order to temporarily remove the GUI control from the GUI.

While the control is invisible, it will not be drawn on the screen, and will not register clicks or otherwise respond to any user input.

Applies To

Inherited by the Button, InvWindow, Label, ListBox, Slider and TextBox.

Example:

btnSaveGame.Visible = false;will make the btnSaveGame button invisible.

See also: GUIControl.Enabled

But this only controls it by it's name not it's ID, arrhh it's one of those days.

Cheers in advance.
#7
General Discussion / Re: RIP Slasher
Sun 13/08/2023 21:17:45
I enjoyed his quirky games.

RIP fella.
#8
Quote from: Matti on Mon 20/03/2023 11:46:03Something like this should work (untested). You have to make sure that all the characters that can collide have a consecutive ID.

Code: ags
int i;
int i2;

for (i = 10; i < 16; i++) // iterate through characters 10 to 15 (as an example)
{
  for (i2 = i + 1; i2 < 16; i2++) // iterate again without checking the same pair of characters again
  {
    if (character[i].IsCollidingWithChar(character[i2])) 
    {
      // character[i] and character[i2] are colliding
    }
  }
}

Quickly tested, looks to be working exactly how I want. I'll be trying it out further later, thanks ever so much.
#9
Quote from: Matti on Mon 20/03/2023 09:46:57Snarky, I think you misunderstood the question. I don't think Pax Animo meant that the collision detection seems random, but that random collisions are supposed to happen in the game and they want to find out who's colliding.


I started to write some code using arrays, but I was unsure how exactly you want this to work.
 
I guess there are a bunch of characters that can randomly collide with each other and the basic idea is to have two arrays that iterate through all the characters that can collide. But who should follow whom exactly, if two of them collide? Who should change their view and who's ID is supposed to be passed?

Yes pretty much that. The change view and following part of the code is not so important, I mainly need to know exactly which characters collide if and when they do.

I've noticed in the console when characters do collide it gives a read out of the collision. I want to be able to save the Id of those colliding.

Sorry for the poor description, I know what I want but I'm not great at explaining.

Thanks in advance.
#10
Heya,

I'm trying to do basic collision detection but the characters colliding are random, how can i check which characters are colliding so i can pass their id into another function. Something like:

Code: ags
if (character[?].IsCollidingWithChar(character[?])) {
    if (character[?].View != 4) {
      character[?].ChangeView(4);
      character[?].FollowCharacter(character[?], FOLLOW_EXACTLY);
    }
    //
    int saved_id = ?;
  }
#11
AGS Games in Production / Re: TUNNEL VISION
Wed 14/12/2022 01:04:29
Looks beautiful, the colours remind me of Liquorice allsorts.
#12
Got an idea rolling about and some free time coming up. There looks to be some decent interest on this months theme, gl all.
#13
Quote from: Crimson Wizard on Wed 23/11/2022 19:16:41@Pax Animo, could you check out this temp build and see if it fixes the problem for you?
https://cirrus-ci.com/task/5409147177402368

This fixes my problem. Cheers
#15
Yes i'm using the (RC1), i'm using the VisualStudioDark colour theme.
#16
Heya,

I'm having issues with the pull down properties menu for rooms/gui's... and so forth. The pull down menu does not show or at least it simply shows a white box. This is how it looks:



If i double click the properties box to release it to a moveable box i get:



Now, if i double click the properties box again to re-join it back to the original layout, i get this:



Thanks in advance.


#17
Sounds like a great idea.

With the new forums/main page updates possibly new users shall come aboard and with that they may look for up-to-date info from experienced users showing off the basics of AGS and the possibilities of more advanced projects.
#18
Congrats on the demo release, well done for making it this far. I'm certain everyone who plays it will enjoy it as much as I did.
#19
The Rumpus Room / Re: *Guess the Movie Title*
Sun 22/05/2022 22:07:21
Black Sheep (2006)...?
#20
Quote from: eri0o on Wed 11/05/2022 15:04:13
The most incredible revelation is that the whole thing is all static. I thought there was a server that provided the word of the day, but there isn't. All words from now to eternity are visible in the page JavaScript code.

Like, it could be done in AGS and use DateTime.Now to provide the word from a string array and be the same.

I've been recently tasked with coming up with a similar game to Wordle during my JavaScript course, i did wonder how the word of the day had been implemented, this brings some interesting ideas.   
SMF spam blocked by CleanTalk