Robust way of using "or" block

Get help using Construct 2

Post » Thu Dec 31, 2015 6:45 pm

Solomon wrote:@LittleStain - Local variables are indeed shown only when they are within their scope but what I am trying to tell you that all the other global variables are shown there too, besides the local variables. That does not help as the list is getting longer. This has nothing to do with how I set up my variables I dont think, only how C2 displays the lists of variables - both global and local are in the same bag when looking for local (not when looking for global), unless indeed there is something wrong with my workflow, thus I am trying to find out.

Edit: To illustrate:

What happens:


Looking for local variables - list:

Global variables x 1000
Local varibales x 10

Looking for global variables - list:

Global variables x 1000

What I would like:

Looking for local variables - list:

Local varibales x 10 -----> only - no global variables available to choose --> makes list waaaay shorter

Looking for global variables - list:

Global variables x 1000


I'm sorry..
1000 global variables?
I know this is meant as an exaggeration, but even 100 would sound ridiculous..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 31, 2015 6:47 pm

@LittleStain

It is shown to prove my point, please dont focus on proportions in this situation.
Doesnt matter if its 1000 or 100, 100 is indeed a lot too. As is 50. Besides blowing up things out of proportion helps visualise the problem as you surely know.

Hmm... alrighty I will check out your link in detail, but still I think that adding option to the "or" block to choose where to put or and where to put and would be great, a real time saver.

@R0J0hound

If it was requested before, its a shame that this has not been added :cry:
Hmm, Im entering virgin territory with your statement/piece of code :P I need to look into this

@Estecka

Well no I dont think so.

WIth:

IF x=z
and
IF x=b
or
IF x=c

There is only 1 explanation: If x=z and b, or IF x=c, but used with an "or" and an "and" block. How can this be interpreted differently?

As for the first or second, no there is no first or second, I would like the option with or/and not with or/or like it is now automatically avaliable.
Brick by brick, stone by stone.
B
56
S
25
G
18
Posts: 273
Reputation: 13,363

Post » Fri Jan 01, 2016 2:09 pm

Solomon wrote:There is only 1 explanation: If x=z and b, or IF x=c, but used with an "or" and an "and" block. How can this be interpreted differently?

Well again, I could as well interpret it as IF x=z, and IF x=b or x=c.
Unless there is a programming rule I don't know that tells which operations must be performed first? (Like in math with multiplications and additions?)

Solomon wrote:@LittleStain - Local variables are indeed shown only when they are within their scope but what I am trying to tell you that all the other global variables are shown there too, besides the local variables. That does not help as the list is getting longer.

If you absolutely need this many global variables, one thing you could consider is turning some of them to instance variables.
As an example, when I needed to manage the "hive mind" of certains AIs, many of the "global" variable I used for them were in fact instances variables of a single dictionary named Hive. These still work the same way as global variables except they don't appear under the system's list.
B
7
S
3
G
3
Posts: 56
Reputation: 2,240

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests