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

#1
Hi everyone!

I put a little function into a dialog, so that when the player asks something to another character (let's call this character Jim), Jim answers with a number which is different at anytime.
To do so, I put this very little function into the dialog_request:

VariableX = Random(200);
cJim.Say("%p", VariableX);

The problem is: when Jim says this number into the game, the number is always formed by 8 characters (so, with 000 at the beginning) and hexadecimal! For example: 0000001E.  ???

Where is my mistake? How can I avoid this and have displayed just a decimal number with no zeros at the beginning?
Thanks!
#2
I know it may seem stupid, but I have problems looking at an inventory item. I want the main character to say something when looking on an inv item, and I only manage to make this dialog line start when the option "handle inventory clicks in script" is off. The problem is that, if that option is off, I have problems with other functions ("interact" and "use)...
Is this a common problem? Is there something I don't know about using these functions?
Here's the script i use:

function bLook_OnClick(GUIControl *control, MouseButton button)
{
Mouse.Mode = eModeLookat;
}

and

function iXxx_Look()
{
cYyy.Say("Bla bla bla");
}

Thanks everyone!
#3
Hi, I know this is an extremely stupid problem, but I can't manage to solve it.
I want Talk function with a non player character to change when he (or she) is in a different room. To do this I set a "int" variable and make it change when room changes. So, I use this code: in the globalscript.ash I declare:

int BlaBla;

Then, I put the changing of the variable inside the function room_FirstLoad, like this:

function room_FirstLoad()
{
BlaBla = 1;
}

in room 1; BlaBla = 2 in room 2 etc.

And then I use this code in the globalscript.asc

function cJames_Talk()
{
if (BlaBla == 1)
{dJames1.Start();}
if (BlaBla == 2)
{dJames2.Start();}
}

But this doesn't work!  Why? :(
When I make the player and James interact nothing happens.
Where is my mistake?

Thanks everyone for help and patience!

NOTE: I use AGS 3.0
#4
I use a sort of "status bar" in my game, a GUI with a label on which all things are happening in the game are written.
In order to write something like "Look at (objectname)" when I look at an object, I wrote this in the room script:

function oObject_Look()
{
lLabel.Text = String.Format("Look at %s", object[0].Name);
}

But it's a very annoying solution, because I have to repeat that line (lLabel.Text etc.) for every object, hotspot and character.
A more simple and faster solution, would be to make a general function, put it in the global script, and call it in the rooms whenever I Look at an object.
But is it possible to "generalize" a line like that? Is it possible to substitute object[0].Name with something general, something that doesn't refer to Object 0, but to every object I'm looking at?
I tried to search in the forum and in the manual, but I couldn't find an explanation, how to do functions related to all objects and not only to a particular object.
So, please, tell me what I have to write, or where I can find a tutorial for these kind of functions.
Thank you!

PS: I know of @OVERHOTSPOT@, but I don't like it because the name of the hotspot disappears when the cursor is not over it. Instead I want the name to be print on the GUI and to stay there until I do another action.
#5
I had a visible inventory in my game and I wanted inventory items to be active when you left-click on it. I managed to do this.
Then, I tryed to make an exception: I want my inventory item to be active if I left click it, except if the lookAt cursor is active. If the lookAt cursor is actvive I want the function "inventoryitem_look()" to happen. But I don't know how to make it happen. So, here is my script:

if (button == eMouseLeftInv)
  {
    if (mouse.Mode == eModeLookat)
    { ??? }
   else
   {
    player.ActiveInventory = inventory[ game.inv_activated ];
   }

Is this the right way to do what I want? And if so, what do I have to put instead of the ??? smiley between the two brackets? I want it to be a generic function, so that every inventory item I look at, that function happens.

Thanks!
#6
I just want my characters walk around other characters and objects, when they found them on their way, and don't go straight and through people/things.

I did a forum search, and I found that I have to turn on "solid" property of the characters, to avoid they walk though each other... I did it, for both characters, but it didn't work! Is it possible? They go on walking though each other. Is there something else I missed?

I also found interesting functions that would help: character.BlockingHeight and character.BlockingWidth, but I didn't understand how and where to use them in the script.
Do I have to put them inside a function {}? And, if yes, what kind of function? Or do I have to declare them in some way, just like variables and such things?

Thanks!

(PS: consider I don't have any experience of C and/or other programming languages... I'm learning something of programming with ags for the first time... and I'm enjoing a lot  ;D.. except when I don't understand how to make things work  >:( so, sorry if these questions seem extremely easy and stupid to you)
#7
Ok, I know, you are going to shoot me for such a stupid question... but I search for an answer in the forum and I could't find anything!

So, here's my problem. I use AGS 3.0, and I just made my own personal Quit GUI and it just doesn't work, but I can't understand why: it seems to me that I didn't make mistakes. Here's the code I used:

function btnIconExit_Click(GUIControl *control, MouseButton button) {
 
  GuiQuit.Visible= true;
  gIconbar.Visible = false;
}

function ButtonLascia_OnClick(GUIControl *control, MouseButton button)
{
  QuitGame(0);
}

function ButtonGioca_OnClick(GUIControl *control, MouseButton button)
{
  GuiQuit.Visible = false;
  gIconbar.Visible = true;
}

ButtonGioca (to go on playing) works, it returns to the game.
ButtonLascia (to quit) doesn't work, doesn't happen anything: why???
Thanks everyone for help!

---

PS: sorry for my not very good english... I'm Italian!
SMF spam blocked by CleanTalk