| Blockland Forums > Modification Help |
| Kill Icon String on Death |
| << < (3/5) > >> |
| Swollow:
--- Quote from: Nexus on December 26, 2011, 09:54:49 PM ---is !== a thing or do you mean != I wouldn't be surprised if this is some basic syntax everyone else knows and I somehow don't --- End quote --- thats how i feel |
| Port:
--- Quote from: jes00 on December 26, 2011, 01:56:29 PM --- --- Code: ---if($Pref::HideKills::enabled !== 0) --- End code --- --- End quote --- Seriously, it's driving me crazy when people do this. Let's try to get down to basics. if will cause the code contained in brackets after it to be evaluated if the statement specified is more than or equal to 1. If an else block is present and the statement is less than 1, the code contained in brackets after that will be evaluated instead. Now, something such as $Pref::HideKills::enabled -- based on the way you're using it, the name and other things, I can see that you're intending for it to be a boolean. True or false. 1 or 0. Now, if you specify a variable, it's value will be used. So, because of this, if $Pref::HideKills::enabled is true (or 1), if ( $Pref::HideKills::enabled ) will succeed, and if ( !$Pref::HideKills::enabled ) won't, because ! negates the value of a statement. |
| Uristqwerty:
A few things: I believe the death message is sent from the parent::..., but that same parent::... does a bunch of other important things involved in making the game work. Might be possible to catch it in MessageAllExcept and MessageClient. Figuring out how those work for death would involve quite a bit of trace(), dying, killing, logging, reading, logicing, inging, echo()ing, and perhaps a bit of getTaggedString()ing, since trace() doesn't do that automatically, and shows the id of the tagged string. Next, there is no !==. There is only == and !=. Finally, torque borrowed from the ancient language of C and decided that 0 means false, and any other number means true (It was probably a cycle or two faster on the early CPUs or something that doesn't matter nearly as much today, but I suspect the original Torque devs really liked those old languages...). Anything that isn't a number at all is also counted as false. Torque also treats the string "true" (case insensitive) as true, just to confuse you. All of the important parts (how the game behaves) can be proven just by firing up the old singleplayer bedroom map, opening the console, and trying different things to see what works and how it responds. The rest can be discarded as a failed sense of humour or wild guesses about things that don't really matter anyway. |
| Swollow:
--- Quote from: Uristqwerty on December 27, 2011, 03:46:59 AM ----lots of words- --- End quote --- Whatever you just said wasn't helpful at all I already knew that all, all I'm asking is for help getting the kill icon with hide kills enabled, I understand basic code. |
| jes00:
--- Quote from: swollow on December 27, 2011, 10:57:16 AM ---Whatever you just said wasn't helpful at all I already knew that all, all I'm asking is for help getting the kill icon with hide kills enabled, I understand basic code. --- End quote --- What do you mean "getting" it? Do you mean getting the icon itself or getting the icon from the message when someone dies? |
| Navigation |
| Message Index |
| Next page |
| Previous page |