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

#2
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.
#3
Quote from: Khris on Wed 08/06/2011 18:38:51
If you look at room 2's events (lightning bolt icon), does it say "room_Load" next to "Enters room before fade-in"?
Yay ! This was the problem. Thnx, tho I should have noticed it myself, has happened to me before -.-. I often just go straight to script and type the function.
#4
But doesn't no one has a code how to get it working with my current version?
Or is it essential I download newer version and do the right click thingy?
#5
3.1.2 SP1
If I download a newest one can I continue making the game in it?
#6
There isn't such option
There is only:
Go to definition of MySwitch2
Go To Sprite (Doesn't let me use this)
Toggle Breakpoint
Cut
Copy
Paste
#7
It equals true.
About right clicking.
I clicked MySwitch2 in the script and chose Go to definition of mySwitch2, but nothing happened
#8
Quote from: Hernald on Wed 08/06/2011 15:33:00
Just a thought: There is a system variable on rooms that sets them back to there original state whenever the player returns if it's switched on. The default is off which it correct for what you're doing, you haven't switched it on have you?
i don't think so. Where can I check that?
#9
Quote from: Hernald on Wed 08/06/2011 15:06:36
Yes, that's the globals pane.
If you right click on one of the places you set MySwitch2 it will give you the option to list all the places it is used. You may find that useful in seeing if it is used somewhere other than the places you've mentioned.
I don't understand what do I have to right click on?
As places do you mean where I wrote the MySwitch2 script or what?
Sorry, I'm just new to all this.

If anyone has a better/easier solution how to get what my goal is then they could tell me it aswell.
#10
I did a global variable like this: http://i36.photobucket.com/albums/e10/beenf/myswitch2.jpg
I tried to follow the MySwitch global variable which I used for removing Walkable area, but I don't understand what I did wrong.
Not very good using Global Variables
#11
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.
#12
oo thnx Tomatos.
#13
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
#14
Ohh. Finally did it ! Now it's working :P
I deleted
Code: ags

bool isDoorOpen = false;

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=true;
    oDoorClose.Visible=false;
    player.LoseInventory(iklaasjaveri);
    isDoorOpen = true;//Set the door to "open".
    RestoreWalkableArea(2);
    
  }
}

from room script and added the bool in global script

Thnx guys. Once again the forum helped out
#15
I knew that part.
But what do I have to write in the boxes and what do I do with it next
#16
Quote from: Khris on Wed 06/04/2011 14:38:33
Quote from: Creator on Wed 06/04/2011 10:42:08
EDIT - Just noticed that cVamp would be in the GlobalScript. This means you would have to make a global boolean in the Global Variables pane in the editor.
I don't know how
#17
I added those both in my room script and global script.
But still same thing. Do I have to make another bool for global script ?
#18
How do I use flag?
#19
yeh the odooropen/odoorclose thing was mixed :P, but that wasn't the case

How do I use them in condition? Can you maybe plz give me a code?
#20
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
SMF spam blocked by CleanTalk