They Are Billions

They Are Billions

Custom Levels for They Are Billions
Add custom levels to They Are Billions by subscribing to these workshop items!
Learn More
JustGoFly 2 Dec 13, 2018 @ 10:56am
Things needed in Map editor to make it easier for map developers
1) Never allow = in condition. If someone say Variable = true - flag it as an error. This is going to be very common since non programmers will not understand that they must do == to do comparison. And it's bad programming to put = in condition statements.

2) Allow "Save and generate locally" or a flag that always generates locally when I save. It's very frustrating to save, exit and test and realize you forgot to generate locally.

3) Block should include the condition in the summary line. So I can see "Block: DifficultyLevel==0" and "Block:DifficultyLevel==1" when reading the script. Anything in the script summary that makes it easier to read is good.

4) I was not clear on how Notification message worked, so I was using pop up display messages. But I can not use variables in the Notification message, so I must pop up Display during game play to debug variable settings. Or give us a console we can write to for debugging. BETTER YET can write to the ZXCode log file - that would also be very helpful. I'd want to write static text with variables into the ZXCode log file.

5) Do a verification on all fields on a Save, in the map editor, and report errors. This enables you to find the first error and report it. Then we fix that error and save again, to see the next. If you want to report all of the errors, that would work too. This is the simplest approach to displaying errors we put into maps like not defining a variable, or using bad syntax. I wrote a map and defined a variable, used it, then renamed it, but missed changing one field in an event, I ran the map and it threw exceptions. It took me time to figure out why the runtime was showing an exception. The map editor could have found it before I ran the map, saving me alot of time.
< >
Showing 1-15 of 17 comments
Mortal Dec 13, 2018 @ 11:01am 
about 2*.... when you save it takes 3 sec. if you want to save, and make test save in the same time, it's gonna take like 8 sec or more.. so better not combine them together. and sometimes i want to save for test but not to save the map.... it should be a deffrent thing.

about 4*- i can show you in privet how i did with my pop up messages.. it's very simple and cool :D still.. i wish there was folders for all the events...
about 5* - well they can just take the WC3 editor and make copy for TAB- WC3 did it perfectly!
Last edited by Mortal; Dec 13, 2018 @ 11:12am
JustGoFly 2 Dec 13, 2018 @ 11:32am 
Originally posted by Mortal:
about 2*.... when you save it takes 3 sec. if you want to save, and make test save in the same time, it's gonna take like 8 sec or more.. so better not combine them together. and sometimes i want to save for test but not to save the map.... it should be a deffrent thing.

about 4*- i can show you in privet how i did with my pop up messages.. it's very simple and cool :D still.. i wish there was folders for all the events...
about 5* - well they can just take the WC3 editor and make copy for TAB- WC3 did it perfectly!

about 2: Agreed - it should be a separate menu item. Sometimes I make a backup of a map with a different name, and don't want to generate. They can fix this by making CTL G (Generate) do both a generate and save, then I would only every use CTL G.
about 4: Didn't I show you how I do my pop ups for debugging? I also turn them off after the player reach's a specific stage since I may only want to see them early on. And I only turn them on if the player drops a woodwall, so I can turn on/off during game play.
Last edited by JustGoFly; Dec 13, 2018 @ 11:32am
Mortal Dec 13, 2018 @ 11:36am 
i didn't follow how you did what you did.. still hard to focus. but maybe you did something wrong. i make things simple, so i don't have any errors.
Last edited by Mortal; Dec 13, 2018 @ 11:36am
JustGoFly 2 Dec 13, 2018 @ 12:46pm 
Originally posted by Mortal:
i didn't follow how you did what you did.. still hard to focus. but maybe you did something wrong. i make things simple, so i don't have any errors.
Simple is good. I use a boolean variable called DebugMsg initialized to false. I have an event that retriggers every 2 hours that checks DebugMsg and if true it displays the DisplayMessage with my variables. It also checks Count(WoodWall)>1 and sets DebugMsg=true or false if 0. A programmer would say: DebugMsg=Count(WoodWall)>1; but that may be too complicated ;) So I can turn on/off debugging by simply dropping a WoodWall. You can do all of this with one scheduled event and set/clear or display in different blocks of the execute based on the condition within the block.

I'd rather just write these messages into the ZXCode log file, so I can monitor it from a Notepad++ or an app I wrote that dynamically reloads files as they change.
Last edited by JustGoFly; Dec 13, 2018 @ 12:47pm
Mortal Dec 13, 2018 @ 12:59pm 
well you giveing me idias ;)
JustGoFly 2 Dec 13, 2018 @ 1:01pm 
Hey we help each other :) My Hero map has so many triggers and runtime logic, it should be very cool when done. I want to write a map that is hard for pro's and easy for newbies, and it learns as you play. If you play badly it tells you what you need to do to succeed, and if you play well - it slaps you around a little bit :)

I'd call it the "Father of all Maps, that's a real mother!"
Last edited by JustGoFly; Dec 13, 2018 @ 1:01pm
Joekirk 1 Dec 13, 2018 @ 4:24pm 
While something can be said for keeping it consistent with other programming langauges, as far as I know in ZXCode specifically using '=' in Conditions (not executions) works as a non programmer (myself) would expect. Having a script or event with the condition 'A = 1' does not set that variable to 1, it checks if it is that value. I think two =='s work as well, but at least in my experience with ZXCode they don't behave any differently when used in Conditions.
JustGoFly 2 Dec 13, 2018 @ 5:04pm 
JoeKirk - I would be surprised if A=1 in a condition is doing what you expect. It SHOULD set A to 1 and return true to the condition since the value is non-zero. A=0 would return false. But it is bad programming to assign variables in condition statements, and consistancy is important. So using == in one case and = in another to mean the same thing is not good.
Joekirk 1 Dec 13, 2018 @ 5:46pm 
I have a custom variable, 'Test' which is a Number set to 0. I have a custom command center button which shows the value of Test for easy access. I engineered the following situation.
1. A day 1* event with the condition 'Test = 100' which displays a message.
2. A series of 4 ScriptOnEnter zones. The first three have the following conditions "Test = 25" "Test = 50" "Test = 100" and each (with the exception of Zone 4) display a message when its script fires. The forth has no condition, and instead executes the following code 'Test = 100'.

