Basic Puzzle - Pick up objects and look at objects before leaving room

Started by PightyMirate, Thu 17/06/2021 20:15:05

Previous topic - Next topic

PightyMirate

Hi Guys,

Sorry for being annoying with n00b questions.

This is probably super easy for you masters, not easy for me though as I have been Googling and searching the forums for the past 2 hours and really suprised this has not been mentioned much!

I have finished my very first room and really happy with it. I just need to now know how to prevent player exiting until he has 1) Picked up 2 items and 2) Looked at 4 objects.

Is it a bool? Is it a variable? Is it a condition? I have no idea so I dont know what to search for  :P

Thank you so much! Will post my room for feedback once this last puzzle is in place  :cool:

arj0n

You can create 4 bools and for each object when looking at it set the bool to true.
For the exit you can draw a region
When player stands on region:
- check with player.hasinventory if the player has taken the 2 object.
- check if all 4 bools are set to true.
If yes, exit screen, if not show response.

Matti

Using conditions and variables is very basic programming, that's why is has not been mentioned much  ;)

PightyMirate

Quote from: Matti on Thu 17/06/2021 21:01:08
Using conditions and variables is very basic programming, that's why is has not been mentioned much  ;)

Thanks Matti. I know, I am a retard I'm sorry  :sad:

I have never coded before in my life so this is all new to me, however I am so keen to learn and I won't let it beat me. I WILL produce a full game  :grin:

Sorry for being stupid. It will be basic to most but its all new to me  :P

PightyMirate

Quote from: arj0n on Thu 17/06/2021 20:30:56
You can create 4 bools and for each object when looking at it set the bool to true.
For the exit you can draw a region
When player stands on region:
- check with player.hasinventory if the player has taken the 2 object.
- check if all 4 bools are set to true.
If yes, exit screen, if not show response.

Thank you so much Arj0n.

So I understand what you are saying here but I dont know how to execute it. Would you mind giving me a bit more help please?

How do I set up the 4 bools, does his go in the room or global script? Can I be cheeky and ask for an example of this code please  :~(


Cassiebsg

Here you go, how to declare an IF: https://youtu.be/3LCiL1YCaWU?list=PL21DB402CB4DAEAEF

It's a bit old, but the basics are the same.
If you need the variables only for this room, you can declare them in the room script. If you need them globaly, you can declare them in Global script OR use the Global Variables (it's the Globe icon on the project tree). Once you declare variables here you can just start using them.  ;)

There are those who believe that life here began out there...

PightyMirate

Quote from: Cassiebsg on Thu 17/06/2021 22:53:34
Here you go, how to declare an IF: https://youtu.be/3LCiL1YCaWU?list=PL21DB402CB4DAEAEF

It's a bit old, but the basics are the same.
If you need the variables only for this room, you can declare them in the room script. If you need them globaly, you can declare them in Global script OR use the Global Variables (it's the Globe icon on the project tree). Once you declare variables here you can just start using them.  ;)

Thanks Cassie. I have watched most of Densmings videos, the one you embedded s AGS Part 1 (introduction), is that right? There is nothing about the variables/bools in there.

Cool, thanks! Never opened or used the global variables tab before. That's a new one for me. Just need to learn what/how to input here I will do some digging for information. Thanks again


PightyMirate

Quote from: Crimson Wizard on Thu 17/06/2021 23:34:17
Relevant parts of the script tutorial from the manual:

Variables: https://adventuregamestudio.github.io/ags-manual/ScriptingTutorialPart1.html#variables
More on conditions: https://adventuregamestudio.github.io/ags-manual/ScriptingTutorialPart2.html#multiple-conditions

Thanks Crimson. I'm really struggling with this (maybe burned out today).

Would you or anyone you know be willing to consult on my project (paid position of course). I have the ideas I just need help with the scripting. Please drop me a message if you are interested (or if anyone else is interested, Khris?)

Thank you

Crimson Wizard

These are basic programming concepts and not something exclusive to AGS script. I don't know how much of this you know already, but I think you may as well take any free online coding courses with simple languages like Python, for example. There are syntax differences, but it's mostly important to get a grasp of how variables and conditions, etc, work - these principles are mostly shared between the programming languages.

Cassiebsg

Sorry, it was meant to be Part 27, I just copied the link from the playlist, and apparently it got the first video.  :-[



There are those who believe that life here began out there...

SMF spam blocked by CleanTalk