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

#2501
Also, I think if you're using #defines not ints, it needs to be '+=' for some reason (works for me, anyway, but may be different since you're using an array).

So:
#define rate_trans 2

And:
aobj_trans[loop] += rate_trans;

EDIT: What strazer said, is what I meant.
#2502
I think room variables are only declared when the room loads. In this case, they'd also be reset to 2 everytime.
The '= 2' sticks now, because you're reseting it everytime the function is called - which might cause a problem if you want to make it something other than 2 later on. (I mean changing it during gameplay, obviously it'd be easy enough to change during scripting.) But, if it's a constant value, couldn't you use a #define (or enum) instead of an int?

As to why it didn't stick before - the default value for an int is 0, AFAIK, and I don't see how it could set itself to 100. It'd help if you could show what code you had.
#2503
Well, as stuh said, that could be really annoying to play and possibly needlessly difficult.

Although, if you included a setup function, to allow users to specify what they'd consider a 'short' press, and avoided complicated actions that relied on precise timing - or adapted them to the player's ability / made them optional - the dexterity side might not be such a problem. And, I suppose, a morse-code based interface isn't that much different from the Loom-type 'notes' - part of the game could be learning the combinations to access different, more advanced 'actions'. You'd probably need to include an on-screen key though, or it would probably be next to impossible.

Is anyone actually thinking of entering this? After looking throught the suggestions on the RetroRemakes site, I'm tempted to try and adapt a Darts game I made a while ago, but that might be a bit obvious. I wouldn't mind chipping in with some scripting if anyone else has an idea, though.
#2504
Well now thats bizarre. As I understand it, the MODE_XXX thing is just like a built-in define, linked to the cursor mode number (In 2.7, it uses enums, which are pretty similar).

EDIT: Which means you could probably set your own #define, e.g.:
Code: ags

#define MODE_THUMP 8

to link cursor mode 8 to MODE_THUMP

What exactly is the problem? What have you tried, and what is/isn't it doing? 
#2505
General Discussion / Re: Who said That !?
Tue 12/04/2005 10:51:19
It was in Competitions & Activities but got moved here, because it wasn't approved.
Also:
Spoiler
Paris P. Ogilvie, Pitch Black
[close]

"You're it, until you're dead or I find someone better."
#2506
I don't think you're necessarily that limited. You could have the 'cursor' set to cycle through every hotspot, object and character in the room, and a click brings up a verb-coin type interface. Within the interface, the options (Look at, Use, Talk to, Use Inventory on) are cycled through, as are the items in the inventory. Yes, it'd be frustrating having to wait through the cycle to get to the thing you know you need to interact with, but you could include 'Next Thing/Last Thing' options on the verbcoin, and surely it'd make for a richer game than just one timed puzzle after another. I don't see how that'd involve any more artwork that the average AGS game, either.

I actually kinda wish I could think of a game idea now. Sounds like fun.
#2507
Hints & Tips / Re: Dead City
Mon 11/04/2005 21:30:59
I played it a while ago. So did a few others round here, I think - I'm fairly certain there was a thread about it, somewhere.

Where exactly do you need help?
#2508
As a general tip:
, and the BFAQ, and the forums, and the tutorial in the manual, and the tutorials in the forums. Almost every question you've asked so far is answered in one of those places.

For example, searching the manual turns up these functions:
Quote from: The Manual
MoveCharacter
MoveCharacter (CHARID, int x, int y)

Starts the character CHARID moving from its current location to X,Y. CHARID can be either the character's number (as GetPlayerCharacter returns) or its ID set in the Room Editor. If the character cannot get to X,Y it will be moved as close as possible.
Control returns to the script immediately. The character will move in the background.

NOTE: this function only works with characters which are on the current screen.

NOTE: if you need to find out when the character has reached its destination, use the character[charid].walking variable. See the variables section for more information.
Quote from: The Manual
MoveCharacterPath
MoveCharacterPath (CHARID, int x, int y)

Tells the character CHARID to move to (X,Y) directly, after it has finished its current move. This function allows you to queue up a series of moves for the character to make, if you want them to take a preset path around the screen. Note that this works equivalently to MoveCharacterDirect, ignoring walkable areas.
This is useful for situations when you might want a townsperson to wander onto the screen from one side, take a preset route around it and leave again.

