Hi
I am using:
btnIconInv.Enabled = false;
It works perfect. My only question is is it possible to have some kind of text displayed explaining why you can't access inventory...
Something like "It's best not to let anyone here know what you have, keep it hidden"
thanks for any help on this
UPDATE
Meanwhile Im using 'Say' on entry to Room, which may well suffice... and then Enabling btnIconInv at a certain point in that Room.
Just wonder if my query was possible.
bareoot
Sure. Leave the button enabled, and in the button's OnClick function, intercept what it usually does and display the message instead.
In Global.asc, look for btnIconInv_OnClick(...).
Change its top to:
function btnIconInv_OnClick(...) // leave in the parameters as they are, of course
{
if (condition_preventing_inv_access) {
Display("It's best not to let anyone here know what you have, keep it hidden.");
return; // exit function
}
// rest of function, i.e. standard behavior
thanks khris
barefoot
I try to create a custom text like this too but i don't know how & where to edit it..i use AGS Editor v3.2.1 and i can't find the..
btnIconInv_OnClick(...)
instead of
function btnIconInv_Click(GUIControl *control, MouseButton button)
on Global.asc..
why and how can i edit and change it???
Its the same thing. Khris was just being *totally and shamefully lazy* when he typed it out.
To quote myself:
// leave in the parameters as they are, of course
I can't believe I've added that back then but seeing it still fail is pretty funny and a little sad.
I still can't get through this..because i've to edit it on GlobalScript.asc that will effect the whole of my games right?
What i need is only for certain room only and not whole room/whole games..how to coding that scripting?anybody can show me the more detail sample?
besides,i don't have knowledge about scripting language before.. :-[
It has to be in the globalscript because GUIs are globally accessible. If you only want to show it in one room, you'll have to check if player.Room (the current room) is the room you wish to have it displayed in.
So that's mean i have to set or using the 'if' & 'else' statement between the function,right?
Yes, that's right.
Uh...still doesn't work correctly,or i just miss something important or maybe i've put a wrong code..i just create the code as below..
function btnIconInv_Click(GUIControl *control, MouseButton button) {
if (HasPlayerBeenInRoom(5))
Display("You Carrying Nothing");
else {
show_inventory_window();
}
}
but it seems the code doesn't work correctly,besides it's already display the "You Carrying Nothing" text although after the character change room.what's wrong?
besides, i don't know to continue the code after i place..
player.Room...
Currently i'm weak on scripting and don't know to continue with the rest of above code..
THX.
HasPlayerBeenInRoom() remains true even when the player leaves room 5 (since he has been to the room).
Do you need this:
function btnIconInv_Click(GUIControl *control, MouseButton button) {
if (player.Room == 5) Display("You Carrying Nothing");
else show_inventory_window();
}
This checks the players current room.