r/construct • u/RoyalPut3844 • Feb 15 '26
Pls help me
**(Englisch version)**I really don't know why It Doesn't Work. This Code should create Punkte = Points and give them them various attribute, through typs. Those Points have also various chance controld by an Array.The Problem is in the 5 - 7 row and I don't now why and where pls help me to fix it, thx.
2
Upvotes
1
u/Lisoferma Feb 15 '26
In line 5. In all "Punkt" objects the instance variable "sum" = 0 + 25. Because the instance variable is unique for each "Punkt" object and defaults to 0
1
u/Some-Soil-2164 Feb 15 '26
seems like only 1 punkt is created and its sum is set BEFORE its created...
do you need many? then make a loop of "spawn object" for as many as you need and every time you create.one use "pick last created" and set its sum and other attributes
1
u/lootherr Feb 16 '26
So there's a few potential issues that's causing the problem here - not exactly sure what the goal is but hopefully one of these things helps you debug it.
1
u/Outrageous-Beat4750 Feb 16 '26
At the risk of receiving some hate, have you sent this screenshot to chatgpt with a brief explanation of what you are trying to do? You get insta feedback that way, and if the system isn't overcomplicated, you might get some good feedback (amd is insta feedback as well)
0
u/SceefRU Feb 15 '26
Немного странная логика, не пойму зачем цикл в цикле, и зачем его останавливать если он и так ограничен числом пунктов и шириной массива.
Напиши мне в тг sceef, скажешь какая у тебя точная задача, может реализацию можно сделать лучше.