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

#81
I'd say, based on that error message, that the problem is caused when you try to use eModeInteract on the items in the second inventory. By default that'll set player's the ActiveInventory, obviously giving you the error you're getting if the player doesn't have the item - and potentially causing weirdness if they do, switching their ActiveInventory at the wrong times. Other cursor modes should work, though, so how is your dummy inventory set up - is it possible to just not allow the player to use eModeInteract on it? If so, that's probably the easiest way to go.

If not - if it's displayed on the same GUI as the player's inventory, for example - then yes, you're probably going to have to use 'Handle inventory clicks in script". What you do then, depends on what you what to happen. I think this code, pasted into on_mouse_click, will match the way it works by default, minus the crashing
Code: ags

  if (button == eMouseLeftInv) {
    InventoryItem *InvAt = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    if (mouse.Mode != eModeInteract) InvAt.RunInteraction(mouse.Mode);
    else {
      GUIControl *tempGC = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
      InvWindow *InvOver = tempGC.AsInvWindow;
      if (InvOver.CharacterToUse == player || InvOver.CharacterToUse == null) player.ActiveInventory = InvAt;
	// CharacterToUse = null means the InvWindow follows the player character if you change them in-game, rather than sticking with a specific char
    }
  }
  else if (button == eMouseRightInv) {
    InventoryItem *InvAt = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    InvAt.RunInteraction(eModeLookat);
  }

(Works for me, under very quick testing...)

EDIT:
To add 'right-click = Look', which I'd forgotten about...

Question to other AGSers:
That else seems a little clunky, but there doesn't seem to be an InvWindow.GetAtScreenXY that you could use to simplify it. Am I missing something?
#82
Off the top of my head
Code: ags

bool canPoison;

// room_RepExec or global repeatedly_execute
if (cMan.Frame >= 4 && cMan.Frame <=11) canPoison = true;
else canPoison = false;


// wherever the 'add poison' code goes (use inv on char?)
if (canPoison) {
  // Do stuff
}
else player.Say("Not right now..."); // or whatever


Depending on how exactly you've set things up, you might need to make canPoison a global variable (i.e. so you can set/check it in room and global scripts), and/or add a few checks the cMan and the player are in the right room (so you can't poison the poor fella when he's in the office and not the canteen, for example). In this specific case, it might actually be easier to use if (cMan.Frame >= 4 && cMan.Frame <=11) directly in the interaction and skip the variable, unless you're likely to need it for something else (e.g. other interactions with cMan).
#83
Do you mean like Character.Frame?

You might also want to check the View and/or Loop currently being used (not so much in your example, but there might be a call to), but there's properties for them, too :)
#84
Not directly, but it should be easy enough to do. Something like
Code: ags

function Count(this String*, String toCount) {
  int Count, Pos;
  while (Pos < this.Length) {
    if (this.Chars[Pos] == toCount.Chars[0]) Count ++; // Probably a simpler way to do this, but it escapes me ATM
    Pos ++;
  }
  return Count;
}

Then you could do
Code: ags

String UserInput = InputBox("Type a word");
Display("%s contains 'L' %d times", UserInput,  UserInput.Count("L"));

(You don't have to go the extender function method, of course. I just think it's neater if you're going to be doing this a few times... Since it doesn't look like you will be, the importat part is the while loop, just replace this with the name of the String you want to check and toCount.Chars[0] with the character to check for, e.g. 'L' - including the ' '.)

Possible downside is, it's case-sensitive ("hell" contains no 'L's, "HELL" contains 2). You could get around this by converting the input and toCount Strings to lower-case in the function (String.LowerCase).