Example:

MoveCharacter (SOMEGUY, 160, 100);
MoveCharacterPath (SOMEGUY, 50, 150);
MoveCharacterPath (SOMEGUY, 50, 50);

tells character SOMEGUY to first of all walk to the centre of the screen normally (obeying walkable areas), then move to the bottom left corner and then top left corner afterwards.



And, searching the forums for 'NPC movement' turns up a number of possibilities, including this:
How can I make a NPC move across the screen?

As for triggering something when the guard collides with your character - someone else asked the same question just a few days ago, try searching the forums for it.
#2509
Where have you put that code?
If your inventory GUI isn't popup-modal, it should work if it you put it in rep_ex. Alternatively, setting the label text to @OVERHOTSPOT@ should also work.
#2510
Are any of the suggestions in this thread any use?
#2511
/Andy\
#2512
Actually, you don't need to move them to another room then back, just use NewRoomEx (room, x, y) to move the player character (change the transition type if you don't want it to fade in/out), or NewRoomNPC (charid, room, x, y) to move an NPC around with in the room.

You could also change the character's co-ordinates directly:
Code: ags

StopMoving (EGO);
character[EGO].x = 50;
character[EGO].y = 50;
#2513
A friend of mine has just gone to Australia to live for a year, leaving April 1st. All day I was half expecting him to call round and announce that the whole thing (quiting his job, months of anticipation, visa, etc) was an elaborate April Fools prank but, unless his parents are in on it, he has actually gone.
#2514
And it should look like:

#sectionstart hotspot1_a  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot1_a(){
  // script for hotspot1: Use inventory on hotspot
if (character[GetPlayerCharacter()].activeinv == 1) { // Scummbuddy's bracket
  SetCharacterIdle (0, -1, -1);
  SetCharacterView (0, 11);
  AnimateCharacter (0, 0, 3, 0);
} // Scummbuddy's other bracket
}
#sectionend hotspot1_a  // DO NOT EDIT OR REMOVE THIS LINE
(Which, now that I've fixed the bold type, is much the same as khrismuc's.)

Other things to check (if you haven't already):
Is '1' the right item number?
Is '0' the right character? I find it easier to use their script names (EGO), rather than numbers.
Is view 11, loop 0 the right loop?
What if you use AnimateCharacterEx (0, 0, 3, 0,1, 0);, to make the animation blocking? It might be, since your script isn't blocking, something happens to 'cancel' the animation before it runs.

And, out of interest, what's the SetCharacterIdle (0, -1, -1); for? Do you need to set the delay to -1, given that you're disabling the view anyway?
#2515
There isn't really one 'right' place to put the scripting - it depends on how & when you want it to be triggered.

If you want it to happen as soon as you enter the room, it's Player enters room (after fadein) you want, as described above. If you want it to happen after a certain time has passed, use a timer, then check if it's expired in Repeatedly execute (using SetTimer() and IsTimerExpired()). If you want it to happen when the player clicks on an object, go to the 'Objects' window, pick the object you want, and put the script in it's interaction editor. Same for hotspots, regions, or characters. (All of which should be mentioned in the Tutorial in the manual, if not in the manual itself.)

After you've started the script this way, then you can edit it directly in the Room script, since the functions (look at hotspot0, Player enters room (after fadein), talk to object4, etc) will have been created. Character interactions (Talk to EGO, Look at MAN, etc) are in the Global Script, not the Room script, and can be accessed from the 'Characters' window.
#2516
Yeah, it still uses the same GUI for Text and Speech, but you can use SetTextWindowGUI() to change between them during gameplay, so it looks like two seperate GUIs. E.g.:
Code: ags

SetTextWindowGUI (4);
DisplaySpeech (EGO, "Hey.");
SetTextWindowGUI (5);
Display ("Hey, yourself.");


(Or create custom functions that change for you)
As I say I might've missed your point but, if not, I doubt allowing seperate GUIs is very high priority, since it's easy enough to work around.
#2517
I might've missed your point, but couldn't you just change between the GUIs using SetTextWindowGUI(gui)?
#2518
Beginners' Technical Questions / Re: sprites
Thu 07/04/2005 18:16:54
If you right-click, you can change the size of the selection to import larger (or smaller, if you want) parts of the image, without having to grab the whole thing.
#2519
Once again, someone replies to something while I'm typing up my reply. And once again, I'll post it anyway:

You need to use the repeatedly_execute function, in the global script. Something like:
Code: ags

int changed;
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
  if (GetCursorMode () == 4) { // if you're in 'Use Inventory' mode
    if (GetLocationType (mouse.x, mouse.y) != 0 && changed == 0) { // Mouse is over something other than a GUI, and hasn't been changed
      ChangeCursorGraphic (MODE_USEINV, NEWGRAPHIC); // Replace NEWGRAPHIC with the sprite slot of the     graphic you want
      changed = 1; // Cursor has been changed
    }
    else if (GetLocationType (mouse.x, mouse.y) == 0 && changed == 1) { // Mouse is over nothing, but cursor is changed
      ChangeCursorGraphic (MODE_USEINV, GetInvGraphic (player.activeinv)); // Change cursor back
      changed = 0; // Cursor has been changed back
    }
  }
}


