Giter Site home page Giter Site logo

Comments (8)

xwerswoodx avatar xwerswoodx commented on June 11, 2024 1

Okay I found out the issue, it's same as I wrote before, because _Evaluate_Conditional_EvalSingle returns as fVal = bool(Exp_GetVal(ptcSubexpr)); while Exp_GetVal is 32bit integer it causes this issue. Changing it Exp_GetLLVal solve the problem.

from source-x.

AtillaG1 avatar AtillaG1 commented on June 11, 2024

image

from source-x.

cbnolok avatar cbnolok commented on June 11, 2024

Possible solution, from a discord discussion:
nolok

15/07/2023 20:08
split the faction prop in two?
Gladie

15/07/2023 20:09
what do you mean?
nolok

15/07/2023 20:10
a better idea even
we have npcgroups and factions
some factions are exclusive to an npcgroup
still, every faction is in a big bitmask, thus we have enormous numbers
eg:

[DEFNAME npc_factions]
// Fey group (opposed to Abyss Group)
faction_fey 01 // Super Slayer

// Elemental Group (opposed to Abyss Group)
faction_elemental 02 // Super Slayer
faction_air_elemental 04
faction_blood_elemental 08
faction_earth_elemental 010
faction_fire_elemental 020
faction_poison_elemental 040
faction_snow_elemental 080
faction_water_elemental 0100

// Abyss group (opposed to Elemental and Fey Groups)
faction_demon 0200 // Super Slayer
faction_gargoyle 0400 // Super Slayer

we could instead start from 1 when beginning a new group
eg:

[DEFNAME npc_factions]
// Fey group (opposed to Abyss Group)
faction_fey 01 // Super Slayer

// Elemental Group (opposed to Abyss Group)
faction_elemental 01 // Super Slayer
faction_air_elemental 02
faction_blood_elemental 04
faction_earth_elemental 08

// Abyss group (opposed to Elemental and Fey Groups)
faction_demon 01 // Super Slayer
faction_gargoyle 02 // Super Slayer

that means that we have to change the code to check for both group and faction, but that will solve our problem with no additional memory footprint
or core complexities
Gladie

15/07/2023 20:16
but then would be 01 usefull twice?
because the faction system in core is done that if you have only the faction_elemental, you deal double damage to all the elementals of this group, but if you have only faction_air_elemental, you only deal tripple dmg to air elemental
maybe i dont get fully what you mean
nolok

15/07/2023 21:02
Yes
More than twice
Then we would need to split that into faction_group and faction_species/subgroup/something in the source
I have no better ideas honestly
And if the faction species is 0 but not the group, you will deal more damage to every monster in the group
The other thing that might be worth adding in the case of a rework is to enable to slay a specific defname
Maybe with another property like faction_extended, if 1 you check for additional tags containing defnames
That's an idea, maybe not the best one

from source-x.

xwerswoodx avatar xwerswoodx commented on June 11, 2024

The problem is not a range of values if I understand the issue correctly. Because 2^62 == 4,611,686,018,427,387,904 so that mean you can set values until 0x4000000000000000

The problem is evaluate not works perfectly for llong values, even faction_wolf not working correctly

FACTION faction_wolf
SERV.LOG <FACTION>
IF (<FACTION>&<def.faction_wolf>)
  SERV.LOG X
ELSE
  SERV.LOG NO-X
ENDIF
IF (<FACTION>&faction_wolf)
  SERV.LOG Y
ELSE
  SERV.LOG NO-Y
ENDIF
IF <EVAL <FACTION>&0800000000>
  SERV.LOG Z
ELSE
  SERV.LOG NO-Z
ENDIF```

Returns;

```Resync complete!
19:09:(defs_faction.scp,78)0800000000
19:09:(defs_faction.scp,82)NO-X
19:09:(defs_faction.scp,87)NO-Y
19:09:(defs_faction.scp,92)NO-Z
19:09:1:'xwerswoodx' commands 't'=1```

But faction_bird works well;

```[FUNCTION t]
FACTION faction_bird
SERV.LOG <FACTION>
IF (<FACTION>&<def.faction_bird>)
  SERV.LOG X
ELSE
  SERV.LOG NO-X
ENDIF
IF (<FACTION>&faction_bird)
  SERV.LOG Y
ELSE
  SERV.LOG NO-Y
ENDIF
IF <EVAL <FACTION>&080000000>
  SERV.LOG Z
ELSE
  SERV.LOG NO-Z
ENDIF```

Returns

```Resync complete!
19:12:(defs_faction.scp,78)080000000
19:12:(defs_faction.scp,80)X
19:12:(defs_faction.scp,85)Y
19:12:(defs_faction.scp,90)Z
19:12:1:'xwerswoodx' commands 't'=1```

080000000 equals to 2,147,483,648 which is 32bit integer max value not llong.

We probably need to change the evaluation system from int to llong to update that for 64-bit integers.

from source-x.

Jhobean avatar Jhobean commented on June 11, 2024

But there no eval on the problematic if. You mean server us eval on internal?

from source-x.

xwerswoodx avatar xwerswoodx commented on June 11, 2024

Yes, I meant the IF statements evaluate function like _Evaluate_Conditional_EvalSingle and QvalConditional for QVAL function not the EVAL function itself. EVAL, FVAL, HVAL etc already set 64-bit in CScriptObj.cpp but IF and QVAL have forgotten in 32-bit int. I changed both of them to 64-bit, I am testing right now but honestly it should work fine.

from source-x.

Jhobean avatar Jhobean commented on June 11, 2024

Now with the new action on github, .exe will be create when you create a PR. Everyone can test it easy.

from source-x.

AtillaG1 avatar AtillaG1 commented on June 11, 2024

works, thanks.

from source-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.