Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   enablefeatures() help (https://forums.graalonline.com/forums/showthread.php?t=65870)

Prozac 05-06-2006 05:34 AM

enablefeatures() help
 
Ok, I want to change what happens when you press Q on my server.
So, I gotta enable everything BUT q with enablefeatures.
I disabled some stuff but not everything, so it is done clientside
and it looks like this:

NPC Code:

enablefeatures(1,2,8,0x10,0x40,0x80,0x200,0x400,0x 800,0x1000,0x2000,0x4000,0x8000);



given that the wiki says this as paramaters for enablefeatures
PHP Code:

1              P key
4              Q key
8              R key
0x10              S
+A combo
0x20              S
+D combo
0x40              TAB key
0x80              chat text
0x100              hearts overhead
0x200              display of nicknames
0x400              toall
/PM bubbles
0x800              right
-click profiles
0x1000              emoticons
0x2000              Alt
+5 snapshots
0x4000              Alt
+8/9 zooming
0x8000              logframe
allfeatures     all features 

good news: it disables the q menu.
Bad news ...
0x80 is ENABLED, as we told it to be, BUT there is now NO CHAT TEXT above the player!
and ox200 is ENABLED but now there are NO NICKNAMES displayed!
this is the only instance of enablefeatures
and it breaks, or rather, DISABLES things! Ack! help!

Andy0687 05-06-2006 07:10 AM

enablefeatures(allfeatures - 4);

Dunno if it is better to start with allfeatures and just minus off what you dont want, but this works.

Prozac 05-06-2006 05:02 PM

thanks
and i now recall something from a few years ago
that instead ot a coma delimited list
it was 1+2+4+8 etc.
and they ascended by the powers of 2
0 2 4 8 16 32 64 128 256 512 1024 etc.

if you take computer science in college you may have to memorize the powers of two as that is what is used to convert binary to decimal.

for example you have the binary number
00101010

there are 8 places in that number, starting from the right most number
you want the power of two from right to left
and you gotta start from 0 before you get to 1
zeroith place : its a 0 so we don't need it
first place : its a 1, 2^1 is 2
second place : 0
third : 1, so 2^3 is 8
fourth: 0
fifth: 1, 2^5 is 32
6th and 7th are 0

then you add up the powers of two to get the decimal number
32+8+2 = 42

see, 42 is the answer!

... or you can open windows calculator and in the advanced version convert binary to decimal etc. but its better to know how it works, if you have to convert in a power failure. heavan forbid the computer wont turn on and you have to decypher a secret message by hand. its kinda fun to know anyways.

Andy0687 05-06-2006 11:06 PM

Quote:

Originally Posted by Prozac
thanks

No problem, wasnt paying attention at the time of looking at this post that you were using comma instead of Feature+Feature.

Quote:

heavan forbid the computer wont turn on and you have to decypher a secret message by hand. its kinda fun to know anyways.
Backup generators are all the rage these days. That any maybe a Laptop computer with backup battery supply.


All times are GMT +2. The time now is 04:26 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.