EDIT, after monkey_05_06:
The caseSensitive parameter, you're totally right - I tested that version of the code, and I would've included it but it didn't seem particularly necessary (as it's probably only going to be used one time...). The char/String thing was deliberate - I personally prefer "L" to 'L', and the question was only about counting letters, not strings - but you're right (again), to make it as generic as possible, your naming is the best. The name - again, less generic, but is that really needed in this case?
(Off topic: I don't know, I can't win - make it generic, people accuse me of over complicating things, make it less generic, and I get accused of not being specific enough... :P)
#85
Critics' Lounge / Re: Burning Moon script!
Sat 20/06/2009 12:29:22
Auriond's last paragraph is what I was trying to say with
Quote
I can't imagine many people would be interested in just taking on the project for you wth no help (unless you paid them, of course  :)), but I could be wrong
but much better expressed. And goes double after having finished the script and seeing how walkthrough-like it really is. Great for showing off the feel of the game, but it'll require a lot more effort from whoever takes on the project to turn it into a workable 'design document' to build a game from. Without meaning to suggest all programmers can't draw their way out of a paper bag, or that all artists are technically inept (or that they're both tone-deaf), I seriously think you're looking at a TEAM effort, rather than being able to hand it off to a one-man-band who'll do graphics, programming and music themselves. Which might be easier to build (at the risk of repeating myself and auriond) if you were willing to collaborate, or could at least provided a more rounded version of the script. E.g. in dialogues, you've provided the correct player responses, but not what they're responding to. You obviously have a reason for telling the bandits you don't have any tomatoes, but why would you say that. (Bad example, as the bandits clearly must've asked - although why 'tomatoes' specifically, not just 'food' - is less clear :). And the kind of thing you might want to elaborate on.) Of course, if this was just the highlights version to show off the story, and there IS a 'full' version, you can ignore this...
#86
Two options, neither of which are actually that complicated to pull off:

1) Go back to using the Idle view, but change the delay before it starts to 0. This can't be done in the editor, so you'll have to use Character.SetIdleView in the game script (e.g. when you enter the room the character is in). Use it like
Code: ags

cNpc.SetIdleView(3,0);


2) Use Character.Animate, set to non-blocking, repeating animation.
Code: ags

cNpc.ChangeView(3); // If you want to use the character's normal view, you can leave this line out. Or use .LockView and .UnlockView, if you want the character to use their normal view later...
cNpc.Animate(cNpc.Loop, 3, eRepeat, eNoBlock); // Will animate the character with their current loop, repeatedly
// Play around with the 'delay' parameter (3 in this case) to get the speed right

Again, when the player enters the room is a sensible place for this.

Both of these functions are in the manual, and don't really require advanced scripting to use as you want (The SetIdleView entry even mentions this exact use...). Without meaning to be rude, you should be reading through the manual a bit more thoroughly before posting  :)

EDIT after Monkey_05_06:
Dude, pseudo-code, doesn't have to be accurate. I was actually thinking of Character.ChangeView but OK, altered in the interests of clarity.
#87
Critics' Lounge / Re: Burning Moon script!
Fri 19/06/2009 22:44:02
Ah, I misunderstood  - you didn't actually say you wouldn't be making it yourself, but that you/your friend weren't sure you could. I assumed that "feel free to message me ..." was for help, rather than someone to take the whole thing on. Fair enough, though, and it doesn't actually change my reply - definitely do-able if you can find someone willing to put in the effort with the (AGS) scripting, and based on the script as-is could actually be WORTH doing, too.
What would you be contributing, if it was a forum member rather than a friend that took it on? I can't imagine many people would be interested in just taking on the project for you wth no help (unless you paid them, of course :)), but I could be wrong. Similarly I wouldn't imagine you would want to just hand the whole thing over to someone else's control.
Since you've got a fairly detailed plan written, rather than just a vague notion to make 'something', you might find the Recruit a Team thread useful to, well, recruit a team to help with art, scripting, etc, as needed...
#88
I just figured "go search for it on the games page" was the first puzzle. Kind of appropriate for a game called 'Hidden Treasure', no? ;)
It's also - now, wasn't when I dl'd it - linked to in xXSasukexXXxUchihaXx's profile. Direct link would be nice but I don't think a locking is in order without it. Oddly, 'link to the game' doesn't seem to be one of the requirements for a post in this forum ::), just that there BE a completed game...
#89
Critics' Lounge / Re: Burning Moon script!
Fri 19/06/2009 16:42:31
I have to agree with Ghost on this one. Possible in AGS? Certainly. Something you should be attempting on your very first game? Oh, hell no! Start small until you're comfortable with AGS, then maybe try a couple of 'tech demo' games trailing the various not-standard-adventure-game parts, like the combat and shop components, THEN put this together. Remember, you don't have to release your first attempt(s), so you don't have to worry about spoiling the story in early versions. (Although making the whole script available online before you even start production, kind of covers the 'spoiler' thing I guess :))
And yeah, it definitely reads more like an RPG than a 'classic' AG (not that that's a bad thing, and I haven't finished it yet - it is a mighty wall o' text...). Maybe consider your reasons for making it in AGS, rather than a more RPG-based engine.

Beyond that, I can't add anything useful that Ghost and MoodyBlues haven't already said. Maybe I'll be able to when I finish.
#90
This wasn't bad for a 'first game' game, but I think it could've been a lot better with just a little extra work. As has been said, selecting inventory items was a bit of a pain. This could've been solved by using the same size icons for all items and adjusting the InvWindow's ItemHeight/Width properties as needed. And since you can now have different graphics for the items in the InvWindow and as cursor, you could still keep the current graphics for interacting with the scene. On which note, I had a bit of trouble knowing where on the Item cursor the hotspot was, which made using some of the items tricky (once I was actually able to select them, that is ;)). That's easily solved, though, by drawing the hotspot onto the graphic yourself, or having AGS do it for you. Also, it'd be nice if there was some indication of where/when you can exist scenes other than doorways (e.g. left out of the kitchen) - including side walls with doors would help here, or use hotspot labels, animating mouse cursors, etc. And finally, make it a little longer! I mostly enjoyed the mix of gameplay elements, but it seemed very short - which I guess is understandable from a first attempt game, really - and the puzzles where pretty simple (again, understandable).

I won't comment on the graphics - you've already said they're not the best (but maybe not as bad as you think!), they're not my forte, and they'll hopefully improve with time and practice anyway - except to say that, again, a little extra effort in adding details would probably make a major difference. (I'm thinking more about the amount of things in the scene - currently they're a bit empty - than the 'quality' of the art...)

My, that felt like a long post, but you DID ask for comments.
#91
Huh, I genuinely remembered the movie Arthur in shorts (well, knee-length pyjama bottoms), but then it HAS been a while since I watched it. You've got to give me the 'open robe' part, at least :), and that it's more 'modern' (less ... stuffy and English) look than series (or for that matter my personal imagining of) Arthur.

You asked where Grim Reaper was getting the movie inspired vibe from, and that's what popped into my head, because it's what I'd been thinking all along - more in the sense of 'seems CLOSER to the movie than the series version' than 'copied DIRECTLY from the movie', and obviously I'm not speaking for Grim here. The reason I didn't mention it before was ... you're right, it doesn't really matter, we all have our own versions of the characters in our heads. Provided you get the dialogue/description text and general 'feel' right (and based on this, you will) it's not overly important if your vision doesn't exactly match mine for every single character. Except movie Marvin vs. classic Marvin. If you'd gone with movie Marvin, we'd have had to have words...
The Trillian thing was just because we were discussing appearances anyway, and it struck me as odd that the film - for all the other liberties it takes - comes closest to matching her original description (although ZD's eyes are blue, not 'ridiculously brown'). You can take this as good criticism, or take it as a tangential comment between fans and just ignore it :)

EDIT:
Well, if you're not happy with the characters for whatever reason, then go for it - but don't feel you HAVE to redo them just because of a few throwaway comments by obsessive nerds ;D Personally, I'd rather you just got on with making the game, than get bogged down continually redesigning sprites that're already perfectly fine.
#92
So the flags thing does work, as far as playing game sounds goes?
I'm pretty sure it's either/or with the avi sound, unfortunately - but like I said, I've got no experience with it so hopefully there's a way round it. If not, your method sounds like the best compromise.
#93
Quote
i know that much
and you open the global script.asc
No, you select 'Import script...' then you navigate to wherever you saved the module and, well, import it. Left-clicking will expand out the node, giving you the option to open the global script. Right-clicking gives the option to import a module or create your own.
#94
How are you playing the video? I guess this is really 'what format is the video?' - if you're playing it with PlayVideo (that is, if it's any format but FLI/FLC) then passing 10 or 11 as the third parameter (flags) should keep game audio
Quote from: TheManual
FLAGS can be one of the following:
0: the video will be played at original size, with AVI audio
1: the video will be stretched to full screen, with appropriate
   black borders to maintain its aspect ratio and AVI audio.
