| Blockland Forums > Modification Help |
| New player list |
| << < (3/12) > >> |
| Space Guy:
==> if(false) %a = 1; else %a = 0;echo(%a); 0 ==> if(true) %a = 1; else %a = 0;echo(%a); 1 Works with variable setting too. Yes, I'm testing these in-game. |
| Iban:
--- Quote from: Kalphiter on February 27, 2011, 06:05:15 PM ---A shorthand if, or any statement, can only have one statement for that block. This is Torque's fault, such a standard practice ruined. --- End quote --- Brilliant deduction, Detective Jackass, except that this is one clause. if() ...if() ......if() ......elseif() ...else if() ......if() ......elseif() There's no voodoo magic being committed here. The first if activates the second if which can activate a string of ifs and else ifs and elses. Source: GameMode_ZAPT/functions.cs --- Code: ---if(!%mini.zombiesDisabled) if(zombieGameSetUpRight(%mini) && miniGameCstar fishe(%mini.owner, %this)) if(%mini.getProperty("bots") || %db.zombieAIOnly) if($sim::time - %this.zombieSpawnTime >= %mini.vehicleRespawnTime / 1000) if(!%db.zombieSpawnOnce || %mini.zombieTimeAssembled - %this.zombieSpawnTime >= 0) return true; --- End code --- If you had taken twelve seconds to plug the code into a script and check it yourself you wouldn't have came off as a) incorrect, b) a know-nothing douchebag. And it's not unique to TorqueScript. Plug this javascript code into the try-it-yourself editor on the w3schools http://www.w3schools.com/JS/tryit.asp?filename=tryjs_events --- Code: ---<html> <head> <script type="text/javascript"> function displayDate() { var smartness = "Kalphiter is super cool and smart and knowledgable!!"; if(1) if(1) if(1) if(0) smartness = "Sure is!!"; else smartness = "nope.avi"; document.getElementById("demo").innerHTML = smartness; } </script> </head> <body> <h1>Is Kalphiter Awesome!?</h1> <p id="demo">Click and find out!</p> <button type="button" onclick="displayDate()">Display Awesomeness</button> </body> </html> --- End code --- If someone like Space Guy had seen something he thought was amiss, he would have tested it before trying to chastise me. The problem is you're not as smart as Space Guy and when you saw something in untested pseudo-code possibly having a syntax error, you jumped on it and made a post so quickly you didn't even grammar-check it ("Bold is causes a syntax error." - wat) as to point out a "flaw" before I had a chance to "fix" it. You suck. Give up. Go away. |
| Kalphiter:
--- Quote from: Space Guy on February 27, 2011, 06:15:39 PM ---==> if(false) %a = 1; else %a = 0;echo(%a); 0 ==> if(true) %a = 1; else %a = 0;echo(%a); 1 Works with variable setting too. Yes, I'm testing these in-game. --- End quote --- That's not what he did, I know about shorthands. But somehow the engine smashed two statements into a shorthand. |
| Space Guy:
==> if(false) if(false) %a = 1; else %a = 0; else %a = 2;echo(%a); 2 ==> if(true) if(false) %a = 1; else %a = 0; else %a = 2;echo(%a); 0 equivalent to: if(false) if(false) %a = 1; else %a = 0; else %a = 2; echo(%a); Nested one-line statements work fine. --- Quote from: Kalphiter on February 27, 2011, 06:12:31 PM ---That wasn't what he did, though. --- End quote --- if(%row == 0) if(%text $= "A") %text = "<bitmap:....>"; else if(%text $= "S") %text = "<bitmap:....>"; "if row is 0 then {test two values of text}". The "name" example is irrelevant. |
| Kalphiter:
--- Quote from: Space Guy on February 27, 2011, 06:18:29 PM ---if(false) if(false) %a = 1; else %a = 0; else %a = 2; echo(%a); --- End quote --- It doesn't make sense how that's even possible. |
| Navigation |
| Message Index |
| Next page |
| Previous page |