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

#2601
Depends what version you're using.
There's MoveCharacterToObject (CHARID, int object), but I think it's been obsolete-d in 2.7.

If you can't use that, you could create properties (e.g. 'WalkToX' and 'WalkToY') for each object, and use them as coordinates, or just don't enforce OO scripting.
#2602
hogie:
Put strazer's code anywhere in the global script (Ctrl-G to open), provided it's not in another function.

As a personal preference, I'd add a little variation with a Random (x) command, e.g.:
Code: ags

function unhandled_event(int what, int type) {

  if (what == 5) { // if clicked on an inventory item
    if (type == 3) { // if inv item cursor mode used
      int resp = Random (2);
      if (resp == 0) DisplaySpeech(GetPlayerCharacter(), "That doesn't work.");
      else if (resp ==1) DisplaySpeech(GetPlayerCharacter(), "They don't go together.");
      else if (resp == 2) DisplaySpeech(GetPlayerCharacter(), "I can't use this like that.");
    }
  }

}

(Only, less boring.)
#2603
You only need to create the function once. Try this:
Code: ags

function dialog_request (int param) {
  if (param == 1) {
    if (GetGlobalInt(1) >= 5) {
      NewRoomNPC(TROLLY, 1, 270, 140);
      MoveCharacter(TROLLY, 24, 140);
    }
    else {
      DisplaySpeech(ROGER, "I don't got no 5 bucks.");
    }
  }// end of param 1
  else if (param == 2) {
    Display("K it works");
  }// End of param 2
  else if (param == 3) {
     // Whatever
  }// End of param 3
  //And so on
}  //  End of dialog_request


And note, you'd put run-script 1 not run-script x1
#2604
The Wuzzles?

Don't ask why I remember this, I never even watched the bloody show. Even so, I now have the theme tune (one line anyway) going round my head.

Now 'The Gummi Bears', there was a cartoon.
#2605
General Discussion / Re: The new Looney Toons
Fri 11/03/2005 18:27:53
I'd actually seen something about this before, but assumed it was some sort of horrible joke.
#2606
rep_ex = repeatedly execute.

The 'nested functions not supported' error occurs when you have one function declared inside another. Usually (for me, at least) this is caused by a missing end brace. Since it's the second function declaration (in this case function show_inventory_window () {) that the engine sees as the problem, that's where it sayss the error is. However, since the problem is really likely to be that the function before that hasn't been closed properly, that's where you really need to look. Post the code for the function before line 108.
#2607
When I get that, it usually means I've missed a brace out somewhere. What's  on the lines before show_inventory_window?

By default, I think it's rep_ex. Have you added/removed anything there that might've caused this?
#2608
Take the spaces out of [ img ] and [ /img ]:
Code: ags
[img]http://www.2dadventure.com/ags/1.jpg[/img]


What's the game about? I found this in you other thread:
Quote
Like others this game is an adventure games where a young character named Steiner(like that one from Final Fantasy 9  Wink ) is involved in a story with dragons, mags ,knights etc. Right now i don't have a screenshot, but i will post one how suner i can.
But it's not much help - bit vague.
#2609
 @SCORE@       The player's current score
@SCORETEXT@   The text "Score: X of XX" with the relevant numbers filled in.
@TOTALSCORE@  The maximum possible score, specified on the Game Settings pane

Example: You have @SCORE@ out of @TOTALSCORE@ points.

EDIT: Put a label on the GUI you want the score displayed on (e.g the Statusbar), and set the text to one of the above.

Sorry about that, I typed this in notepad, and apparently hadn't selected it all when I copied it over.
#2610
If you want to use standard (non-dialog) scripting in a dialog, you have to use run-script x and the dialog_request function. Look 'em up in the manual, or do a forum search - there're a couple of threads around that explain them slightly more clearly than the manual.
#2611
SetViewport (x,y)
GetViewportX ()
GetViewportY ()

E.g.:
Code: ags

if (mouse.y > 180) { // cursor is within 20 pixels of bottom of screen (320x200/640x400)
  SetViewport (GetViewportX (), GetViewportY () + 1);
}
else if (mouse.y < 20) { // cursor is within 20 pixels of top of screen (320x200/640x400)
  SetViewport (GetViewportX (), GetViewportY () - 1);
}

(and so on for scrolling left/right)
#2612
Also, when you say:
QuoteThen in the interaction editor "Interact ovject - object - switch object back on."
Which object are you interacting with? If the headboard is an object, then it could still be an issue with baselines. However if it's an interaction for the note object, then it won't run while the note isn't visible.
#2613
IIRC, the stairs to the basement are at the front of the house, in the dining room area. I think they're hidden by the front wall initially.
#2614
The + and - mean, well, + and -.  Suppose NPC's x was 160, that would be:
Code: ags

if (character[EGO].x < 210) { // 160 + 50 EGO is no more than 50 pixels right of NPC
  if (character[EGO].x > 110) { //160 - 50 and no more than 50 pixels left of NPC
...


Although, it could be condensed to a single line:
Code: ags

if (character[EGO].x < (character[NPC].x + 50) && character[EGO].x > (character[NPC].x - 50)) { // if EGO is within 50 pixels of NPC


It just allows NPC to be approaching EGO from ether side. You may also want to add a check on the y cordinates, depending on how the room is set up.
#2615
1.
Try shifting the if (GetObjectGraphic(0)==152) ... line into the rep-ex as well.
Also, as it is, it's possible that the object's graphic is never 152 (the animation is restarted so often, it never reaches the second frame), so it would never have an effect. Try replacing the whole thing with:
Code: ags

// script for room: Repeatedly execute
a=Random(30);
if (a == 30) SetObjectGraphic (0, 152);
else SetObjectGraphic (0, 0);
if (GetObjectGraphic(0)==152) SetAreaLightLevel(1,110);

(I'm assuming the int a has been declared somewhere else.)

3.
But are the other values strings or ints? To set a string at the start of the game, declare it at the very top (the string message; line), but it's probably best to set it (StrCopy (message,"This is a message"); or StrFormat (message,"This is a message");) in the game_start function.
#2616
1.
Where in the script have you put that code? Also, is the character definately standing on the area affected? And not set to 'ignore room area lighting' (a checkbox on the Character window)?

2.
Have a look at SetInvDimentions (height, width), that might be able to help.

3.
Again, where exactly in the script is it? If it's just at the top of the global script, outside all functions, it would've said "Parse error: unexpected 'StrCopy'". If so, you need to move the second line into a function - which one depends on why you want it there in the first place.
#2617
Depends how complicated you want it - AGS might not be the best engine for a FPS, but it can kind of be done.
Here is Ponch's shooter code, and here is an example of how it looks. A Forum search for 'shooter' or 'shooting game' should turn up a few other ideas, as well.

EDIT: And This thread has a brief discussion on AGS shooter pros and cons.
#2618
I don't think whcih room you're in and where you want to go particularly matters, especially if you can't get it working at all. Scuthbert's suggestion should work, though.

Quote from: TokyoBlade on Sun 06/03/2005 15:24:46
i tried that 'on_key_press' in room script thing, didn't seem to work :(
Out of curiousity, what script did you have, and where did you put it? Did it return an error, or just not do anything?
SMF spam blocked by CleanTalk