![]() |
{} vs ||
I've came across two different ways to do a few things for instance I can do
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
I think extent = {300,250}; and extent = "300 250"; was just to allow compatibility between both torque and GS2. Or maybe GS2 and GS1... Not sure which case but I do believe it's for compatibility.
I use extent = {300,250}; but I'm not sure if this is the best way. As for checks, PHP Code:
Array checking does have one advantage though, it can check for multiple values while not needing to check all in between values. For example, if I did PHP Code:
PHP Code:
|
Doesn't quotations turn it into a string?
So extent = "32 32"; would be a string so you wouldn't be able to access it as an array, so: if (extent[1]==32) would be false. extent = {32,32}; would be an array, so if (extent[1]==32) would return true. |
Running this script,
PHP Code:
PHP Code:
|
does printf even work in graal o.O
|
Quote:
PHP Code:
|
Quote:
extent = "32 32"; That format is for compatibility with Torque GUI script. I also learned something about object types, apparently the static variables can have internalized functions for reading and writing them, which is why either format works I believe. |
You can also do like:
NPC Code: Which would be true if the number is in between 16 and 19 but would be false if it was exactly 16 or 19 (so 16.1 and 17 would be true but 15 and 16 would be false). You can also do: <16,19| |16,19> Respectively. Having a good knowledge of geometry helps in this (I think that is the math subject that teaches rays and all that in a number line). |
Quote:
|
| All times are GMT +2. The time now is 07:00 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.