Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some scripts won't compile #16

Open
Jaysyn904 opened this issue Jan 18, 2024 · 7 comments
Open

Some scripts won't compile #16

Jaysyn904 opened this issue Jan 18, 2024 · 7 comments

Comments

@Jaysyn904
Copy link

I have a script that compiles in the standalone nwnsc compiler, compiles in plugin version 1.1.0 with updates for the 35-40 version of NWN, but refuses to compile with plugin version 1.2.0.

w/ v1.2.0 (this is from another user's PC, but I had the exact same issue)
image

w/ nwnsc
image

w/ v1.1.0
image

@Leonard-The-Wise
Copy link
Owner

Hmm, that's a message I've never seen before. There are a few patches on the new compiler pending to update and I was waiting for it to become more stable to apply, but if you can provide at least a sample of the code I could take a better look into it.

@Leonard-The-Wise
Copy link
Owner

Leonard-The-Wise commented Jan 18, 2024

PS: You can also check if it will compile with this: https://github.com/niv/neverwinter.nim

Or if changing this option inside the compiler settings works:
image

If it does compile with Beamdog's compiler is a hint for me that I'll have to update the code already.

@Jaysyn904
Copy link
Author

I reverted to v1.2.0 & it is defaulted to Native. I set the compiler to Legacy NscLib & it did compile.

@Jaysyn904
Copy link
Author

#include "prc_x2_craft"

void MakeAbyssArmor(object oItem);

void MakeEmissaryArmor(object oItem);

void main (){}

void MakeAbyssArmor(object oItem)
{
    if(GetPlotFlag(oItem)) return;  //sanity check
     int nBase = GetBaseItemType(oItem);
    if(((nBase == BASE_ITEM_ARMOR) ||
        (nBase == BASE_ITEM_SMALLSHIELD) ||
        (nBase == BASE_ITEM_LARGESHIELD) ||
        (nBase == BASE_ITEM_TOWERSHIELD))
        )
    {
        int nBonus = 8;
        IPSafeAddItemProperty(oItem, ItemPropertyDamageResistance(2, 2) , 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);
        IPSafeAddItemProperty(oItem, ItemPropertyRegeneration(4)        , 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);

    }
}

void MakeEmissaryArmor(object oItem)
{
    if(GetPlotFlag(oItem)) return;  //sanity check
     int nBase = GetBaseItemType(oItem);
    if(((nBase == BASE_ITEM_ARMOR) ||
        (nBase == BASE_ITEM_SMALLSHIELD) ||
        (nBase == BASE_ITEM_LARGESHIELD) ||
        (nBase == BASE_ITEM_TOWERSHIELD))
        )
    {
        int nBonus = 6;
        IPSafeAddItemProperty(oItem, ItemPropertyDamageReduction(IP_CONST_DAMAGETYPE_FIRE, 25) , 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);
        IPSafeAddItemProperty(oItem, ItemPropertyRegeneration(4)                                , 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);

    }
}

@Leonard-The-Wise
Copy link
Owner

As I suspected, the problem is with the Beamdog compiler, not the plugin. The plugin is a mere wrapper for their code.

If you want to test further, please try to compile with the official tool (https://github.com/niv/neverwinter.nim), because from here I don't have the full stack of your code. If it passes you can report back on this thread and I can see if it is already worthy of upgrading the plugin to the latest version of the official compiler.

Thanks.

@Jaysyn904
Copy link
Author

It fails w/ nwn_script_comp. See issue here: niv/neverwinter.nim#108

@Leonard-The-Wise
Copy link
Owner

Leonard-The-Wise commented Jan 18, 2024

Ah ok. So I won't be able to fix it by myself, but as soon as they solve it there I can pull the patch for the plugin also.

I'll keep an eye for it (and you can also tell me if they close your issue). At least you have the workaround by using the old engine meanwhile.

Thanks again for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants