Ambiera ForumDiscussions, Help and Support. |
|
[ 1 2 3 4 5 ] Page 5 of 5 |
|
|||||
|
Thanks for this! Sorry for the delay GUEST (I think there's a time-gap) Yes, I (was using arrays (I think that's the term, but I may be wrong - my understanding of coding methods/terminology is not great) and luckily, the 1st version seemed to work with arrays. I'll give the new version a whirl today and see if it works with what I've done already. I'm really not confident with coding, but to give you more context of how I'm working in my recent card game...
Like I say, probably a weird/long/inefficient way of doing it, but it works - I'm continually updating my logic/methods as I learn more. Thanks again for the new version, I'll report back with my success in using it. |
||||
|
Ah, ok. Then you should be able to get the CC variable using $ like: Condition 0: $enemyID = 1 Action 0: change texture of "card" node to "enemy1.png" Condition 1: $enemyID = 2 Action 1: change texture of "card" node to "enemy2.png" Condition 2: $enemyID = 3 Action 2: change texture of "card" node to "enemy3.png" Condition 3: $enemyID = 4 Action 3: change texture of "card" node to "enemy4.png" The first version of the action had the first part of the condition string assumed to be a CC variable. It would then get that variable's value and compare it to the value you wanted to check: a = 10, b = hello, etc. This is fine if all you are doing is checking CC variables against strings and numbers, but checking two CC variables against one another was something it couldn't do. The use of sigils is needed because CC's variables default to 0 (very annoying), so I have no means of telling whether or not that 0 is intentional, or if the name of the variable is actually a string. If CC's variables (the "ccbGetCopperCubeVariable()") defaulted to null, I wouldn't need them. Try the above and see if it works for you. |
||||
|
Thanks Guest. That's what I thought, for me it doesn't seem to work properly. Here's what I have... ..am I using it correctly, or doing something wrong here? Maybe I'm expecting it to do something it's not supposed to. After around 6 hours of play-testing/fault-finding today, I managed to narrowed it to the actions in the screenshot; oddly, sometimes it works, 99% of the time it doesn't - but if I set each variable manually (using set variable action), it seems to work fine. I have 156 conditions and actions (split over 2 of the conditional-variable-executor extensions) and have checked each one letter-by-letter (and paid particular attention to those that work and those that don't work) - I can't see any issues (no typos, no missing spaces, no extra spaces etc). The conditions are all sequential: eg: $enemy ID = 1 $enemy ID = 2 $enemy ID = 3 etc... The actions are also sequential: eg: set variable "e1" = 1 set variable "e2" = 1 set variable "e3" = 1 etc... I'm using coppercubes default "set variable" action to set the variables. At runtime, I expect the e number variables to change and match the random enemyID. Sometimes the variables will match, most times they will not. When I added a 2d Overlay to output the e" numbers, it usually says: enemyID= 1, e1= $e1$ enemyID= 2, e2= $e2$ enemyID= 3, e3= $e3$ but sometimes (randomly, without any changes being made), it will work as follows... enemyID= 1, e1= 1 enemyID= 2, e2= 1 enemyID= 3, e3= 1 I also tried defining all variables as value "0", on the first draw of the scene but it didn't make any difference. Any ideas please? Thank you. |
||||
|
Doh, I think, as you pointed out already, it's because I'm trying to call the array, not the variable.I've got it all working now. Thank you! |
||||
|
...and I notice one can edit notes to the top of the window, that's a really handy feature. |
[ 1 2 3 4 5 ] Page 5 of 5 |
|