Comments (8)
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.
from source-x.
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.
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.
But there no eval on the problematic if. You mean server us eval on internal?
from source-x.
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.
Now with the new action on github, .exe will be create when you create a PR. Everyone can test it easy.
from source-x.
works, thanks.
from source-x.
Related Issues (20)
- region.tag (t_multi) HOT 5
- Monsters do not use some skills
- Spellbook Spells behaviour (OLD vs OSI) (Feature Request) HOT 1
- Debug and t_multi (custom?) HOT 4
- t_multi_custom remove HOT 3
- Vendor (Item without Value) HOT 9
- Feature Request: TIMERFD HOT 6
- TEVENTS not being saved on the item HOT 12
- COMP (Gets the number of components) HOT 5
- T_Multi_Addons Position
- ADDCOMP, DELCOMP HOT 8
- ISSTUCK HOT 15
- CAN_I_SCRIPTEDMORE
- PLEVEL commands not working on GM account HOT 1
- Problems with Curse Weapon magic in i_magic_necromancer
- Problems with pain_spike magic in i_magic_necromancer
- ISVALID female gump HOT 7
- LIST and math HOT 1
- can_i_damageable and ItemHitpointsUpdate, do not update status
- Giant Spiders drops i_spider_web in sleeping sector
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from source-x.