Sphereserver / Source

http://spherecommunity.net
Apache License 2.0
108 stars 58 forks source link

Bug getting RANDOM between bracket values #80

Closed thekeen closed 4 years ago

thekeen commented 7 years ago

I've noticed in last nightly when script calls NAMES_BIRDS and others sometimes return: Name pool 'NAMES_EAGLES' could not be found

Also, when random loot are created example random_potion , sometimes it returns: CreateBase invalid item ####### After investigation i tried to call the function .add random_potion and sometimes it gives the same problem. BUT any item in the random_potion list is valid if called

This issue cause a lot of errors in spawns script and other script calling random lists

coruja747 commented 7 years ago

try check if these defs are set correctly on your scripts

on default script pack, NAMES_EAGLES is located on sphere_names.scp and random_potion is located on sphere_template_magic.scp

thekeen commented 7 years ago

Defs are correct, the problem seems to act in all random cases Names, loots. It doesn't appens everytime when server call a "random", Some eagles have names, some birds have names. But sometimes it returns me this error. Name pool 'NAMES_#######' could not be found Or CreateBase invalid item #######

It's weird i know, it seems like sometimes random values returns unlisted elements... :/

Server version Win32 0.56.4.2538 Tested on Os: Win 7 Italian (AMD Phenom) e Win 10 Italian (Core i5) Scripts from scriptspack

thekeen commented 7 years ago

I created a script just to check:

ON=@RegenStat NAME=#NAMES_BIRDS SERV.LOG=New name

As you can see sometimes there is a random error. It doesn't matter if i check on #NAMES_BIRDS or #NAMES_DEMONS or #NAMES_DAEMON or i loop a function create item {i_blight 1 i_corruption 1 i_scourge 1 i_taint 1 i_putrefaction 1 i_muculent 1}

Sometimes it goes wild :/

08:29:(custom_events.scp,65)New name Thrush 08:29:(custom_events.scp,65)New name Swallow 08:29:(custom_events.scp,65)New name Starling 08:29:(custom_events.scp,65)New name Woodpecker 08:29:ERROR:(sphere_name.scp,6546)Name pool 'NAMES_BIRDS' could not be found 08:29:(custom_events.scp,65)New name NAMES_BIRDS 08:29:(custom_events.scp,65)New name Cuckoo 08:29:(custom_events.scp,65)New name Wren 08:29:(custom_events.scp,65)New name Tern 08:29:(custom_events.scp,65)New name Kingfisher 08:29:(custom_events.scp,65)New name Chickadee 08:29:(custom_events.scp,65)New name Nuthatch 08:29:(custom_events.scp,65)New name Nightingale 08:29:(custom_events.scp,65)New name Towhee 08:29:(custom_events.scp,65)New name Swift 08:29:(custom_events.scp,65)New name Warbler 08:29:(custom_events.scp,65)New name Starling 08:29:(custom_events.scp,65)New name Plover 08:29:(custom_events.scp,65)New name Nuthatch 08:29:(custom_events.scp,65)New name Nightingale 08:29:(custom_events.scp,65)New name Woodpecker 08:29:(custom_events.scp,65)New name Starling 08:29:(custom_events.scp,65)New name Wren 08:29:(custom_events.scp,65)New name Towhee 08:29:(custom_events.scp,65)New name Kingfisher 08:29:(custom_events.scp,65)New name Nightingale 08:29:(custom_events.scp,65)New name Kingfisher 08:29:(custom_events.scp,65)New name Woodpecker 08:29:(custom_events.scp,65)New name Wren 08:29:(custom_events.scp,65)New name Skylark 08:29:(custom_events.scp,65)New name Towhee 08:29:(custom_events.scp,65)New name ChickaNew name Towhee 08:29:(custom_events.scp,65)New name Finch

coruja747 commented 7 years ago

that sounds strange, I tested here (core i5 / win10 / latest sphere 56d nightly 260) using this script creating the npc with 1 hits / 10000 maxhits and SERV.REGEN0=1 to force hits regen at each 1sec. The test took almost 3 hours to finish and it doesn't get any single error

[CHARDEF 05]
DEFNAME=c_eagle
NAME=Eagle
SOUND=snd_ANIMALS_EAGLE1
ICON=i_pet_EAGLE
ANIM=03a0c1f
CAN=MT_WALK|MT_FLY
DAM=5,10
ARMOR=20,25
RESOURCES=36 i_feather, 1 i_bird_raw
FOODTYPE=5 t_fish
AVERSIONS=r_civilization,e_carnivores2

ON=@Create
NPC=brain_animal
STR={31 47}
DEX={36 60}
INT={8 20}
MAXHITS=20000
HITS=1

ON=@RegenStat
NAME=#NAMES_BIRDS
SERV.LOG New name <NAME>

[NAMES NAMES_BIRDS]
21
Chickadee
Crossbill
Cuckoo
Finch
Hawk
Kingfisher
Lapwing
Nightingale
Nuthatch
Plover
Skylark
Sparrow
Starling
Swallow
Swift
Tern
Thrush
Towhee
Warbler
Woodpecker
Wren

so unfortunately I have no idea whats wrong on sphere-side, maybe this is an isolated problem on your PC. Or maybe it could be your spheresvr.exe file, if you're using 56c, try update it to latest 56d nightly: https://ci.appveyor.com/project/coruja747/source/build/artifacts

thekeen commented 7 years ago

I tested it on 2 different pcs Win 7 (AMD Phenom) e Win 10 (Core i5) In 56c i haven't this problem. I was using 46d (so meanwhile i rolled back) In 56d i tryed main and experimental, but the problem persists. No custom scripts in the server, just a clean install and the test custom_events.scp i posted here.

It seems to solve with latest build, i'm testing it now and i have no problems.

May I ask you how to subscribe to sphereserver community forum? I cannot se the captcha (tried on 3 different pcs and disabled adblock)

Great work, thank you!