Ambrosia Garden Archive
    • Access check? Any ideas?


      I'm trying to figure out some way to check the restriction on a tile from within a game. Ie, a tile can be set to be either 'blocked' or 'clear' within the CGE code, and it can be changed as well. However, I see no way to place a conditional check to see whether or not a tile is blocked or clear.

      I have a method of moving a player around my game and there is a way to move to a random location. Unfortunately with a random utilization of map position, it will simply send the player to the randomly selected coordinates. If the tile the player lands on is set to be blocked then the player ends up not being able to move.

      However, it has been discovered that in PoG if you land on a restricted tile and are trapped, that you can save and reload your game and PoG will then move the player to a free tile. Thus somewhere within PoG's code is a check on the tile that the player is loading on, and if it is blocked it moves the player to a free tile.

      So my thinking is that since PoG was built with CGE that there has to be a way to check on this. But darned if I can find it!

      Anyone have any ideas or solutions?

      ------------------
      "But soon, soon, soon... the world will be a better place, with meadows and bunnies and fiber optics in every home..."
      - Tom Dowdy, Apple Computer
      ------------------
      (url="http://"http://www.avalon.net/~honda/pog/pogwalkthrough2a.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/vftp/dl-redirect.pl/PoG_Dev_Tools_Source.sit?path=coldstone/resources&file;=PoG_Dev_Tools_Source.sit")PoG Dev Tools(/url)

    • I know that the idea I'm going to give you will work, however forgive me if I don't give things their proper names!

      What you can do is fake a random teleport by having a global that gets rolled to a random number between - say - one to ten. Then have a bunch of conditionals that are assigned to check if the global is one, two, three...

      The conditional will then send the player to a predifined location that you have set that is not blocked. You can make 30 or more of these and it'll look like it's random, but you'll know that it's not! πŸ˜‰

      The second idea I'm not sure if it will work, but you can try it - though I think it'll be more work than you'd think. Have an event on every tile that checks to see if itself is blocked, thus when the player lands on it it will automatically unblock itself!

      I hope that made sense and helped! πŸ™‚

      ------------------
      Here's my site! There is art, music, movies, and games are on there way!
      (url="http://"http://www.sinthesisent.com")http://www.sinthesisent.com(/url)

    • Quote

      Originally posted by Klatu:
      ~snip~

      Thanks for the suggestions Klatu, you explained your ideas very well but unfortunately neither of those are feasible.

      If you consider a world with say, a meager 20 areas, and each area being a map of 200X200 tiles. If just 10% of the tiles on a given map are blocked, that would be 4000 tiles per map. And obviously not every map is going to have the same tile coordinates listed as blocked.

      This would entail either A) setting up an event to check the area that the player is in, then assign a pre-defined set of random locations to send the player to, or πŸ†’ again check the location and then look up all the blocked areas and if the random roll is equal to one of those blocked coordinates then re-roll the coordinates.

      Neither of these is a feasible solution.

      Also, simply unblocking the square that the player lands on is not a viable solution either, because many times blocked tiles are blocked in groups. So while the player's square may be freed, his surrounding tiles are blocked and he is still trapped.

      I actually require a method to check a tile to see if it is blocked or clear. This shouldn't be hard; it should be in the conditionals list, in my opinion. PoG does this, although the method of checking is not listed anywhere in the manual, nor can I figure out how to do it in Coldstone. But there has to be a way. I do not believe that PoG checks the player's coordinates upon loading a saved game and then checks these coordinates against a "master list" that was hand entered of all the blocked squares in the game, and if they match a set of blocked coordinates then the game engine moves them to a free square.

      Thanks though. Anyone other ideas? πŸ™‚

      ------------------
      What's The Difference Between Roast Beef And Pea Soup?
      Anyone Can Roast Beef.
      ------------------
      (url="http://"http://www.avalon.net/~honda/pog/pogwalkthrough2a.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/vftp/dl-redirect.pl/PoG_Dev_Tools_Source.sit?path=coldstone/resources&file;=PoG_Dev_Tools_Source.sit")PoG Dev Tools(/url)

      (This message has been edited by Stark Bledfast (edited 08-30-2002).)

    • Quote

      Originally posted by Stark Bledfast:
      Also, simply unblocking the square that the player lands on is not a viable solution either, because many times blocked tiles are blocked in groups. So while the player's square may be freed, his surrounding tiles are blocked and he is still trapped.

      Well actually, if this event was on every tile, the player wouldn't be trapped because simply walking on one of the surrounding tiles would unblock that one as well. But the player could therefore walk on any other restricted tile and it would become unblocked, so the player could access any tile on the map. :frown:

      ------------------
      Visit The Search for Lezaref Website at (url="http://"http://www.geocities.com/mulletsailors") my old website(/url) or see (url="http://"http://homepage.mac.com/pcheese")my new website(/url)
      ------------------
      BNET: PCheese IRC: PCheese AIM: PCheese87 email: pcheese@mac.com
      come on over to irc.ambrosia.net

    • Quote

      Originally posted by PCheese:
      Well actually, if this event was on every tile, the player wouldn't be trapped because simply walking on one of the surrounding tiles would unblock that one as well. But the player could therefore walk on any other restricted tile and it would become unblocked, so the player could access any tile on the map.

      Yep, which would make restricting tile access an effort in futility.

      ------------------
      What's The Difference Between Roast Beef And Pea Soup?
      Anyone Can Roast Beef.
      ------------------
      (url="http://"http://www.avalon.net/~honda/pog/pogwalkthrough2a.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/vftp/dl-redirect.pl/PoG_Dev_Tools_Source.sit?path=coldstone/resources&file;=PoG_Dev_Tools_Source.sit")PoG Dev Tools(/url)

    • What about creating an event ("ThisTileIsBlocked") that simply calls your random teleport action again (or simply performs the teleport itself)? Assign said event to every blocked tile on your map, and (in theory) it will keep bouncing the player around and around the map until he lands somewhere that's not blocked. I can see that there might be some potential problems with memory overflow or the like if the player gets bounced too many times, but it's worth a shot.

      ------------------
      AKA Glennfield, Glenndella, Jynnan Tonnyx, Breva, and/or BΓΆlverk.
      ζˆ‘δΈθ―΄δΈ­ζ–‡ πŸ™‚ (Can anyone read that?)
      (url="http://"http://www.itswalky.com/d/20020123.html")"A monkey and a hot girl fighting - I can die happy now."(/url)

    • Quote

      Originally posted by Glenn:
      What about creating an event ("ThisTileIsBlocked") that simply calls your random teleport action again (or simply performs the teleport itself)?

      Glenn,

      Again the solution would work, but isn't really a viable option. This is going into a plug-in and tracking down/creating all the entries into map cell change objects would be a living nightmare just for one map; let alone the 130 or so maps in the game, heh.

      Unfortunately it just sounds like I'm going to have to keep pestering Dee to add a tile access check into the conditional object. That and adding the ability to check map size.

      Thanks though.

      ------------------
      What's The Difference Between Roast Beef And Pea Soup?
      Anyone Can Roast Beef.
      ------------------
      (url="http://"http://www.avalon.net/~honda/pog/pogwalkthrough2a.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/vftp/dl-redirect.pl/PoG_Dev_Tools_Source.sit?path=coldstone/resources&file;=PoG_Dev_Tools_Source.sit")PoG Dev Tools(/url)

    • Hi, I don't know how you can check the tile... :frown: But depending on the effect you are trying to achieve with the random teleport in your game, you could let the player choose to teleport again if they are stuck in a wall. Being possibly stuck in a wall could be a price of randomly teleporting. You could then teleport them again completely randomly, or you could teleport them in a more local region, like a 10 cell radius. You could even ask them where they wanted to teleport within a certain number of cells if they got stuck. None of these though are really very elegant solutions, although somewhat usable if the cause of the random teleport is the player casting a spell.
      --katherine

      ------------------

    • Quote

      you could let the player choose to teleport again if they are stuck in a wall. Being possibly stuck in a wall could be a price of randomly teleporting.

      Ms. Katharos,

      Yeah, this is how I have it set-up now. It is a spell and it sends the player to a completely random location. If the player happens to become trapped by teleporting into a rock/tree/wall/whatever, they can certainly cast the spell again, provided they have enough mana for it. Alternatively, they can save their game and then reload it, and PoG will automatically move them to a free space. My attempts is to "fix" this "bug" so that they never land in the blocked spaces.

      I guess my frustration lies in the fact that the PoG engine is "smart" enough to figure out which tiles are blocked and will move a player off of one during the load feature. I don't like that we do not have access to functions that the engine uses which could be helpful.

      Thanks for the input.

      ------------------
      What's The Difference Between Roast Beef And Pea Soup?
      Anyone Can Roast Beef.
      ------------------
      (url="http://"http://www.avalon.net/~honda/pog/pogwalkthrough2a.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/vftp/dl-redirect.pl/PoG_Dev_Tools_Source.sit?path=coldstone/resources&file;=PoG_Dev_Tools_Source.sit")PoG Dev Tools(/url)

    • Quote

      Originally posted by Stark Bledfast:
      **Ms. Katharos,
      **

      Just curious? Can you set the random teleport to stay within a range of coordinates? That way the Hero would not teleport into a hostile blocked environment.

      ------------------

    • Quote

      Originally posted by Toast:
      Just curious? Can you set the random teleport to stay within a range of coordinates? That way the Hero would not teleport into a hostile blocked environment.

      Yes, you can. But the problem then is to create a list of all the blocked tiles; which in the application I'm using changes from map to map, and with 100+ maps available, that becomes a whole world of coordinates.

      Unless I'm misunderstanding you...?

      ------------------
      What's The Difference Between Roast Beef And Pea Soup?
      Anyone Can Roast Beef.
      ------------------
      (url="http://"http://www.avalon.net/~honda/pog/pogwalkthrough2a.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://www.ambrosiasw.com/cgi-bin/vftp/dl-redirect.pl/PoG_Dev_Tools_Source.sit?path=coldstone/resources&file;=PoG_Dev_Tools_Source.sit")PoG Dev Tools(/url)

    • Quote

      Originally posted by Stark Bledfast:
      **with 100+ maps available, that becomes a whole world of coordinates.
      Unless I'm misunderstanding you...?
      **

      I see. I was thinking you were making a local event and as you made each map you would scroll over the areas and get the possible coordinate readings for free tile to transport to. You must be getting really deep into your game programing. Heh?
      Wish I was. πŸ™‚ edited here.
      Just thought of this. Could you reserve an area of your map to be free to transport to and have random coordinates within the designated reserved area. In other words each of you maps would always have a consistant area but work your bacground graphics around that area. The graphics would look different from each other but the random area would change within the designated open tiles.

      ------------------

      (This message has been edited by Toast (edited 09-01-2002).)

    • Mr Stark Bledfast,

      Quote

      Originally posted by Stark Bledfast:
      Yeah, this is how I have it set-up now. It is a spell and it sends the player to a completely random location. If the player happens to become trapped by teleporting into a rock/tree/wall/whatever, they can certainly cast the spell again, provided they have enough mana for it. Alternatively, they can save their game and then reload it, and PoG will automatically move them to a free space. My attempts is to "fix" this "bug" so that they never land in the blocked spaces.

      I sympathize with your pain. In your game does mana regenerate? If so then teleporting into a blocked wall is just annoying because you can wait for enough mana to teleport again, but if it doesn't then it can be heart stopping if you just completed a hard section and without thinking you teleport before saving.

      I feel like there should be some way to fake out the coldstone engine into thinking the arrow keys have been pressed, in which case you could move the player, and check if the location changed... of course this would beget all kinds of problems like triggering events on that tile... Never mind, even if you could do it, it wouldn't be a good idea.

      Very agrivating, because I feel in my bones there ought to be a solution, but I can't think of one!

      Ok, here's a really clunky solution that might work, but would require informing the player, and enabling movement with the keyboard... When you teleport, set a flag that says you just teleported. Set up a global key event for each cardinal direction, (on both arrow and number presses) that sets a blocked flag for that direction if the players position doesn't change. (I'm not even sure if the event would get called before or after the engine tries to move the player...) The teleport event should also clear all of these flags. In the cardinal direction events, check to see if all of the other cardinal direction blocked flags are set. If they are, then put up a dialog telling the player they appear to be stuck in a wall and ask them if they'd like a free teleport. For this to work, it requires telling the player that if they get stuck they have to push all of the arrow keys (or 2,4,6 & 😎 one after another. Bleh.

      Ok, !! a slightly less clunky solution. When you teleport the player, create 4 invisible fast sprites one to each side of the player that are set to try and reach the player, and a timer sprite that fires after 3 seconds or something. When you teleport, set a teleported_possibly_blocked flag, and clear it in the <invisible fast sprite reached the player> event. When the timer sprite fires after 3 seconds, check to see if the teleported_possibly_blocked flag is still set, if it is, put up a dialog telling the player you think they might be stuck and asking if they would like another free teleport. Might work, although it depends on the bounding circles of the sprites and the player.

      Good luck,
      --katherine

      ps you really don't need to call me Ms. I'm a grungy geek too. Ok, I'm not really grungy and "too" is probably too much of an assumtion. πŸ™‚

      ------------------

      (This message has been edited by Katharos (edited 09-02-2002).)

    • Quote

      **ps you really don't need to call me Ms. I'm a grungy geek too. Ok, I'm not really grungy and "too" is probably too much of an assumtion.:)
      **

      I've said it before, and I'll say it again. Stark can't help being courteous. Don't blame him, he's not trying to offend anyone. To quote To Kill A Mockingbird , That's just his way.

      ------------------
      Nothing is foolproof to a sufficiently talented fool.
      "Logic is futile"-Scott Adams