Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I have a family called cards and it randomly chooses one of the "cards" I then want to store the chosen card in a variable called "Chosen card". I've wanted to do stuff like this in the past but I can't find an expression for a specific object's name.
You can store Cards.UID in this variable.
When you need to pick the chosen card, use "Cards Pick by Unique ID=chosenCard" condition.
Not UID. I'm looking to choose a card (let's say CatCard) and then have the game spawn the correspondent animal (so the cat) I was thinking I could do something like "Set variable "animaltospawn" to card.name -Card (as the cards are called stuff like dogcard and catcard) and then spawn by name animaltospawn.
If the cards are in a family you can use family.ObjectTypeName and store that.. then you can create by name and pass that in
Oh, so you need to store the sprite name? Use Cards.ObjectTypeName expression.
Oops, too late :)
Develop games in your browser. Powerful, performant & highly capable.
Oh I thought that would store the objects type. Like sprite, tiled background, array ect
Okay so that works. Now is there anyway to subtract a word from a string? It says I can't subtract string on string. I want to remove the word card from the variable
Set s to replace(s, "card", "")
I dont understand why the letter s is being used?
I ended up getting it working using this.
I probably wouldn't have been able to do it without you guys.