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

#1
Engine Development / Splash screen build date
Tue 17/01/2023 09:00:36
In splash screen of Build 3.6.0.38 I read "November 2022", shouldn't it read january 2023?
#2
Upon creating a new game in 3.6.0 RC4, if I select the empty template I am warned about it being... empty  ;) , and suggested to use "Defualt Game" template, but there is no Default Template available: I see Bass, Empty Game, Sierra-Style, Tumbleweed and Verb Coin.
#3
My game is behaving weirdly again. :-)
I define ZOrder of all my overlays only once at room creation, but I see various overlays changing draw order while character moves around them: sometimes overlay A is drawn over overlay B, other times B gets over A while character moves around; how do character movements influence overlays zorder?

This is the web version (continuously changing, so it could be not working at all when you run it...):
https://jumpjack.github.io/Space1999Adventure/AGSdebug/  (press CTRL+F to unlock the character)

Note:
the room is drawn by layers: layer 0 for floor, then further 3 layers for various objects; the flickering objects, for example windows, are on layer>0.

I seacrhed for "ZOrder" in whole project, but it only occurs in room script, at room creation.
#4
I need that my character Y position is constantly added a fixed quantity as long as character remains inside a region.

I tried with this:

Code: ags
function region1_Standing() {
  //if (!raised) {
    cEgo.y -= 10;
    raised = true;
  //} else {
    // already raised
  //}
}

If  lines are commented, character flickers between "normal" and raised position.
If they are not commented, character Y position is changed only at the beginning, then turns back to the one calculated by pathfinder.
#5
This google query should return any page containing "createfrom" substring, but id does not work with adventuregamestudio.github.io:

site:https://adventuregamestudio.github.io/ags-manual CreateFrom

Maybe there is some access flag to be enabled on github?


And I cannot search free text in the searchbox of the usermanual , as it returns "no match".


So how do I search for free text?
#6
I can't find any suitable function to add/create room objects at runtime, is it possible? If not, can I "hookup" an overlay or a sprite (the only things I know how to create at runtime) to an object created in editor, so as to be able to use object functions on it?
#7
Sometimes it happens that my character moves to a location where it cannot move away anymore, nor by mouse neither by keyboard. Apparently if walks to a nonwalkable area, and it can't get out anymore.
I don't know how it can get there, but once it happens, how can I unlock it? How can I "undo" the character to previous position upon detecting no further possible moves?

Notes:
- V. 3.6.0 RC4
- character is not at room edge
-  I am not using "adjust speed" or "scaling"
- room is static, not scrolling


edit:
I don't know if this can help, anyway I logged these positions before character getting stuck:
(w and w are walkable area in current screen/room position)

2023/01/04 12:09:21 - x,y,w,w = 164,83,1,1
2023/01/04 12:09:21 - x,y,w,w = 168,85,1,1
2023/01/04 12:09:21 - x,y,w,w = 171,86,1,1
2023/01/04 12:09:21 - x,y,w,w = 174,85,1,1
2023/01/04 12:09:21 - x,y,w,w = 178,83,1,1
2023/01/04 12:09:21 - x,y,w,w = 175,80,0,0

Here I even detected a move inside a non-walkable area:

2023/01/04 12:09:21 - x,y,w,w = 170,86,1,1
2023/01/04 12:09:21 - x,y,w,w = 173,82,1,1
2023/01/04 12:09:21 - x,y,w,w = 177,80,1,1
2023/01/04 12:09:21 - x,y,w,w = 178,79,1,1
2023/01/04 12:09:21 - x,y,w,w = 175,80,0,0
2023/01/04 12:09:21 - x,y,w,w = 171,82,0,0

I implemented this "emergency function" which brings the character back to last valid position while saving debug data previously logged:

Code: ags
   if (GetWalkableAreaAtRoom(  player.x,  player.y) == 0) {
    for (int index=0; index < 1000; index++) {
      //debugPrint(String.Format("x,y,w,w = %d,%d,%d,%d",  prevXarr[index],  prevYarr[index],  prevWarr[index],  prevW2arr[index]), false);
      if (prevWarr[index] !=0) {
        player.x = prevXarr[index];
        player.y = prevYarr[index];
      }
    }
  }

I put it inside repeatedly_execute() in global script: given that in no case the character is allowed to be into a nonwalkable position, as soon this condition is detected, the position is brought back to last valid one. I don't know if this is the best method, or if it would be better to just call cEgo.PlaceOnWalkableArea() upon detecting character on forbidden position, but I wanted to log the positions which led to the wrong position.
#8
What's wrong with this code?

Code: ags
      DynamicSprite* flipped = DynamicSprite.CreateFromExistingSprite(tileIdNorm,  true); 
      flipped.Flip(eFlipLeftToRight); 
      roomOverlay[overlayIndex] = Overlay.CreateRoomGraphical(screenx - tilewidth/2, screeny - 2*tileheight -3,  flipped.Graphic);
      roomOverlay[overlayIndex].ZOrder = isoX + isoY;
      background.DrawImage(screenx - tilewidth/2, screeny - 2*tileheight -3,  flipped.Graphic);

drawImage properly draws the flipped sprite, but CreateRoomGraphical draws sprite slot n.0, although flipped.Graphic is = 65 , and I have static sprites numbered from 0 to 64.

Documentation:
Code: ags

static Overlay* Overlay.CreateRoomGraphical(int x, int y, int slot, optional bool transparent, optional bool clone)

DrawingSurface.DrawImage(int x, int y, int slot, optional int transparency,
                            optional int width, optional int height,
                            optional int cut_x, optional  int cut_y, 
                            optional int cut_width, optional int cut_height)
#9
Can I "intercept" character position before it's actually updated, to prevent its updating upon my own conditions?
I see that DestinationX/Y only contain final destination for mouse control, not for keyboard control.
#10
Documentation on overlays say that this line:

Code: ags
Overlay* myOverlay = Overlay.CreateGraphical(100, 100, 300);

Should show sprite slot 400 at position 100,100 of the screnen... but I don't see anything.

To see something, I have to add:

Code: ags
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawImage(roomX - tilewidth/2, roomY-tileheight*4/2, myOverlay.Graphic);

Same happens for everything else: Overlay.CreateRoomGraphical, Overlay.CreateRoomTextual, Overlay.CreateTextual,...

I can't find any other example on overlays, can anybody help?

But actually I don't know if I need overlays for my purposes: I want to build a room tile by tile, and some tiles have transparent pixels, so the player should be visible when it pass behind such tiles.

Maybe I should use objects instead? Or something else?

Or should I create my own walkbehind image programmatically? I have available two versions for each tile image: one single PNG with some transparent pixels, or a BMP couple (image + transparency mask).

SMF spam blocked by CleanTalk