This'll change the cursor to the same image, no matter what item is being used. If you want a different image for each item, it's a little more complicated. The easiest way would probably be to give each item an 'Alternate Cursor' property, in the editor, and use ChangeCursorGraphic (MODE_USEINV, GetInvProperty (player.avtiveinv, "Alternate Cursor"); to change it.

If you want an animated view, set it up in an unused cursor mode, and use SetMouseCursor(mode); to change it, and SetDefaultCursor() to change it back.

Candle's way is good as well (although it doesn't deal with 'Use Inv' mode), since it's a more general 'Change cursor over thing' script than mine . It could be trimmed down a little, though:
Code: ags

if (GetLocationType (mouse.x, mouse.y) != 0) {
  if (GetCursorMode()==0)  SetMouseCursor(5); // if WALK change cursor to CHANGED WALK
  else if (GetCursorMode()==1) SetMouseCursor(6); // if LOOK change cursor to CHANGED LOOK
  else if (GetCursorMode()==2) SetMouseCursor(7); // if USE change to CHANGED USE
  else if (GetCursorMode()==3)  SetMouseCursor(8 ); // if TALK change to CHANGED TALK
}
else SetDefaultCursor(); } // change back to default
#2520
Now you mention it, I think I did know that, somewhere at the back of my mind.

So, you'd either have to do the whole thing in scripting (which I was trying to avoid, to keep it simple), something like:
Code: ags

MoveCharacterBlocking (EGO, 200, 180, 0);
SetGlobalInt (1, player.loop);
FaceLocation (EGO, 180, 180);
FaceLocation (ELF, 200, 180);
RunDialog (0);


Or, create a variable in the interaction editor, and use:

character-movechar (EGO,200,180,true)
Game - Set variable value (previous, 1)
character -face location(EGO,180,180)
character -face location(elf,200,180)
game run dialog(0)

NOTE: You'll need to figure out for yourself what the values of 'previous' would mean, since you won't be able to automaticly use the loop numbers. Maybe 0 = up, 1 = right, 2 = down, 3 = left would make more sense?

Then, change the dialog_request to:
Code: ags

function dialog_request (int param) {
  if (param == 1) {
    // Change facing direction, based on 'previous'
    //  Make sure the directions match whatever values you're using for 'previous'
    if (GetGraphicalVariable ("previous") == 0) FaceLocation (EGO, player.x, player.y + 50); // Face down
    if (GetGraphicalVariable ("previous") == 1) FaceLocation (EGO, player.x - 50, player.y); // Face left
    if (GetGraphicalVariable ("previous") == 2) FaceLocation (EGO, player.x + 50, player.y); // Face right
    if (GetGraphicalVariable ("previous") == 3) FaceLocation (EGO, player.x, player.y - 50); // Face up
    Wait (1);
  }
}
SMF spam blocked by CleanTalk