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

#1321
You know you can set the speed when using MoveObject?

Quote
while object is animating wait(1)

Animating != Moving
You would have to use IsObjectMoving:

Code: ags

  MoveObjectDirect(0, 160, GetObjectY(0), 1); // move object to middle of room
  while (IsObjectMoving(0) == 1) Wait(1); // wait until object is has stopped moving
  // at this point the object has arrived
  // do your stuff, animate door and so on


If this is still too fast for you, do it like this:

Code: ags

  while(GetObjectX(0) > 160) { // while object has not arrived in middle of room
    SetObjectPosition(0, GetObjectX(0) - 1, GetObjectY(0)); // move object 1 pixel to the left
    Wait(10); // wait 250 ms (increase this to slow it down even more)
  }
  // at this point the object has arrived
  // do your stuff, animate door and so on
#1322
As I said, GetWalkableAreaAt works with screen coordinates, but Character.x are room coordinates, so try this:

if (GetWalkableAreaAt(character[GetPlayerCharacter()].x - GetViewportX(), character[GetPlayerCharacter()].y - GetViewportY()) == WALKABLEAREA_NUMBER) {
#1323
I don't know what events can't be implemented using the current system, but I think BeginDialog and EndDialog would be very useful.
Search the tracker page for "event" to see all prior suggestions.
#1324
It works fine here (using my if-clause).

Which one of our suggestions have you used?
How big is the room?
What are your LEFT_EDGE etc. settings?
#1325
GetWalkableAreaAt works with screen coordinates, so you may get problems in scrolling rooms. But either way should work.

Edit:

In general, has anyone tested if you can pass negative values for things that are left of the viewport and higher values for things that are right of the viewport to functions that expect screen coordinates?
#1326
LEFT_EDGE and RIGHT_EDGE have to be the outermost edges of the walkable area.

If your character is able to walk outside this walkable area, try this:

Code: ags

//...

  if ((character[GetPlayerCharacter()].x >= LEFT_EDGE) && (character[GetPlayerCharacter()].x <= RIGHT_EDGE)) {
    int scaling = SCALING_MIN + (((character[GetPlayerCharacter()].x - LEFT_EDGE) * (SCALING_MAX - SCALING_MIN)) / (RIGHT_EDGE - LEFT_EDGE));
    SetAreaScaling(WALKABLEAREA_NUMBER, scaling, scaling);
  }

//...
#1327
General Discussion / Re: Profile thing
Tue 26/04/2005 01:21:05
Use the same code you use for posting:

Code: ags

[img]http://www.yourserver.com/yourimage.jpg[/img]


Questions regarding the forum system belong in General Discussion.
#1328
There's an undocumented game.in_cutscene variable. Is that what you're looking for?

Edit:

Hm, reading over your post again, probably not.
Does putting the StartCutscene and EndCutscene commands in custom functions work?

Code: ags


function myStartCutscene(CutsceneSkipType skiptype) {

  // do stuff, turn off some GUIs etc.
  StartCutScene(skiptype);

}


function myEndCutscene() {

  EndCutscene();
  // do stuff, turn on some GUIs etc.

}


function some_interaction() {

  myStartCutscene(eSkipAnyKeyOrMouseClick);

  // the cutscene

  myEndCutscene();

}


Edit 2:

I like the on_event suggestion, btw.
#1329
Quotein the main header (CTRL+H)

If you declare a variable in the main script header, seperate variables will be created for the global script and for each room.

To access a variable defined in the global script from inside room scripts, you have to export it first, then import it into the room script where you need it or in the main script header to make it accessible from all room scripts.
Character interactions are handled in the global script, so you wouldn't need to export/import it just for that.
So do

Code: ags

// main global script

int noblague;
export noblague;


and

Code: ags

// room script

import int noblague;
// now this room script (rep_ex) has access to the variable defined in the global script


or

Code: ags

// main script header

import int noblague;
// variable is now accessible from ALL rooms
#1330
Quote5,2 in the error above I'm guessing refers to my Gui and control object, ie. the Listbox...

I don't think so, not sure though.

Here is what CJ had to say about similar error messages from an earlier version, maybe it helps you track down the problem:

QuoteAn exception 0xC0000094 occured in ACWIN.EXE at EIP = 0x0042182A ; program pointer is +6, ACI version 2.56.627, gtags (2,0)

CJ: "Hmm, it looks like a crash trying to display an empty line of text."

QuoteIllegal exception! 0xC0000005 occured in ACWIN.EXE at EIP = 0x0043C28E ; program pointer is +6, ACI version 2.56.627, gtags (1,17)

CJ: "The most likely cause is you've deleted the sprite for mouse cursor 6, which is the mouse pointer that comes up in the Ctrl+X window."

QuoteAn exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x0040D2DB ; program pointer is +6, ACI version 2.56.627, gtags (0,19)

CJ: "That's some sort of text rendering problem."
#1331
What's the exact error message?
#1332
I have no experience with custom save/load GUIs, but try this

if (keycode==365) { // F7
  gui[5].Visible = true;
  LoadList.FillSaveGameList();
}
#1333
Yeah, that's nice, I do it the same way and it works fine.

By "the exact right spot", do you mean the location of the region?
If you click outside a walkable area, the character should walk as far on the walkable area as he can. Why he would only do that on side doors and not back doors I don't know.
#1334
Where have you put the declaration of the variable (int noblague)?
And what interaction is it (object/character/hotspot/item)?
#1335
Hm, looks okay to me.

Quote
I test it once , it usually works , I close and test it again,  it doesn't.

That's hard to believe if you do the same things both times. Very strange.

QuoteLoseInventoryFromCharacter(EGO,18);
works if I repeat the action, I mean if I hang the coat twice.

That would indicate that you have the coat twice in your inventory (as a single item).

Do you directly add the inv item via a dialog script command or do you do it via dialog_request?
Could you please post the dialog script and the dialog_request function in case you use it?

Quote
character[GetPlayerCharacter()].inv[18] = 0;  doesn't work at all.

Do you change player characters somewhere?
Does
  character[EGO].inv[18] = 0;
work?

If all else fails, you could upload the game for us to take a look at.
#1336
Hm, if this "Run script" action isn't a child action of an interaction editor conditional, using any inv item on hotspot 12 will remove one instance of inv item 18 from EGO's inventory. That doesn't make a lot of sense.

I still don't quite know what you're trying to do.
Please describe in more detail what you want to happen in the game so we can give a step-by-step solution.
I don't mean "I want to remove an item" but rather something along the lines of "If the player uses inv item A on hotspot 1, item A should be removed from the player character's inventory and the player character should say 'Hello'" or something.
#1337
Try this:

Code: ags

// room script

// adjust these to your needs:
#define WALKABLEAREA_NUMBER 1
#define LEFT_EDGE 20
#define RIGHT_EDGE 150
#define SCALING_MIN 80
#define SCALING_MAX 100

function repeatedly_execute_always() {

  int scaling = SCALING_MIN + (((character[GetPlayerCharacter()].x - LEFT_EDGE) * (SCALING_MAX - SCALING_MIN)) / (RIGHT_EDGE - LEFT_EDGE));
  SetAreaScaling(WALKABLEAREA_NUMBER, scaling, scaling);

}


The formula could probably be streamlined a bit, I'm not too good with these things.
Any math wiz's please step in.
#1339
No.

You can code your own program however, since the setup only modifies the acsetup.cfg file. You can find some options you can change here and in the cfg-file itself of course.
#1340
Strange. There must be something wrong with your script or where you've put it.
Can you please restate your problem (what should happen, what does happen) and post the actual code you're using?
SMF spam blocked by CleanTalk