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

#21
Wait a moment... I also just found a solution for both the issues of online manual not finding substrings and CHM engine not finding substrings!

Online manual (https://adventuregamestudio.github.io/ags-manual/): it's set by default for "full word matching", which can be disabled by clicking on the underlined "ab" in rhe searchbox.

CHM file: it needs wildcards! Searching for "createfrom*" shows multiple results.

#22
I created a script which turns the raw .md files of the AGS manual into a single, searchable HTML file, you can find it here:

https://github.com/jumpjack/Space1999Adventure/blob/main/markdown-converter.html

The html file created is very raw: no styles, just the raw output of pandoc tool applied to all single .md files,  but all links (both internal and external) are active.

The final result is available here:

https://github.com/jumpjack/Space1999Adventure/blob/main/ags-manual.zip

If anybody can suggest an Unix equivalent for the DOS batch file which creates the html  files from .md files, I can add it to my page.

The DOS batch file is as follows, and must be save in same folder of .md files:

Code: ags
for /r .\ %%M in (*.md) do (
  pandoc %%M -o %%~nM.html
)

Of course the final objective is just to make the whole manual searchable for free text.
Now I know that there are 51 occurrences of "createfrom" and 320 of "dynamic"  ;)

#23
Quote from: Nahuel on Mon 09/01/2023 17:47:25What are you trying to search for exactly, there' no match for that in the manual, google doesn't find = correct. What's the final outcome on this new thread question?
It's the opposite of what you say.

And it looks like its a github "feature": https://stackoverflow.com/a/43911827/1635670
"Currently, we do not support substring matching in our search"
#24
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?
#25
I don't get it: can I do it or not?
How can I create "something" on which I can use these functions?
#26
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?
#27
Quote from: Khris on Sat 07/01/2023 11:26:19I'm sorry, but can you clarify what you're asking for exactly?
The solution to this issue is to either
a) create an array of dynamic sprites so each overlay has its own
b) use the clone option so each overlay has its own

The github post seems to just restate the original problem, which in my book is thoroughly analyzed and solved already?
my script is working fine, I don't need any further help, thanks.
#28
I added further info and a screenshot in the issue, but it is closed and discussion should continue here:

https://github.com/adventuregamestudio/ags/issues/1882#issuecomment-1374435160
#29
Quote from: Snarky on Fri 06/01/2023 14:18:06
Quote from: jumpjack on Fri 06/01/2023 08:47:50I think the main issue is that the engine should not go on with an arbitrary value for the sprite: a program should never act "on its own", inventing a pointer!

It's not an "arbitrary value," it's 0, aka null.
[/quote]
If 0 and null are considered "the same", we have a serious problem here.
Anyway I leave the discussion to AGS experts, because I found the solution for my script.
#30
Whatever is happening here (and I don't understand anything yet  ;) ), I think the main issue is that the engine should not go on with an arbitrary value for the sprite: a program should never act "on its own", inventing a pointer!

Possibly this mechanism is a precaution introduced to prevent game from crashing in production, but I think it's mandatory for the editor to warn the developer that there is a serious error (a missing pointer!) not managed by developer. The final user would only see a weird unexpected object on the screen, and the game would not crash, but a wrong item on the screen possibly  could even prevent the user from finishing the game: he would get stuck for unknown reason, and this would make him VERY sad, and he would throw away the game. This could even happen in first room, and the game would never be played.
#31
Opened issue, with screenshots and full code:

https://github.com/adventuregamestudio/ags/issues/1882
#32
Thanks. I already modified the original script, which moved character horizontally and vertically, but I needed diagonal moves.
My character has only 4 directions, unlike the one in the demo, which I am currently still using.
#33
Quote from: Crimson Wizard on Wed 04/01/2023 15:28:24If this is what actually happens, then it of course should be considered an engine bug. I would separate solving the bug and workarounds; and I'm mostly interested in the bug details atm. There's a ticket opened about same problem: https://github.com/adventuregamestudio/ags/issues/1879
Ideally we'd need a walkable mask, and an example of starting position / Walk command arguments which causes character to stuck. This would help to reproduce and diagnose the problem.
Yes, that is MY ticket. :-)
I just attached there the game and the mask.
#35
Reopening this ancient thread to propose a generic solution.

Adding this statements inside repeatedly_execute() function in global script should fix the issue:

Code: ags
 if (GetWalkableAreaAtRoom(  player.x,  player.y) == 0) {
   cEgo.PlaceOnWalkableArea()
}

This places the player in closest walkable area as soon the player itself is detected as being out of any walkable area.
#36
Quote from: jumpjack on Tue 03/01/2023 16:34:28
Quote from: Crimson Wizard on Wed 28/12/2022 19:39:05I honestly still do not understand why cannot you make the non-walking area further from their tiles to compensate for character's sprite width? I think that would be the first thing I'd try, if I were experimenting with such setup. Would not the result look approximately as if the character's "blocking area" was working the way you implied? Is there anything that prevents using this method?
Available walking areas are already quite small, anyway I'll give it a try.
I gave it the try. :-)
I had to reverse the logic: rather than manually drawing walkable tiles, I had to make whole room walkable and "drill" nonwalkable tiles in it; else, by reducing size of walkable tiles resulted in many walkbale areas separated by some pixels...
So, rather than reducing walkable areas I extend non walkable areas.
Note: apparenly it's better, for isometric games, not to extend the nonwalkable areas/tiles in all directions, but only downwards.
#37
[deleted]
#38
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.
#39
Quote from: Crimson Wizard on Tue 03/01/2023 17:17:12At the moment I do not fully know which walking behavior you are trying to achieve,

You can see here the game I wouold like to port to AGS:

https://jumpjack.github.io/oricutronJS/oricutron.html

Click on START button adiacent to "Start emulator with demo disk (to create filesystem)" to load the game in the emulator.

M = Move forward
B = Move Backward
S = turn left
X = turn right
#40
Note:
the background.DrawImage statement is there just for debugging, to see if I was doing something wrong with overlay: it draws exactly what the overlay statement should draw (flipped sprite), but it has no real use, because I need the player to pass behind the drawing, hence I need an overlay.

My source is currently a mess :-) , anyway how do I upload a .zip to the forum?
SMF spam blocked by CleanTalk