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

#1
Hello AGS comunnity!

I really honestly tried to find a solution to my problem myself, the solution that works for me seems too weird.

So - I have two objects in a room located on same place (a cabinets with an open/closed door) and I want the door to open and close by clicking, by changing the visibility of the objects. I was try:
------------------------------------------------------------------------------------------------------------------------------------------
1: In this version, only the first part ("opening the cabinet") works, and the game does not respond to further clicks.

Code: ags
function oCabinetClose_Interact()
{
if ((oCabinetClose.Visible == true) && (oCabinetOpen.Visible == false))
  {
    oCabinetClose.Visible = false;
    oCabinetOpen.Visible = true;
  }
  else if ((oCabinetClose.Visible == false) && (oCabinetOpen.Visible == true))
  {
  oCabinetClose.Visible = true;
  oCabinetOpen.Visible = false;
  }
 
} 
------------------------------------------------------------------------------------------------------------------------------------------

2: In this attempt, only the first part works again (again only "opened door"), but I suspect that this code is completely wrong.

Code: ags
function oCabinetClose_Interact()
{
 int i;
 i = oCabinetClose.Visible == true;
 if (i == true)
 {
  oCabinetClose.Visible = false;
 }
 else if (i == false)
 {
  oCabinetClose.Visible = true;
 }
}
-----------------------------------------------------------------------------------------------------------------------------------------

3: The only solution I came up with is to use a function on both objects.

Code: ags
function oCabinetClose_Interact()
{
if (oCabinetClose.Visible == true)
{
  oCabinetOpen.Visible = true;
  oCabinetClose.Visible = false;
}
}


function oCabinetOpen_Interact()
{
if (oCabinetOpen.Visible == true)
{
  oCabinetOpen.Visible = false;
  oCabinetClose.Visible = true
}
}

This work, but I suspect the situation could be handled much more elegantly. I hope that you, experienced guys, can advise how to solve such situations.

I will also add that BaselineOverriden is false, oCabinedClose is visible after startup(on top of oCabinetOpen), I make sure that the visibility states in the properties correspond to the start of code.

Thank you :=
#2
General Discussion / Available AGS tutorials?
Thu 26/10/2023 21:07:15
Hello all,

as a newbie in learning AGS i try to go through all the available web tutorials that exist. I finished the official ags tutorial and the ags book (Foxy Monk quest). I think that a lot of users on this forum have (or had  :wink: ) a similar experience with trying to absorb knowledge about AGS and that's why I'm asking if anyone knows of other good tutorials that they would recommend? I'm talking about text-based ones, not youtubers, those are relatively easy to find. I would also like to know how the rest of you learn to control AGS? Thank you very much.
#3
Hello to all,

First need to say that i am a complete newbie when it comes to coding adventure games with AGS. I try to learn with help of book "Game desing with AGS" (second edition, v. 1.0). That book is pretty cool, explains the procedures very patiently and well. But at ends of some chapters there are "Homework" task. Now i get to end of chapter 1.5.5. (inventory items) where homeworks ask for making some things which i dont know how to do (throwing the stick), again i am a newbie :cry: If somebody in past get through this book, maybe was try wrote this part of code and save it for worse times :grin:  ? will be grateful if someone can show me that. Or is there any place (webpages/forums) where is this homeworks explained?  Thank you very much. (roll)
SMF spam blocked by CleanTalk