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

#1
So I have a map with a river in the middle. The hotspot is on one side of the river and player on other.
My goal is that when person is other side of the river from where hotspot is he can't use a item on it. If he tries to use it he walks straight forward to the hotspot but gets stopped by river. But if he gets to the other side of the river and uses then the item it works and magic happen.
I tried simple if player uses the item on hotspot
player.Walk(x, y);
Display("The door has opened);
But if I do that player would walk to river, be stopped by it and still show the message. I hope you smarter guys understand what I try to do here and can help me.
#2
So my goal is.
I want to use an item from inventory on an hotspot in room number 1.
if i use that then in room 2 object1 turns into invisible and other 3 objects turn into visible

This is what I got so far:
This is in the room where the items have to turn visible and invisible
Code: ags

function room_Load()
{
 if(MySwitch2 == 1)
 {
   opomm1.Visible = false;
   opomm2.Visible = true;
   oglass.Visible = true;
   oSquare.Visible = true;
 }
}


This is from the room I use item on hotspot:
Code: ags

function hHotspot3_UseInv()
{
if (player.ActiveInventory == iDeadcat)
{
  player.Walk(207, 135, eBlock);
  player.LoseInventory(iDeadcat);
  if(MySwitch2 == 0)
  MySwitch2 = 1;
  }
}


But when I go to game after I use the item on hotspot and going to the second room all the items are as they were before the action.
#3
Hi, it's me again.  :-[

My problem now is with ingame inventory.
http://i36.photobucket.com/albums/e10/beenf/wut.jpg
Why doesn't the item let me choose it if I press the green area and only lets me choose the item if i click the red area?
Like with every item I have to click on top left corner to pick it. Is it because my inventory items are too big or what? I hope anyone has an idea how to fix this, so I could click on anywhere on the item to choose it
#4
When I go through my door when it's closed I can't go through. (WalkableArea is removed)
Then I give a character a item and the door will open.(RestoreWalkablearea)
Then I go through the door and appear in another room.
Now the problem is:
If I go back to previous room the door still looks open, but the walkable area in door is removed, but I opened it before.
My code looks like this:
Code: ags

function room_Load()

{
  RemoveWalkableArea(2);
  }

function cVamp_UseInv()
{
  if (player.ActiveInventory == iklaasjaveri) {
    cVamp.Say("Thank you for the blood.");
    cVamp.Say("How can I repay you?");
    player.Say("Let me through the door, maybe?");
    cVamp.Say("Ohh, alright. You deserve it.");
    oDoorOpen.Visible=false;
    oDoorClose.Visible=true;
    player.LoseInventory(iklaasjaveri);
    RestoreWalkableArea(2);
    
  }
}

These codes are in the same room script where the doors and character is. Hope someone finds what I did wrong
#5
So I wanna do an event where I use an item on an hotspot and walkable area restores in another room where the hotspot doesnt exist.

I tried a code like this
Code: ags

function hexample_UseInv()
if (player.ActiveInventory==iItem) {
  RestoreWalkableArea(2);
}

I see that it would restore the walkable are number 2 in the same room. But what code should I use so I could restore walkable area number 2 in room number 5 for example.
I hope someone can help
#6
So my goal is to use an item on a character and after I've done that the door would open. So like he'd open the door for me.

I used this code:
Code: ags

function cVamp_UseInv()
{
if (player.ActiveInventory == iexampleitem) {
oDoorOpen.Visible = false;
oDoorClose.Visible = true;
player.LoseInventory(iexampleitem);
}

But ingame when I use the item on the character nothing happens.
I also wrote that code in the room.asc where the character and the door was.
if anyone has any idea what might be the problem thenplease help
SMF spam blocked by CleanTalk