Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
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'm making a mockup for an RPG. Currently I have a Slider to select how many players are in a party (just for testing). I have the slider set a Global Variable to the Slider's Value. Then, when I load the Layout that should spawn the players, I have
On Start of Layout > Unimportant stuff Repeat GlobalVariable times > Create Player at 750, (350 + (GlobalVariable * 150))[/code:3g058gpb] That should mean that if I set my slider to 4, it would spawn 4 players, each with lower and lower y coords. However It seems to only spawn the last one. My set up is a bit more complex than that, and I am getting other problems, but I'll leave those out unless someone thinks the problem lies elsewhere.
On Start of Layout > Unimportant stuff Repeat GlobalVariable times > Create Player at 750, (350 + (GlobalVariable * 150))[/code:uyww9chj] That should mean that if I set my slider to 4, it would spawn 4 players, each with lower and lower y coords. However It seems to only spawn the last one.
so..you code looks like:
On Start of Layout > Repeat 4 times > Create Player at 750, (350 + (4 * 150))[/code:uyww9chj] ...you "spawn" 4 players on the identical spot... Try:[code:uyww9chj]Repeat GlobalVariable times > Create Player at 750, (350 + (loopindex * 150))[/code:uyww9chj]
Develop games in your browser. Powerful, performant & highly capable.
Haha, yes, I just realized I hadn't accounted for multiplying a 'count' variable, but that loopindex will sure come in handy. Those simple mistakes are painful.
Thanks for having a look. I also realized the sources of my other problems.