Yttermayn's Recent Forum Activity

  • spongehammer

    Ok, I didn't know what the was all about, thanks, and thanks for the reply. So rgba()is a function that will pick a specific target color and alpha combination from the canvas? So does it return a 1 or 0 or true/false or something depending on which pixel it's checking? When I get home I'll view it in this frame of mind and see if your example makes more sense.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Spongehammer: I've set up the canvas plugin and created a map.png image that loads onto a canvas. How do I get the color of a pixel on the canvas? I loaded your example up and it doesn't make any sense to me how that's supposed to get a color from an image.

    In particular, I'm unsure of what this part is: "rgba(0,255,0,1)" What is rgba()? Some function with four parameters? Stands for RedGreenBlueArray? I don't see one set up anywhere.

    I get that you're filling up an array with different colored pixels, but I don't understand how this helps.

    Please enlighten me, oh wise one.

  • >

    > > Ok solved, was in the wrong folder :D

    >

    > What was the right folder? I'm having similar problems and I'm thinking it was something silly like this :)

    Answered my own question. For Steam users, the right path is NOT:

    <install path>\exporters\html5\plugins.

    Instead, plugins can go into:

    <steampath>\steamapps\common\Construct2\Construct2-Win32\exporters\html5\plugins

    and/or

    <steampath>\steamapps\common\Construct2\Construct2-Win64\exporters\html5\plugins

    I hope this helps someone!

    I have the steam version, so yes, this helped immensely! Maybe the manual entry could be updated with Steam paths? 'Cause that's where I looked first and much confusion ensued.

  • Thanks for the response, Spongehammer! I assume this is the canvas plugin you're talking about? scirra.com/forum/plugin-canvas_topic46006.html

  • I'm trying to figure out if this is possible with C2:

    Take an image file, get the color of the pixel at a particular x,y coordinate for use as a basis for a map that then is procedurally generated.

    Basically, each pixel of the map represents an area in the game. If it is, say, a specific green color, then the map area generated is grassland. If it's a certain blue color, it's water, etc.

    It would seem that C2 is limited due to the HTML5 security and other whatsits I don't fully understand, to where I couldn't directly read in raw file data. However, I saw in the forums for C1 that someone had made a photoshop style color picker example. I could use something like that to get a pixel color from an image that's been loaded normally. Is something similar possible with C2? I would really like to avoid having to create a huge world map tile by tile directly in a C2 layout, if possible.

  • Theubie: Yes, I thought maybe that was the case. I'll have to use the functions Whiteclaws mentioned to make it happen myself. Thanks!

    Also, theubie, I wouldn't mind taking a peek at your roguelike, if you didn't mind...

  • Is it possible to do this? Or do I have to make an every tick->scroll to action that gets enabled and disabled?

  • I've been playing with merging my different layouts into one huge layout, and using groups to keep my events organized. It seems to be working quite well so far. Thanks again, all. I will no doubt use some suggestions here for when I get to the point in development where the player travels to other star systems.

  • If you are in one particular layout, are objects in another layout inaccessible? Like could I use the same event sheet for several layouts, and then the events that keep the planets orbiting would still be run when you're in the bridge layout? Or would those events simply fail, trying to move planet objects that simply aren't there?

  • A little more info about the structure of the game's solar objects- Each planet has instance variables that hold data such as size, orbital velocity, distance from the star, etc. They will likely hold much more as the game developement progresses. I am taking an object oriented approach to the design, basically.

    Vee41: Saving layout state would be ideal, but obviously not viable solution at the moment. Thanks for the info though. Looked at sprite bank, also another good idea, but it doesn't sound like it stores instance variables, so that's out. Your solution to problem 2 sounds like it will work. Will try it and post. Thanks!

    Bluephaze: By default, all my systems in the game will have a seed saved for them, but that doesn't help with player made changes to objects within the system. Maybe I need to structure in such a way that player made changes are stored globally and re-applied when entering the system. Not as convenient as saving the whole layout state would be, but it might be all I've got. I'll have to think on this a bit. Thank you.

    Sqiddster: Saving in global arrays might be the only option at present, though I would prefer to keep each object's data with it for the sake of organizational convenience. If I understand your Zone idea, it would mean having everything all on one layout, basically. That is an option I considered. Could get messy, but ultimately easier. And yeah, I like the zoom out idea. Would take a little scaling and fadeing magic to pull off, but would be pretty slick to see in action. Thanks for the compliment. I've been wanting to make this game since about 1995. I'm a fan of games like Starflight, star control, Weird Worlds, and FTL. However, I've always wanted to be able to disembark to a planet or space station, walk around inside my ship (making repairs, fighting off boarders, exploring abandoned(?) space hulks, and fighting ship to ship combat, all the while collecting and manufacturing upgrades to ship and personal equipment. I don't care for the 4x games, but I love the idea of actually exploring a vast piece of space and crafting solutions to the various scenarios and difficulties you might encounter.

  • My roguelike space adventure game has a layout with a sun in the middle, and several planets orbiting it, all generated using a pseudo-random number generator. There is of course a spaceship that is player controlled. If you click a button sprite on the screen, you'll switch to a different layout: the deck of the bridge of the ship, and you are now controlling a little figure inside the ship. Now if you walk that little figure to the elevator, a control panel with buttons pops up and you can push one that will take you to the main deck (a third layout) On the main deck you can press one that takes you back to the bridge in the same way. If you move the little figure over to the chair at the helm, you'll go back to the sun and planets (solar system) layout.

    Problem 1) Now, when I go back to the solar system layout, all my planets and things are different than when I left, because the layout has reset and regenerated the solar system when I switched back to it. How do I make sure the layout continues to run and not regenerate every time I switch layouts?

    Problem 2) Each deck layout requires a separate instance of the little man figure in order for the player to be able to interact with it. I suspect that any instance variables for the figure will not be carried between layouts. I'm guessing I'd have to store player character data for the figure in globals and re-apply any changes (armor worn, weapons wielded, etc) each time the layout is switched. This isn't a huge issue for the one character, but for all the data generated for the solar system, it quickly becomes impractical.

    I realize the solutions I'm looking for may involve manipulation of event sheets. Currently each layout has it's own event sheet, plus the solar system layout also has a sheet I use for functions that has been included in the main sheet.

    What is the best way to handle these two problems?

  • Thanks, BluePhaze, using inverted overlap works good.

Yttermayn's avatar

Yttermayn

Member since 3 Feb, 2013

None one is following Yttermayn yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies