Raised This Month: $32 Target: $400
 8% 

Multi-tagging tag mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AnimalMonster
Senior Member
Join Date: May 2020
Old 02-09-2023 , 08:24   Multi-tagging tag mismatch
Reply With Quote #1

I have a few custom tags (enums) created in an inc file and i try to use them all for one parameter but i see that it doesn't work.. throws me the warning tag mismatch.

PHP Code:
_CI_InfoValueLenght({CI_ItemInfo,WeaponAnimations,CI_WeaponInfo,_}:Info)
{
    if(
_CI_InfoValueType(Info) != 4// Is not a string
        
return 1;

    if(
Info == CI_Wpn_ModelP || Info == CI_Wpn_ModelV || Info == CI_Wpn_ModelW)
        return 
MAX_PATH_LENGHT MAX_MODEL_LENGHT;

    if(
Info == CI_Item_SysName)
        return 
MAX_SYSNAME_LENGHT;

    if(
Info == CI_Item_Name)
        return 
MAX_NAME_LENGHT;

    if(
Info == CI_Item_Classname)
        return 
MAX_CLASSNAME_LENGHT;

    if(
Info == CI_Wpn_Ammo1Name || Info == CI_Wpn_Ammo2Name)
        return 
MAX_AMMONAME_LENGHT;

    return 
0;

Have i misunderstood how multi-tagging works? 'CI_Wpn_*' are part of 'CI_WeaponInfo' and 'CI_Item_*' part of 'CI_ItemInfo' (CI_WeaponInfo is the continuation of CI_ItemInfo i.e. CI_WeaponInfo's first element is equal to _:CI_ItemInfo)

The tags aka. enumerations:
PHP Code:
enum CI_ItemInfo {
    
CI_Item_SysName// String

    
CI_Item_Name// String

    
CI_Item_Classname// String

    
CI_Item_Cost// Number

    
CI_Item_ItemType// CI_ItemType

    
CI_Item_GiveFlags// CI_GiveFlags

    
CI_Item_StackMax// Number
};

enum CI_WeaponInfo {
    
CI_Wpn_Slot _:CI_ItemInfo// Number

    
CI_Wpn_FirstMode// CI_PrimaryMode
    
CI_Wpn_SecondMode// CI_SecondaryMode

    
CI_Wpn_ModelV// String
    
CI_Wpn_ModelP// String
    
CI_Wpn_ModelW// String

    
CI_Wpn_Fov// Number
    
CI_Wpn_Zoom// Number
    
CI_Wpn_Zoom2// Number

    
CI_Wpn_List// String (WeaponList)

    
CI_Wpn_Damage// Float
    
CI_Wpn_DamageBurst// Float
    
CI_Wpn_SlashDamage// Float
    
CI_Wpn_StabDamage// Float

    
CI_Wpn_DamageType// Bit

    
CI_Wpn_DeathWpn// String

    
CI_Wpn_RoundCost// Number
    
CI_Wpn_RoundSize// Number

    
CI_Wpn_Ammo1Type// AmmoType
    
CI_Wpn_Ammo2Type// AmmoType

    
CI_Wpn_Ammo1Max// Number
    
CI_Wpn_Ammo2Max// Number

    
CI_Wpn_Ammo2Cost// Number
    
CI_Wpn_Ammo2CostSize// Number

    
CI_Wpn_Ammo1Name// String
    
CI_Wpn_Ammo2Name// String

    
CI_Wpn_Accuracy// Float
    
CI_Wpn_AccuracyShotsPower// Number
    
CI_Wpn_AccuracyDivide// Float

    
CI_Wpn_MaxPunchX// Float
    
CI_Wpn_MaxPunchY// Float
    
CI_Wpn_BasePunchX// Float
    
CI_Wpn_BasePunchY// Float
    
CI_Wpn_DirChangeChance// Number

    
CI_Wpn_GunHoleOffset// Float:[3]
    
CI_Wpn_GunPosition// FLoat:[3]

    
CI_Wpn_GiveType// CI_GiveType

    
CI_Wpn_CanDrop// Bool
}; 
AnimalMonster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-09-2023 , 23:56   Re: Multi-tagging tag mismatch
Reply With Quote #2

Did you read the section in the Pawn Language Guide about plural tagging? There are some pieces of info that I think might be relevant to your issue. The discussion of plural tags starts with the last paragraph on page 142 and continues onto page 143. Particularly, this might be relevant:

Quote:
a formal function argument is a local variable in the body of the function. In the presence of plural tags, the formal function argument takes on the tag that is listed first.
If you could provide a working example (doesn't have to be your full code, just an excerpt in a compilable plugin would be nice) that doesn't have any non-standard dependencies, it's be easier for us to test things out.
__________________

Last edited by fysiks; 02-09-2023 at 23:57.
fysiks is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 02-10-2023 , 09:49   Re: Multi-tagging tag mismatch
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Did you read the section in the Pawn Language Guide about plural tagging? There are some pieces of info that I think might be relevant to your issue. The discussion of plural tags starts with the last paragraph on page 142 and continues onto page 143. Particularly, this might be relevant:



If you could provide a working example (doesn't have to be your full code, just an excerpt in a compilable plugin would be nice) that doesn't have any non-standard dependencies, it's be easier for us to test things out.
As is stated in the quote you gave me, it takes only one tag when used so the only way to use it that way is to somewhst detect the tag used which it seems impossible to do. Or remove the tag.

Here's a simplier version of what i did:
PHP Code:
enum x
{
     
x1,
     
x2
}

enum y
{
    
y1,
    
y2
}

function({
xy}:z)
{
    if(
== x1 || == x2)
       return 
1237

    
if(== y1 || == y2)
       return 
6252

    
return 1

One way we can do this is create a variable of type any which will be equal to "z" but i wonder if there's any other option...

Last edited by AnimalMonster; 02-10-2023 at 09:50. Reason: Grammatical mistakes
AnimalMonster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-11-2023 , 01:49   Re: Multi-tagging tag mismatch
Reply With Quote #4

Did you read the Pawn Language Guide? It goes into more detail about the situation in the next paragraph.

However, you might want to first ask yourself, "doesn't actually make sense to use a single function?" Maybe it does, maybe it doesn't but I would probably just start by creating separate functions and verify that that works first and then determine how much of the code in each function is the same. I don't really understand what you're ultimately doing so I can't tell what I would do in your situation.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode