SphereCommunity
you got issues! - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: you got issues! (/Thread-you-got-issues)



you got issues! - x77x - 10-20-2015 08:21 AM

my npcs spawn goofy colors

my src.level are displaying wrong on players in game




its definatly a hex / dec formula bug somewhere



build 2475


also while im at it, if you are over you maxfollowers and you buy a horse, the vendor takes your money and gives you nothing =)


RE: you got issues! - darksun84 - 10-20-2015 10:10 PM

The weird colors are caused by the CanUse attribute and t_equiptem event. It happens that some items, when created, get a weird value in their CanUse attribute.

One of these items is the checkered shirt, an item that is almost present in every vendor NPC:
ITEM=random_shirts_human // This includes the checkered shirt

So the NPC can't equip it (notes that the item is not placed at all in the world), then if we take a look at the following line we see this:
COLOR=colors_all

For some reason (probably because it can't equip it and the item is not placed in the world), the color will be applied to the npc skin value.

So possible solutions are :
Apply the CanUse = can_use_all in the Itemdef of each item that doesn't have it, or modify/remove the t_equipitem event.


RE: you got issues! - x77x - 10-20-2015 10:46 PM

i have characters with SRC.LEVEL=25


SRC.NAME=<FINDLAYER(29).NAME> [SRC.LEVEL]
but in game is shows [PlayerName][19]


isnt 19 25 in hex?


RE: you got issues! - darksun84 - 10-20-2015 11:35 PM

yes it is


RE: you got issues! - x77x - 10-21-2015 12:05 AM

it worked before...

maybe now i need to eval it?

how?


RE: you got issues! - darksun84 - 10-21-2015 12:36 AM

try <eval <src.level>>


RE: you got issues! - x77x - 10-21-2015 03:54 AM

IF (<eval <src.level>>==025)
SRC.NAME=<FINDLAYER(29).NAME> [25]
GUILD.ALLMEMBERS -1,SYSMESSAGE @003f <SRC.TITLE> <SRC.NAME> is online
RETURN 0

same... keeps going to the 19 one, same as above


SRC.NAME=<FINDLAYER(29).NAME> [<src.level]]

will look like PlayerName [025]

i dont want that extra 0 in there

i see whats goin on here...
all my level stuff isnt working right

im using level as decimal, but its reading in hex

anyway to get it to read LEVEL as decimal and not hex?


RE: you got issues! - pointhz - 10-21-2015 05:25 AM

<eval <src.level>> in the player name too, not only on the IF statement


RE: you got issues! - Diathim - 10-21-2015 04:38 PM

Changed the can_u_none return from 1 to 0 and try that. If I remember right, the can_u_none is set to a 0 value.

Code:
VERSION=56B
// Scripted by: Khaos
// Date: 30-11-2013

[comment canuse code]
* Attach this event to your players and simply set the flags from sphere_defs.scp from the permitteduse_flags section.
* The flags can be set on the variable CANUSE which a character and item variable.
* This script will perform checks on which race/sex can use the item/creature (Mount).
* Uses the new CANUSE variable.

[events e_can_use]
on=@EquipTest
// GMs can equip anything
// Gargoyle GMs still cant use human/elf items and vice versa.
if <src.isgm>
if (<src.isgargoyle>) && !(<canuse> &can_u_gargoyle)
  return 1
elif (<src.iself>) || (<src.ishuman>) && (<canuse> &can_u_gargoyle)
  return 1
else
  return 0
endif
endif

if (<canuse> &can_u_none)
return 0
elif (<src.ishuman>) && !(<canuse> &can_u_human)
return 1
elif (<src.iself>) && !(<canuse> &can_u_elf)
return 1
elif (<src.isgargoyle>) && !(<canuse> &can_u_gargoyle)
return 1
elif (<src.ismale>) && !(<canuse> &can_u_male)
return 1
elif (<src.isfemale>) && !(<canuse> &can_u_female)
return 1
endif

on=@Mount
// GM's can mount anything; unless the GM is a gargoyle.
if <src.isgm>
if !<src.isgargoyle>
  return 0
else
  return 1
endif
endif

// Gargoyles cannot mount creatures.
if <src.isgargoyle>
return 1
endif

if (<canuse> &can_u_none)
return 0
elif (<src.ishuman>) && !(<canuse> &can_u_human)
return 1
elif (<src.iself>) && !(<canuse> &can_u_elf)
return 1
elif (<src.ismale>) && !(<canuse> &can_u_male)
return 1
elif (<src.isfemale>) && !(<canuse> &can_u_female)
return 1
endif

[function IsHuman]
return <qval ((<dispid> == c_man) || (<dispid> == c_woman)) ? 1 : 0 >

[function IsElf]
return <qval ((<dispid> == c_elf_male) || (<dispid> == c_elf_female)) ? 1 : 0 >

[function IsGargoyle]
return <qval ((<dispid> == c_gargoyle_male) || (<dispid> == c_gargoyle_female)) ? 1 : 0 >

[function IsMale]
return <qval (<can> &mt_male) ? 1 : 0 >

[Function IsFemale]
return <qval (<can> &mt_female) ? 1 : 0 >

[eof]