Elyzius's Forum Posts

  • I'm not sure what you mean by "when the mousex becomes greater than the object," but I'll assume that you are comparing it to the object's X value. If you want the global('x') to be added just once, you might want to make another global numerical variable first. Let's call it 'Added' and let its initial value be zero. In your event, you have to check for 2 conditions: that mouse.x > object.x AND global('Added') = 0. You will then add 2 actions for that event. First, add 10 to global('x'). Next, set global('Added') to 1. This will guarantee that adding 10 to global('x') will occur once and only once if at all.

  • I see. So the Object ID points to the template from which all other instances of that object or template are created. The Unique ID points to an instance of the template and is unique across all instances of any template. Instances of the same object will all have the same Object ID, but everything in the game has its own Unique ID.

    Also, it seems that you can reliably "Create Object By Name" and pass an Object ID instead of an object's name. Passing a Unique ID to "Create Object By Name" will not always work.

    I'm aware that OIDs and UIDs are only reliable at runtime and may not have the same values across different runs.

    Thanks, newt.

  • What is the difference between an Object ID and a Unique ID? When should you use one instead of the other? I've been trying to search the forums for this, but if the answer is here, it's probably buried deep.

  • I just wanted to say thanks for this. I'd been searching the manual for this kind of functionality, only to find that it isn't implemented in Construct. Good thing we can extend its functionality with plugins.

  • The chicken idea is the best, IMO. It's the opposite of what one would expect from a chicken, yet it makes sense somehow because anybody can be a tough guy when they have a gun. I can see it now:

    hey slaughtered his family and left him to die. Now vengeance is his.

    CHICKEN WITH A SHOTGUN

    Coming soon to IMAXedited><editID>Elyzius</editID><editDate>2012-08-03 06:58:17</editDate></edited>

  • I'm not TL22, but I wanted to check out your file. I can't load it in CC, though. The error message says that your CAP was created in a newer version of Construct. I clicked the Update button in CC, and I was told that my version of CC is already the latest. Just giving you a heads up.

  • Tulamide, I might be able to help, but I need more info. Under what conditions may a card's strength change?

    For example, I've seen some games where a character card's strength is boosted by having equipment cards stacked with it. In other games, putting counters on a card in play indicates that its strength is boosted. Another instance of strength change is when a particular spell card is played, which changes the strength of certain units in play.

    For your game, are your rules similar to the above examples?

  • My sample CAP file demonstrating the use of card sprites with my Custom Deck plugin can be downloaded here.

  • The demo file that I uploaded doesn't really have much in the way of bells and whistles. All the outputs are in numeric text, which isn't the way one would represent cards in a video game.

    Just now, I figured out how to output the cards as images. (What can I say? I've only been playing with Construct Classic for less than a week.) For those who may be interested, here's a brief explanation on how to do it:

    1. Add sprites for each of your cards. Ideally, they should all be the same size and have unique names. Make sure your sprites are not on the visible area of your layout. Hence, to represent a full deck of 52 playing cards, you will need 52 sprites, one for each card.
    2. Optional step: Create an object folder and put all your card sprites in it. This is just to keep from cluttering the Object panel.
    3. Click any of your card sprites to select it. In the Properties panel (the one on the far left of the screen), expand Groups/Families then click the word "Add" beside "New Family." This will cause a small window named "Construct: New family" to appear. Choose an appropriate family that you're sure you won't use for any other purpose then click the OK button. (For my project, I chose the Blue family.)
    4. In the Project panel (the one on the far right of the screen), right-click the name of your application then click "Manage families" on the context-sensitive menu. A dialog box named "Construct: Family Manager" will appear. Click the name of the family that you assigned to your card sprite then click the Add button. Add all the remaining card sprites to this family. Click the Close button when done.
    5. Insert the following objects in your layout: a custom deck (from my plugin), an array, and a button. The button will be for dealing cards from the deck, so set an appropriate text for it. Change the "Width (X)" property of the array to be equal to the number of unique cards that your custom deck will have.
    6. Create a System::Start of layout event in which you set the size of your custom deck. Within the same event, add the array's "set value at X" action for each of your card sprites' object ID. For example, the first of these actions may be written as "array: Set index 1 to Card01.OID," where Card01 is the name of your first card sprite. Each sprite should be assigned a unique index. If you have 52 unique cards in your custom deck, you will have to add 52 actions of this type.
    7. Add a second event for when the button gets clicked. For this event, add a "Reset Deck" action for the custom deck.
    8. To the second event, add a "System::For each object" sub-event, where the object is the family of sprite cards that you assigned earlier. Set a destroy action for this family. This will clear any cards that may have already been placed on the layout.
    9. Add a "System::For" sub-event to the second event. The loop should go a number of times equal to the number of cards you want to draw. Add a "System::Create object by name" action to this event, where the parameters are the object ID returned by the array at the index returned by a call to "Get random card" from the custom deck, as well as the X and Y coordinates of the card sprite's position. (Quite a mouthful, I know.) In other words, you can add something like this: System: Create object array(Custom Deck.RandomCard) on layer 1 at (50+LoopIndex*93,82)
    10. Run your layout to see how it goes.

    Would anyone be interested if I were to upload a sample CAP file?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey all, I'm Frank Perez, but I also go by the user name Elyzius or Elysius in a number of forums and gaming sites. I've mostly been in the Neverwinter Nights 2 modding scene, but I'm now looking into indie game development. Anyone who is interested in my game-related projects may visit my blog. Among other things, it has a number of musings on game development and 3D modeling.

    Cheers.

  • Wow, this looks tres cool. It's good to know that this service is available to small indie developers. Thanks.

  • Hey everyone, I'd been fiddling with Construct Classic for a few days when I decided to make a plugin for it called Custom Deck.

    The Custom Deck plug-in allows you to add any deck of cards to your games. These decks can include but are not limited to Tarot decks, collectible trading cards, cards that come with board games, and whatever else you can imagine. Decks can have as many cards as you want, and the cards can be increased or decreased at runtime. Cards need not be unique, so your decks can have several cards of the same type. You can also change the cards at runtime in much the same way that Magic: The Gathering players can customize their decks before duels.

    You can download the plugin here. The RAR file contains the plugin, a demo CAP file, and a three-page manual.

    Please feel free to post your feedback in this thread.