K_Doom Posted April 11, 2022 (edited) Hello guys, I made some very simple code that I made works perfectly in a part of the map. But when copying and modifying it to apply in other parts of the map it doesn't work. Also correctly assigned things to get the code to run. Tried two variations of the same code but the same error persists. I plan to learn more about ACS Script after I finish my first map (this one) so I can solve these simple things and more with greater ease. Where is the error? Edited April 11, 2022 by K_Doom edit 0 Quote Share this post Link to post
Edward850 Posted April 11, 2022 Well the obvious thing that sticks out is you didn't compile your script file, because if you tried that an error would be produced. That error specifically is you are missing an opening bracket { at the start of script 3. 2 Quote Share this post Link to post
K_Doom Posted April 11, 2022 (edited) 18 minutes ago, Edward850 said: Well the obvious thing that sticks out is you didn't compile your script file, because if you tried that an error would be produced. That error specifically is you are missing an opening bracket { at the start of script 3. Sorry, but I just don't understand why it doesn't want to compile. Since script 3 is practically identical to 2, and the latter works perfectly. note: I had forgotten that it is possible to write these scripts in UDB and I did it directly in SLADE3 haha Edited April 11, 2022 by K_Doom edit 0 Quote Share this post Link to post
Rifleman Posted April 11, 2022 Notice the yellow circles - you're missing a bracket in one of them. 1 Quote Share this post Link to post
K_Doom Posted April 11, 2022 2 minutes ago, Rifleman said: Notice the yellow circles - you're missing a bracket in one of them. The square bracket is there but has been hidden by the red band. 0 Quote Share this post Link to post
Rifleman Posted April 11, 2022 Could it be the formatting then? I can't try myself now, but what if you fix it, so it looks like script 2? 1 Quote Share this post Link to post
K_Doom Posted April 11, 2022 (edited) 1 hour ago, Rifleman said: Could it be the formatting then? I can't try myself now, but what if you fix it, so it looks like script 2? Yes, it is the same as script 2. I tried another way using a counter, as it didn't work I went back with the old script that is identical to 2. By @Edward850 tip I remembered to compile in UBD, and then it worked. But it's not compiling on final version (pk3). That is, now script 3 compiles, but only inside the UDB. note: it works only after being compiled once. Edited April 11, 2022 by K_Doom edit 0 Quote Share this post Link to post
K_Doom Posted April 12, 2022 19 hours ago, Edward850 said: Well the obvious thing that sticks out is you didn't compile your script file, because if you tried that an error would be produced. That error specifically is you are missing an opening bracket { at the start of script 3. It compiles perfectly, but doesn't work at play time. 0 Quote Share this post Link to post
Aurelius Posted April 12, 2022 A couple of things: Using Action 80 Script Execute will not run a script that is already running. So if you kill multiple enemies at once, they won't all add to the killcount. This can be fixed by using Action 226 Script Execute Always instead. Your script checks whether the killcount is exactly 33, which means that if multiple enemies die at the same time, it will pass that mark without executing. The simplest way to get around this is to change the operator to greater or equal than (≥, or >=). However, this will make the floor lowering part run multiple times, for any monster that dies. There's a few ways around this, but my suggestion is have a separate script that checks the killcount while the other only adds to it. Something like this: int killCount = 0; script 3 (void) { killCount++; } script 4 ENTER { while(TRUE) { if(killcount >= 33) { Floor_LowerToLowest(178,32); Terminate; } Delay(5); } } If you don't want script 4 to be running from the start of the map (because it doesn't really have to be), you can make it execute somewhere before the intended encounter. 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.