10: original size, with game audio continuing (AVI audio muted)
11: stretched to full screen, with game audio continuing (AVI audio muted)


Or have you tried that, and it didn't work? (I haven't used PlayVideo in v3+, so it might not be as clear cut as the manual makes it seem...)
#95
The open-robe-and-shorts Arthur strikes me as movie inspired too. And yeah, for the full length game I'd kinda prefer it to be more like the TV series. It just looks too .. modern and not Arthur Dent-ish if he's not in proper pyjamas and a dressing gown. Didn't want to bring it up before ::)
Also, one of the few things I liked about Zooey Deschanel in the film is that - like Trillian - she actually has dark hair (dark brown or black in the book, IIRC). Everything else about her was crappy, though I didn't mind the film overall. Not great, but I didn't find it as horrible as Grim obviously did. Oh, and definitely stick with classic Marvin.
#96
What've you got in on_key_press for Ctrl-I? It's not a built-in shortcut in the current version (or in the older versions - IIRC both use Tab for inventory by default), so is it possible you missed something while updating the 'obsolete from older version' code (there, and in other 'Turn Inventory On' situations) that's 'wrong' but not obsolete enough to cause an identifiable error? (I'm guessing the "screen (as) black as s**t" isn't helpful enough to provide an error message that'd let us look at less obvious causes :P)
#97
I think this comes under 'don't ask, because it's been answered already' ;), since the BFAQ (Adding an intro or cutscene to your game) and Manual (Animations and cutscenes) pretty much cover this. Admittedly they're a little out of date (some script commands named in BFAQ, the 'Interaction Editor' mentioned in manual), but the basic process is the same - script them out using character and object animations, Display commands, speech, etc. Most AGS games feature examples of this method.

Alternatively, and maybe nearer what you want, generate them in another program, export them as compatable video files and use PlayVideo. Many AGS games use this, but I can't think of a specific example right now.
EDIT: Thought of a (bad) example just after I posted. AGS 180 Darts uses a WMV for it's intro 'cutscene'.
#98
Uncle Monkey's Story Timeâ,,¢ aside, I don't know why some functions accept the extra parameters and some don't (and I think it was so before the String/string crossover, so it's not wholly a legacy thing) but a rule of thumb I've spotted: If the manual entry has ", ..." in the sample declaration, like
Display
Display (string message, ...)

Then it can accept the 'optional' parameters for String formatting (e.g. Display, DisplayAt, Character.Think). If it doesn't have the ellipsis (e.g. Character.Say, Character.SayAt, Character.SayBackground, DisplayAtY), you need to use String.Format
#99
Actually, I think it's simpler than that. You have an extra " at the end of the line, before the final ) - dt.Second"); - which will cause a compilation error ('end of input reached in middle of expression'). You can use Ctrl-B on all braces and quotation marks to make sure they match up - the usual cause of that error. Otherwise it works fine as-is, provided you've still got the DateTime *dt = DateTime.Now; line in as well. (I'm assuming your resolution is high enough that 700,400 is on screen :))

In the future, it's helpful if you say WHY/HOW something isn't working as best you can (error messages, crashing, just not doing as expected...), but beyond that the manual examples and scripting tutorial are good places to start to pick up the rules. And always check braces, quotation marks, capitalisation, semi-colons at line ends, etc. It's the simple things that cause the most hair-tearing frustration, in my experience.
#100
Ugh, you're right. 12 noon SHOULD be PM, and isn't with that code. Also, 12 midnight is still displayed as 0. So yeah, a few more if ... elses needed.

Code: ags

if (dt.Hour >= 12) ampm = "PM";
if (12Hour > 12) 12Hour -= 12;
else if (12Hour == 0) 12Hour = 12;


That's what I get for trying to simplify the code too much. Stupid time, with all its stupid rules...
SMF spam blocked by CleanTalk