The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Warnings while compiling 56c and default combat messages
Author Message
Mad Gunther
Apprentice
*

Posts: 45
Likes Given: 11
Likes Received: 5 in 5 posts
Joined: Oct 2015
Reputation: 1



Post: #1
Warnings while compiling 56c and default combat messages
Hello everybody, has someone tried to compile 56c-20160410 (latest, 9 april) version as release?

I got 332 warnings wich is a little bit unexpected, plus when compiling older nightlies versions from the same year and having 0 warnings. Everything is done like it should, i uploaded the version to a personal
git repo, cloned it to my pc, the path setting is alright, i set the output to release and got all these warnings.
If i compile it as a nightly i have no warnings. Both compiled versions works good so i came to the idea to leave it as a nightly version, wich it would be the same thing that 56c release, doesn´t it? I dont care what the console says while functionality keeps the same. I´m using visual studio 2010 on a windows 7 machine, but i don´t think that deal much with it. I have no clue about it, that´s why i ask to the voice of wisdom (Coming here is my last choice, don´t want to bother you so much hehe).

And for the other one question some of you are gonna kill but whatever... let´s give it a try... can i set back again the defaults combat messages? ^^. Like: you hit <src.name> in the head! and so on.. Yeah i know almost the whole community are against them and they are pretty much useless stuff, that´s why they got deleted, but i would to have option of turning them on or off with detail command, i´m just like these freak restorers that get deep into every single detail, it is insane. I don´t see where to start since there´s no reference in @GetHit or @Hit to the hitted part, so.. what´s left to do? it is just possible adding the hardcoded behaviour into source?

Like always thanks in advance, Cheers!
06-08-2016 06:18 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Warnings while compiling 56c and default combat messages
that's strange, some months ago I was using VS2010 and it compile perfectly with 0 warnings. And it still working fine now using latest 56d nightly on VS2015

try check if your visual studio settings are correct, or check if you doesn't changed any file accidentally (because on C language you can break the compiler or get millions of errors just because an single wrong word). Also check if these messages are really errors or just some VS warnings, because warnings are classified by level 1-4 and VS will show only warnings that match your VS settings

and as far I remember, you won't find any reference about these combat messages because they are exactly what you said: just some random messages. The char doesn't aim to an specific body part on combat and these messages are just random texts with no functionality, that's why they got removed. But you can get this "feature" back just using an simple script to add some random texts on trigger @Hit

Code:
[EVENTS e_combat_message] //add this event on chars
ON=@Hit
DORAND 5
  SYSMESSAGE You hit <SRC.NAME> on the head.
  SYSMESSAGE You hit <SRC.NAME> on the arms.
  SYSMESSAGE You hit <SRC.NAME> on the chest.
  SYSMESSAGE You hit <SRC.NAME> on the legs.
  SYSMESSAGE You hit <SRC.NAME> on the foot.
ENDDO
and if you prefer, you can take it further and add some functionality on the script (eg: change the damage value [ARGN1] to take more damage if you hit the head, etc)
06-12-2016 12:18 PM
Find all posts by this user Like Post Quote this message in a reply
Mad Gunther
Apprentice
*

Posts: 45
Likes Given: 11
Likes Received: 5 in 5 posts
Joined: Oct 2015
Reputation: 1



Post: #3
RE: Warnings while compiling 56c and default combat messages
Hello Coruja, Thanks very much for your answer!

The same day i wrote this topic i did this:

Code:
/////////////combat def messages////////////////////
[function msgarm1]
sysmessage=You hit <src.name> left arm!
src.sysmessage=<name> hits your left arm!

[function msgarm2]
sysmessage=You hit <src.name> right arm!
src.sysmessage=<name> hits your right arm!

[function msgarm3]
sysmessage=You hit <src.name> right arm!
src.sysmessage=<name> hits your right arm!

[function msgchest1]
sysmessage=You score a hit to <src.name> back!
src.sysmessage=<name> scores a hit to your back!

[function msgchest2]
sysmessage=You hit <src.name> chest!
src.sysmessage=<name> hits your Chest!

[function msgchest3]
sysmessage=You land a blow to <src.name> stomach!
src.sysmessage=<name> lands a blow to your stomach!

[function msgchest4]
sysmessage=You land a terrible blow to <src.name> chest!
src.sysmessage=<name> lands a terrible blow to your chest!

[function msgchest5]
sysmessage=You knock the wind out of <src.name>!
src.sysmessage=<name> knocks the wind out of you!

[function msgchest6]
sysmessage=You hit <src.name> in the ribs!
src.sysmessage=<name> hits you in the ribs!

[function msgchest7]
sysmessage=You smash <src.name> in the rib cage!
src.sysmessage=<name> smashed you in the rib cage!

[function msgfoot1]
sysmessage=You hit <src.name> foot!
src.sysmessage=<name> hits your foot!

[function msghand1]
sysmessage=You hit <src.name> left hand!
src.sysmessage=<name> hits your left hand!

[function msghand2]
sysmessage=You hit <src.name> right hand!
src.sysmessage=<name> hits your right hand!

[function msghead1]
sysmessage=You hit <src.name> straight in the face!
src.sysmessage=<src.name> hit you straight in the face!

[function msghead2]
sysmessage=You hit <src.name> on the head!
src.sysmessage=<name> hit you on the head!

[function msghead3]
sysmessage=You hit <src.name> square in the jaw!
src.sysmessage=<name> hit you square in the jaw!

[function msghead4]
sysmessage=You score a stunning blow to <src.name> head!
src.sysmessage=<name> scores a stunning blow to your head!

[function msghead5]
sysmessage=You smash a blow across <src.name> face!
src.sysmessage=<name> smashes a blow across your face!

[function msghead6]
sysmessage=You score a terrible hit to <src.name> temple!
src.sysmessage=<name> scores a terrible hit to your temple!

[function msgleg1]
sysmessage=You hit <src.name> left thigh!
src.sysmessage=<name> hits your left thigh!

[function msgleg2]
sysmessage=You hit <src.name> right thigh!
src.sysmessage=<name> hits your right thigh!

[function msgleg3]
sysmessage=You hit <src.name> in the groin!
src.sysmessage=<name> hits you in the groin!

[function msgleg4]
sysmessage=You hit <src.name> in the groin!
src.sysmessage=<name> hits you in the groin!

[function msgneck1]
sysmessage=You hit <src.name> in the throat!
src.sysmessage=<name> hits you in the throat!

[function msgneck2]
sysmessage=You smash <src.name> in the throat!
src.sysmessage=<name> smashes you in the throat!
////////////////////////////////////////////////////////////////

//////////////////Global function/////////////////////////////
[function combathitmessage]
dorand 23
msgarm1
msgarm2
msgarm3
msgchest1
msgchest2
msgchest3
msgchest4
msgchest5
msgchest6
msgchest7
msgfoot1
msghand1
msghand2
msghead1
msghead2
msghead3
msghead4
msghead5
msghead6
msgleg1
msgleg2
msgleg3
msgleg4
msgneck1
msgneck2
enddo
/////////////////////Event/////////////////////////////
[events e_defaultcombatmsg]
ON=@Hit
combathitmessage
//////////////////////////////////////////////////////

It´s the same as you wrote but with the proper messages added, plus taking in count attacker and defender to display the hitted body part like the old style.

One of the cons of this method is that you can not play with %ss strings to send messages like you hit <src.name>´s (you can´t add ´s to the name in src.sysmessage), but well that aint too much to piss me off, i can deal just with <src.name> perfectly.

The other one is... This messages weren´t displayed while checking body parts in source?, if i remember well in 56b source they still are and there is a switch to iqty -1 or something like that and it was rolling for the hitted part, then when body part was selected it displayed both messages to players, or to players from npcs.... I saw it some days ago but i hace to check it out again to make sure, but if you remember well it has to work like that. But I´m asking that because it is pretty annoying to read a: <name> hit you in your throat ! and then inmediataly see <name> damaged your iron platemail legs! hahaha.

If it was working like that (weird) then the code above is more than good, but if not it gets very complicated... yeah idk why but i like to get in trouble lol.

About the warnings right now i just got 28, so we are improving it a lil bit. Here we have them:

[Image: 5d9c5c3dc5bd176f29c592da046b944ao.jpg]
I´ll do a check to make damn sure everything is ok using your tips.
Thanks very much for answering again mate, really appreciated!
(This post was last modified: 06-13-2016 12:00 PM by Mad Gunther.)
06-13-2016 11:58 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #4
RE: Warnings while compiling 56c and default combat messages
yea you got a nice idea, doesn't make sense hit someone on the chest and get "you destroyed <name> platemail legs". You can get/set the layer hit using LOCAL.ItemDamageLayer / LOCAL.ItemDamageChance on @GetHit trigger, but this is only used for item damaging, there's no others messages/bonuses/etc. So you just need to get this layer and show the proper message based on this number

PS: these compiler messages are not really errors, just some VS compiler warnings pointing some code lines that can be "improved". Of course it would be better without these warnings, but they doesn't cause any problem at all. Anyway, using latest 56d nightly I doesn't get any of these warnings so I presume that all of them are already "fixed" Tongue

PS²: if you're already using the last 56c code, it's a nice idea update it to 56d nightlies. It's the same code but with more improvements and bugfixes. Everything you need to do is update your SphereSvr.exe, sphere.ini, sphere_speech.scp and sphere_msgs.scp
06-14-2016 03:30 AM
Find all posts by this user Like Post Quote this message in a reply
Mad Gunther
Apprentice
*

Posts: 45
Likes Given: 11
Likes Received: 5 in 5 posts
Joined: Oct 2015
Reputation: 1



Post: #5
RE: Warnings while compiling 56c and default combat messages
Hello Coruja, Thanks for the info.

I´ve been trying what you said and itemdamagelayer works pretty good. I can get the layers easily but i have noticed that info on sphere_defs doesn´t fit too much with the info that i get ingame. For example ingame i get 3 layers that are not listed in sphere_defs, they are:
layer_neck=0x0a
layer_waist=0x0c
layer_innertorso=0x0d

Other strange seen i have checked out is that the higher layer i get is 18. if we look through source or sphere_defs layers are organized like this:

Code:
layer_hand1       1
layer_hand2       2
layer_shoes       3
layer_pants       4   // bone legs + pants.
layer_shirt       5
layer_helm        6
layer_gloves      7
layer_ring        8
layer_talisman    9   // talisman (se and ml)
layer_collar     10    // gorget or necklace.
layer_hair       11
layer_half_apron 12
layer_chest      13   // armor chest
layer_wrist      14   // watch
layer_light      15   // a itemid_light_src equip item can be put here.
layer_beard      16   // try to have only men have this.
layer_tunic      17   // jester suit or full apron.
layer_ears       18   // earrings
layer_arms       19   // armor
layer_cape       20   // cape
layer_pack       21   // only used by itemid_backpack
layer_robe       22   // robe over all.
layer_skirt      23   // skirt or kilt.
layer_legs       24   // 0x18 = plate legs.

Doesn´t make sense really... i had the idea to check the runuo core source, and voila!

Layer List
Code:
        Invalid      = 0x00,

        FirstValid   = 0x01,

        OneHanded     = 0x01,
        
        TwoHanded     = 0x02,
        
        Shoes         = 0x03,
        
        Pants         = 0x04,
        
        Shirt         = 0x05,
        
        Helm         = 0x06,
        
        Gloves        = 0x07,
        
        Ring         = 0x08,
    
        Talisman     = 0x09,

        Neck         = 0x0A,

        Hair         = 0x0B,

        Waist         = 0x0C,

        InnerTorso     = 0x0D,

        Bracelet     = 0x0E,

        Unused_xF     = 0x0F,

        FacialHair     = 0x10,

        MiddleTorso = 0x11,

        Earrings     = 0x12,

        Arms         = 0x13,

        Cloak         = 0x14,

        Backpack     = 0x15,

        OuterTorso     = 0x16,

        OuterLegs     = 0x17,

        InnerLegs     = 0x18,

        LastUserValid= 0x18,

        Mount     = 0x19,

        ShopBuy     = 0x1A,

        ShopResale     = 0x1B,

        ShopSell     = 0x1C,

        Bank         = 0x1D,

        LastValid    = 0x1D

These ones contrast well with what i get ingame, and i suppose i don´t get some of them because i´m using a 2.x.x version client (like bracelet for example). By this i mean the info available is not accurate right? because if not i don´t know whats really going on here lol. i´m planning to set layers manually when @gethit is called, so i´m planning to use the last ones and add the messages with them.

About the 56d, it sounds good. If it is less buggy and perfomance is better then let´s give it a try. I just changed a couple minor things in source that are hardcoded like parrying or adding styles to the attacks, so yea looks like the better option.
(This post was last modified: 06-18-2016 10:42 AM by Mad Gunther.)
06-18-2016 07:38 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #6
RE: Warnings while compiling 56c and default combat messages
layers are working fine, like on your example "layer_neck=0x0a" where this is the same of "layer_collar=10" (hex 0a = dec 10, neck = collar)

the layer name doesn't really matter because every emulator name it as desired, the most important value is the layer number, which is internally used by the client so it's the same on all emulators

also remember that not all layers can be damaged on @GetHit. By default sphere only cause damage on these layers (you can get or change this value using LOCAL.ItemDamageLayer):
Code:
LAYER_SHOES 3
LAYER_PANTS 4
LAYER_SHIRT 5
LAYER_HELM 6
LAYER_GLOVES 7
LAYER_COLLAR 10
LAYER_HALF_APRON 12
LAYER_CHEST 13
LAYER_TUNIC 17
LAYER_ARMS 19
LAYER_CAPE 20
LAYER_ROBE 22
LAYER_SKIRT 23
LAYER_LEGS 24

PS: weapons/shields are not included on this list because they are damaged in another way. When you hit someone using weapons there's a chance to damage the weapon on @Hit, and also there's another chance to damage the weapon/shield on @GetHit when you successfully parry an attack
(This post was last modified: 06-23-2016 04:10 PM by Coruja.)
06-23-2016 04:01 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Mad Gunther
Apprentice
*

Posts: 45
Likes Given: 11
Likes Received: 5 in 5 posts
Joined: Oct 2015
Reputation: 1



Post: #7
RE: Warnings while compiling 56c and default combat messages
lol i thought layers were being read in decimal instead of hex... I have tried to convert the numbers to hex and it works properly. Thanks for all the info, it was very helpful mate.

Greetings.
06-25-2016 08:46 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)