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

#1
How is the game coming along?
#2
Hey!
Total newbie here so sorry for asking this.
Been reading trough the manual but i still can't figure out the correct coding for this and i have been stuck for weeks so  i'm finally buckling down and asking the forum.

I have my main character walking into the library where he picks up some books. He has to show a library card to the librarian in order to be able to leave.
Otherwise the librarian stops him. Classic Point & click stuff.

I have the room edge as a separate walkable area that is turned of as soon as you pick up any of the books and is then turned on as soon as you give the card to the librarian but i can't get it to work correctly.

Can someone go trough the coding for this as thoroughly as possible?
Please explain it to me like i was a complete idiot :)

Thanks!
#3
Hi!
Total beginner here. Was looking trough the forum but couldn't find this specific thing.
I'm trying to do a room where a the character tries to buy some stuff from a store. Problem is he needs to pay the store clerk with money otherwise he isn't allowed to leave the store and has to return everything he has picked up.
How should i go about coding this?

Thanks!

#4
Quote from: Cassiebsg on Sat 10/07/2021 00:38:06
That sounds likes you have clicked an event, that you called room load, and then you either deleted it from script or changed it's name to something else. load[/b].

Yes this was indeed the problem.
Thanks!
#5
So i'm trying to get my character from room 1 to room 2 following the manual and tutorial videos.
Everything works untill i leave room 1 and the game crashes with this error message:

"error: prepare_script: error -18(no such function in script)
trying to run ´room load´ (room 2)"

What does this mean and how do i fix it?

My code leaving the room looks like this:

function room_LeaveTop()
{
cEgo.ChangeRoom(2,  502,  448);
}


Thanks!
#6
Quote from: Crimson Wizard on Wed 07/07/2021 00:31:27
Quote from: Rocky_Johan on Wed 07/07/2021 00:18:15
Sadly i can't get the script to work.

Please, never just say "it does not work", explain what you did, show the script you wrote, tell what happens instead. This will make it much easier to find out what was wrong.

I was about to post a longer explanation but then i finally managed to fix it by myself.
#7
Finally got it to work!
There was a semicolon missing apparently.
Thanks again for the help!
#8
Quote from: Cassiebsg on Tue 06/07/2021 17:58:43
Not too long I posted this:


Basically the code goes in interact with the character instead of an object.
What you need is Character.AddInventory and Character.LoseInventory, check them out in the manual.  :)

But the code could look something like this:
Code: ags

player.Say("Here's your money");
player.LoseInventory(iMoney);
cOther.Say("Looks good. Here's your key!");
player.AddInventory(iKey);
player.Say("Goodbye.");


PS - (Chomba ninja...  (laugh) )

Sadly i can't get the script to work.

Ok so here is what i wanna do:
I wanna bring out an object from my inventory and use it on an npc
this should trigger the player to walk to the npc and giving him the object.
Some dialogue should occur where the npc says thanks or something and the player respons.
The NPC gives te player another object in exchange.

Iv'e been trying all sorts of solutions but either it doesn't work or there is an error in the code.
Please help. I'm totally stuck :P
#9
Quote from: Cassiebsg on Tue 06/07/2021 22:03:03
They're not my videos, they are densming's videos. I learned my AGS ABC from them.  ;)
I just meant, that I posted that exact video on another thread last week...  (laugh)

Ah ok!
Those videos have been a great help.

I went trought like 50 pages of threads but couldn't find the answer i was looking for before sucking it up and posting this total newbie question :)
Thanks for being so nice and helpful!
#10
Quote from: Chomba on Tue 06/07/2021 18:12:26
Ah yes,

if you're totally new to AGS, the tutorials from densming (after following the basic tutorial in the manual) are very helpful and some of the best stuff out there!



QuotePS - (Chomba ninja...  (laugh) )
*insert Bruce Lee sound

I was looking trough the videos and the manuals but still couldnt figure out the solution.
Maybe 16 hours of coding whitout sleep was starting to mess with my brain.  :smiley:

Anyway, thank you both!
#11
Quote from: Cassiebsg on Tue 06/07/2021 17:58:43
Not too long I posted this:


Basically the code goes in interact with the character instead of an object.
What you need is Character.AddInventory and Character.LoseInventory, check them out in the manual.  :)

But the code could look something like this:
Code: ags

player.Say("Here's your money");
player.LoseInventory(iMoney);
cOther.Say("Looks good. Here's your key!");
player.AddInventory(iKey);
player.Say("Goodbye.");


PS - (Chomba ninja...  (laugh) )

Thanks!
I was actually going trough all of your videos trying to solve this but still couldn't figure it out.   :smiley:
#12
Hi! Just starting out. This seems really simple so apologizing beforehand but i canät find the answer anywhere(Sorry sorry sorry).

I want to give an inventory object to an NPC and get another object in return.
Point & Click 101. Can't figue out the coding and every tutorial just skips it.

Please help
(Sorry again)

Cheers!
SMF spam blocked by CleanTalk