Beginning with the game start, here is what happens.
1. Game begins, no messages are displayed. Custom command center button correctly shows the value of Test as being 0.
2. I walk a unit through all the zones in sequence.
3. Zone 1; nothing happens, value of Test unchanged. Zone 2; nothing happens, value of Test unchanged. Zone 3; nothing happens, value of Test unchanged. Zone 4; the message from the Day 1 event displays, commander center button correctly shows that the value of Test is now 100.
4. I walk through the zones in Reverse order. Zone 3; message is displayed, value of test remains 100. Zone 2; nothing happens, value of Test remains 100. Zone 1; nothing happens, value of test remains 100.

Everything I just described is exactly what I would expect, JustGoFly.
Yes, consistancy is important. But this is how ZXCode works right now.

[edit] * = really a day 000, hour 0 event but you get the point.
Last edited by Joekirk; Dec 13, 2018 @ 6:02pm
JustGoFly 2 Dec 13, 2018 @ 6:47pm 
I am playing with the new Custom button now. I will make a test similar to yours. What I'm using it for is a market, and providing items at a higher cost to the player. This saves them having to make a wood workshop which may be needed by some players who might not be so fast spending their money on expansion. I will add some debug items. more in a bit...
JustGoFly 2 Dec 13, 2018 @ 8:16pm 
JoeKirk - I put down four UnitMapEventMessages with wood boxes over them, the first set my variable to 100, second to 200, third added 1000, fourth set variable to 300.

I used the variable as the only thing in the "Counter" field of the Custom button.

Everything worked perfectly. as I stepped on each box the button showed, 100, 200, 1200, 300

I set the variable from the script in the UnitMapEventMessage with no condition on the UnitMapEventMessage.

What am I doing that is different from yours ?
Joekirk 1 Dec 13, 2018 @ 9:28pm 
My UnitMapEventMessage looks like this.
Script on Enter Center Camera | [ ] False Activity Noise | 0 Scipt | >Display: "DUMMY - TEXT" (|) Condition: | Test = 25

The Display within looks like:

Picture | Title | DUMMY Text | TEXT Sound Clip | None Custom Sound File | Animation | None (|) Condition | (>) Execute this Code:
Even putting 'Test = 25' in the condition field of the Display does not change the variable on my end. Unless you're putting it in the Execute this Code field, I have no idea why it would behave differently for you.


JustGoFly 2 Dec 13, 2018 @ 10:45pm 
Test = 25 is wrong - you need to put Test == 25
I am posting a youtube video about this and the Custom Button here:
https://youtu.be/Z6mxSD_yVfg
It's almost ready to be viewed
Gomez Dec 14, 2018 @ 12:08am 
Originally posted by JustGoFly:
1) Never allow = in condition. If someone say Variable = true - flag it as an error. This is going to be very common since non programmers will not understand that they must do == to do comparison. And it's bad programming to put = in condition statements.

2) Allow "Save and generate locally" or a flag that always generates locally when I save. It's very frustrating to save, exit and test and realize you forgot to generate locally.

3) Block should include the condition in the summary line. So I can see "Block: DifficultyLevel==0" and "Block:DifficultyLevel==1" when reading the script. Anything in the script summary that makes it easier to read is good.

4) I was not clear on how Notification message worked, so I was using pop up display messages. But I can not use variables in the Notification message, so I must pop up Display during game play to debug variable settings. Or give us a console we can write to for debugging. BETTER YET can write to the ZXCode log file - that would also be very helpful. I'd want to write static text with variables into the ZXCode log file.

5) Do a verification on all fields on a Save, in the map editor, and report errors. This enables you to find the first error and report it. Then we fix that error and save again, to see the next. If you want to report all of the errors, that would work too. This is the simplest approach to displaying errors we put into maps like not defining a variable, or using bad syntax. I wrote a map and defined a variable, used it, then renamed it, but missed changing one field in an event, I ran the map and it threw exceptions. It took me time to figure out why the runtime was showing an exception. The map editor could have found it before I ran the map, saving me alot of time.


Hello!

We take note about your ideas. Our dev team will study their viability.

Thanks a lot for your suggestions.

Regards.
Joekirk 1 Dec 14, 2018 @ 12:39am 
Originally posted by JustGoFly:
Test = 25 is wrong - you need to put Test == 25
I am posting a youtube video about this and the Custom Button here:

It's almost ready to be viewed
Just watching the video tells me what our problem is. We're talking about different things. I'm not using the UnitMapEventMessage to alter my variable, sans the last one, nor am I having trouble getting them to work. The first three are using conditions based on its value; like your conditions for the market button being visible. They aren't executing code, Test = # is their Condition. It's checking if the variable is that exact number. Zone 4 in my example is the only one executing code, hence why it sets Test to 100.

Literally what I am telling you is, when used in Conditions (NOT EXECUTIONS), IN ZXCode, = and == are interchangable. Alter your market button's condition so that the button is only visible when the gold number is a given value instead of equal or greater. To keep it simple, make it check if the gold is equal to the amount your map starts with. Run it twice, once using '==' where your >= is and the second time with '=' both work (presumely gold equals the number you set).
< >
Showing 1-15 of 17 comments
Per page: 15 30 50