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

#1
That should do, thanks
#2
What is the best way to insert an NPC into your game? The only way I've done it so far is by setting the starting location for your character, but when I make more rooms and areas how will I insert him into there if he's already got a starting location in another room?

Can you add characters straight in like you can objects?
#3
Quote from: Mr. Matti on Tue 28/09/2010 19:03:07
You have to select the actual inventory area (marked by white borders), not the whole GUI.

I found it :D
Thanks a lot, this forum is so helpful and pretty quick to
#4
Quote from: Mr. Matti on Tue 28/09/2010 17:35:51
If you click the inventory the item width and height variables are right at the top of the panel to the right.

For me the top is Background Color, BackgroundImage etc.. and all the stuff in the "Appearance" tab.

The only things I can find are Height, Left, Top, Width and zOrder in the layout panel
#5
Quote from: Khris on Tue 28/09/2010 17:13:16
1. I answered this in your other thread; you'll have to change the ItemWidth and ItemHeight setting in your InventoryWindow.
The thing is, if those are way smaller than the sprites you're using, the items should all overlap and be hard to click on anyway, not sure why that doesn't bother you or if it means something else is wrong.
On the other hand, AGS might use the sprite dimensions to place the items but only react to clicks in the top left corner then.

2. Change the setting back, then use player.Say("Blah"); when you want text over the character's head and Display("Blah"); when you want the box.

Ok I got 2 sorted then thanks.

Also I replied to your post in the other thread just now, I didn't realise you had posted there sorry. Here's the reply i posted there anyway

the inventory has a height of 156 and a width of 220
I can't find any ItemWidth/Height variables, the size of my inventory item is about 55 wide 40 high
#6
Quote from: Khris on Tue 28/09/2010 13:51:00
Check the ItemWidth and ItemHeight settings of your InventoryWindow. You're probably using graphics way bigger than the entered values.

the inventory has a height of 156 and a width of 220
I can't find any ItemWidth/Height variables, the size of my inventory item is about 55 wide 40 high
#7
Beginners' Technical Questions / 2 Questions
Tue 28/09/2010 17:02:27
Hey I have 2 questions if anyone can help with either that'd be great.

1. For my inventory items if you click it anywhere other than the top left corner of the icon it doesn't become the active inventory item, for some reason you have to click the very top left of the image. Is this because my image is too big and needs to be scaled down? Is there a way I can change it so clicking the image anywhere will select it, or at least in the very centre rather than the top corner.

2. Normally text made with the "Display" function comes in a box right, well I set it to appear as Dialogue from the character in the general settings, so now whenever I click things it looks like he is thinking or saying it, which is what I want. However when I look at items in the inventory the dialogue is hidden by the inventory. IS there anyway to make a specific display use the box rather than dialogue like I have set it to. I would like to keep the setting but want to make specific boxes for certain things.
Such as Display.Box ("blah blah."); or whatever.

Thanks :D
#8
Quote from: Khris on Mon 27/09/2010 17:00:24
Quote from: dahui58 on Mon 27/09/2010 13:07:13
How do I actually set that so when you click an inventory item it becomes the active inventory?

This is the default behavior. In the default inventory GUI, click the arrow button, then the item.
If you're using another inventory GUI, you don't have to add code for every item. Just activate that inventory clicks are handled in script in the General settings pane, then add eButtonLeftinv behavior to on_mouse_click in Global.asc:

Code: ags
  else if (button == eMouseLeftinv) {
    InventoryItem*ii = inventory[game.inv_activated];  // get item that was clicked on
    if (mouse.Mode == eModeUseinv) ii.RunInteraction(eModeUseinv);  // use item on item
    else player.ActiveInventory = ii;   // set item active
  }


Thanks I figured this out now, it turns out you had to click the far left side of the item in the inventory for it to work so I need to make more user friendly inventory icons.

Thanks everyone for helping
#9
Quote from: Mr. Matti on Mon 27/09/2010 12:54:42


The ActiveInventory is whichever item you've selected.

How do I actually set that so when you click an inventory item it becomes the active inventory?
#10
Quote from: Mr. Matti on Mon 27/09/2010 12:54:42
You get a parse error because it should look like this:

Code: ags

function iWire_Interact()
{
  if (player.ActiveInventory == iWire){
    // post your code here
  }
}


The ActiveInventory is whichever item you've selected.

No thats to check if the active inventory is wire, and I've got no problem with that bit, i want to make the active inventory the wire, so when you interact with it in the inventory you can then use it on items in the environment.
#11
Sorry but I don't know how to make an item the Active Inventory.
At the moment I have this in the Interact function for the Inventory Item...


function iWire_Interact()
{
player.ActiveInventory == iWire ;
}

But I get a "parse error" at player
#12
Quote from: Khris on Mon 27/09/2010 10:39:35
Assuming the machine is a hotspot, the interaction event is "Use inventory on hotspot".
Inside the function, use if (player.ActiveInventory == iWire) or similar.

If the player is supposed to be able to remove it again, you need a wire object for every machine or outlet (or one per room).

Yeah it's a hotspot.
Excellent thanks a lot
#13
I followed all the main tutorials and I couldn't find anything about how to use an item you have in your inventory. On the main tutorial it goes on about viewing an item in your inventory and I understand and can use that.

But now I would like to allow the player to use the item in the inventory with a hotspot to advance the plot.

There are a few functions I think look right (such as usewithInventory or interactwithitem) but I have no idea what code to put in for it to work.

The character has a wire, I would like him to use it with an broken machine which results in the wire going into the machine and working, however I want it to be allowed to be removed as well, as it is initally taken from a seperate outlet and I would like to be able to remove and place it in any of the outlets at any time to power up different areas. I am using basic variables to check whether or not the electricity is on in an area, but I'm having trouble putting the wire back into anything.

Thanks  ;D
SMF spam blocked by CleanTalk