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

#1
Brain no-worky today.

In looking at an inventory item, I want to choose a random line to say from a selection of about 10. I know it's very simple and the solution will suddenly seem simple when I see it, but...
#2
Really should have considered this BEFORE otherwise completing this large, complicated room. Never mind.

So there are lots of places on-screen in a particular room that, at the start, cannot reach. The upper floors only become available after solving a certain puzzle, and by default, the walkable areas do not allow access to these hotspots, objects and so forth.

But of course when faced with this cEgo just decides to stop where he is and perform the action as if he was there already, bypassing any walk commands. I'd like this to stop.

Is it possible to add a line or two to the global script that will automatically sense if an object or hotspot or character is out of reach and nip that in the bud? Or do I have to add a great big if condition to EVERY SINGLE interaction in the room? Please say the former, please say the former, please say the former.
#3
Problem 1:
When the player interacts with an object I need him to shift position slightly so that the animation lines up properly. I can't for the life of me find the right command to make this shift instant. I don't want him to walk or drift sideways - I just need him to move to new coords in an instant. The closest command I could find is player.changeroom but that gives a great big room changing transition fade in-out.

Problem 2:
As part of the same script, the object itself is supposed to disappear in the same instance the player animation starts. However, for some reason it does no such thing. I suspect it may be due to the fact that the command to make it invisible is nested within an if condition to determine if it's visible in the first place (see below). Otherwise... huh?

Code: ags

function hPot_UseInv()
{
  if (player.ActiveInventory == iWhisk)
  {
    player.Walk(224, 208, eBlock);
    player.FaceObject(oSpaghetti);
    if (oSpaghetti.Visible == true)
    {
      oSpaghetti.Visible = false;
      player.Move(19, 208, eBlock);
      player.Animate(12, 5, eOnce, eBlock);
      player.AddInventory(iSpaghetti);
    }
  }
  else
  {
    player.Walk(224, 208, eBlock);
    player.FaceObject(oSpaghetti);
    cNarr.Say("That item was distinctly unsuited to extracating the spaghetti from the pot.");
  }
}
#4
So I have a dialog. It has five different options currently. Options 1-4 all end by turning themselves off (option-off X) and returning to the remaining options. Option 5 should be invisible throughout, and only becomes available / activates automatically when ALL the other options have been exhausted. Is there an elegant way to do this without messing around with global variables?

For clarity's sake, here's the entirety of the dialog:

Code: ags
// Dialog script file
@S  // Dialog startup entry point

Ego: But it all looks so vital for puzzle solving!
Ego: Surely you can't need it ALL..?
Thigh: Try me.
  player.FaceLocation(231, 0);
return

@1
Thigh: Need it for chopping.
Ego: The set of small throwable knives?
Thigh: Also for chopping.
Ego: The ladle?
Thigh: Chopping!
option-off 1
return

@2
Thigh: You want to deprive the Colonel of his tea? Go ahead.
option-off 2
return

@3
Thigh: The Prongenator? Absolutely vital pronging device. Mine.
option-off 3
return

@4
  player.FaceCharacter(cThigh);
Thigh: Can't tenderise a beef without it.
  player.FaceLocation(231, 0);
option-off 4
return

@5
  player.FaceLocation(231, 0);
Ego: I promise to be marginally careful!
Thigh: *sigh*
Thigh: You can BORROW the whisk.
Ego: But it's broken.
Thigh: Oh, so you DON'T want it?
Ego: No no, I'll take it! I'll cherish this broken whisk. Forever!
Thigh: See that you do.
  object[6].Animate(3, 0, eOnce);
stop

#5
This is one of those questions that will almost certainly be so obviously easy I look like a complete idiot, or so obviously impossible I look utterly naive. Well, yeah. Such is life.

My aim is to have a game suited for running in windowed mode at 320*240. Except that's stupid-tiny on modern machines and I don't want players to have to squint. So... what I'm after is for a 320*240 res game to display at double-size, or possibly triple-size. For a nice pixel-art visual style.

I know one solution would be to make the entire game at 640*480 and double the size of all artwork, but that doesn't seem, y'know, right. What I'm after is for the game window to be at double size. Possible? Not possible?

Am I making any sense?
#6
Something I've found in AGS is that the default way round for defining using inventory items "on" other objects is to have the reactions dealt with from the target first, rather than being defined by the item being used. So for instance, I try to use the WEASEL from my inventory with the DOOR. As I understand it, the basic way to write a reaction is to use

Code: ags
 function oDoor_useinv()
  cEgo.say("That item had no effect on the door");


So my question is this: is there a simple way of defining the interactions from the inventory item, rather than the target? It's pretty common in the Lucasarts style, especially later games. So that when I try to use the WEASEL on most items the game automatically uses a generic "weasel doesn't work here" message. Is this easy to implement, or am I weaselling up the wrong tree?
#7
So I'm using the default, boring GUI in a sort of learn-as-you go prototype game at 800*600 resolution. I'm not nearly smart enough yet to go making my own GUI, but I've imported my own sprites for inventory icons because, you know. They're extremely rough and ready, of course, I'm no artist and I'm still hoping I can con some poor soul into doing all that heavy lifting for me if and when the time comes. But anyway.

I've noticed that at 800*600 the space allocated for each inventory item is a bit tiny. The size of the default blue cup icon, in fact. Compared to this, my sprites a massive and so they overlap. Question is this: how do I change the allocated space for inventory items so that the sprites each have enough breathing room? Related to this I suppose will be how many items per row, and all that. Can anyone help?
#8
Simple enough problem, I should reckon. What's the easiest/cleanest way to have a certain event happen ONLY the first time the player character enters a room.

For example, our dashing hero enters the kitchen. He's not allowed in the kitchen. The cook starts a dialog to explain why he's not allowed in the kitchen. On returning to the room later, our dashing hero should not have to go through the same dialog again.
#9
I have a long(ish) dialog (dStranger01). When it finishes I want to run a new script which will incorporate characters moving around, playing animations etc. Problem is I don't know how to script running a new script.

One option is, of course, just putting the script lines into dStranger01. Which would be fine, except the end of the dialog has three options, each with seperate responses. So I'd have to copy-paste the script three times, which seems silly to me.

Alternatively, I could make a new dialog, put all the script into that, and have dStranger01 switch directly to it. This is easy enough, but it seems equally daft to have a dialog solely for script commands. I mean, we have script files for that, right?

So, what I'm looking for is a line of script to run a seperate script. I can find no such command. Am I being blind/stupid/utterly wrong?
SMF spam blocked by CleanTalk