#Sanginir Tribe
1 messages · Page 5 of 1
what
Tho atm idk how else to implement it since the problem is that while we are getting the unit attack, we don't know if it's in a fight or not, and thus can't really compare it to the fightee
idk what u mean by that
Another probably better solution is to patch one of the BattleHelpers. I can help with this tomorrow
Since neither is easy task
Nor to explain
Not tomorrow, day after tomorrow
oh
ok
rip
might as well play with the buggy version until then 🎉
i have this until then
should work i think
maybe
perhaps
who knows
wait the tech isnt feast
lemme fix that
Also are you getting these from a dll?
from dnspy
While compiling and decompiling somewhere c# replaces all statements in if-s to flags
So not all were made by me
And also local variables dont save their name
I probably have the og source code somewhere
(it gives +0.5 attack permanently to bats and vampires)
Should be relatively easy
Just tell me the general approach
but check for unit type
How you would do it
Ye
so instead of checking for terraintype i check for unittype
i specify batsgn and vampiresgn
Yes seems legit
So the reason it is sometimes state and sometimes gameState is
idk, it is just inconsistent coding
Some methods have state parameter and some have gameState
oh ok
And harmony expects exact names
You can check a current method's parameters by either checking dnspy which might be outdated in that sense especially, or you start typing that method somewhere in vs code and see what that little tip/autocomplete says the parameter name is
Like if I am patching PClass.PMethod(GameState ???) i do this temporary checking
PClass pclass;
pclass.PMethod(
And when you start typing there vs code tells you the parameter names
Fun fact, polyscript mods usually break cause polytopia devs literally renamed a few parameters
damn
yeah so my units have 0 attack
it happens every time
i change attack value
happened with conquistor too
yes
i fixed it by fixing a typo with tech unlock
but thats not the case here
theres no typo
leechbuff is the attack increase on units with leech
like when a leech unit
attacks another unit with less hp than it
it gains +1 attack
vampirism increases it to +1.5 attack
Ok so clear this whole patch and copy the one from conquistor not from og sanginir
Cause all that commandbase bullshit is related to checking whether the unit is in an attack rn
oh ok
Like
And then u can compare attacker amd attackee
But no need to do that here
Just simply increase attack as you did with conquistor
And it applies against everyone
k
how do i get
the unit
that the leech unit is attacking
to check if its lower hp then
See that is the difficult part
And what that monstrosity tries to achieve
Like in GetAttack
From other methods it is probably easier
There are ideas i have
But sadly i wont be at my laptop for until the day after tomorrow
There is no instance and no other unit
Just start from conquistor and not from my old code
...???
Cause they serve two very different purpose despite patching the same method
then how tf does one tell if the target has less hp than the attacker
if u cant even
get
the attacker
Aren't you doing just the simple leech attack buff?
Ohh
Okay i get it now
maybe i should rename it to "leechattackincrease" like it was
because
ijust realized
u mightve had it confused
with the permanent +0.5 attack increase on bats and vampires
even tho its not related to leech at all i can see how u made that mistake
I have an idea on how to do it but it would require patching another method with prefixpostfix which is pretty complex id say, I can explain in 2 days
Until then yeah you can do simpler ones like permanent attack increase
k
saving it for later 
how does one check for unittyoe
type
actually i can search that myself
Uh you can also do /* large chunk of code */
To comment out
Doesn't matter tho
Lol
Two curly brackets in the picture arw no commented out btw
ik
i fixed that
is there anything hardcoded specifically to one unit
aaa
idk
GOD DAMN THAT BOT CAN COOK
except for the fact that the attack doesnt actually increase
mhmmm
wait
idk
rip
It looks good tho
rip
Are you 100% sure you didn't misspell anything?
And that you replaced the dll, and that it loaded in?
yes
These are dumb questions but I oftentimes forget to look at these
im gonna try the bot's replacement lol
even tho it doesnt know that i didnt typo the names
go to sleep
lmao the clanker's code was wrong
actually maybe it does work but just doesnt show in the ui which sucks
no thats not the case
i think i found a solution by checking the tile of the selected unit and getting that unit and if it works dont question it
conquistor did it and it worked btw
guys iy didnt work
fapingvin when you wake up if its not too much trouble can you help me find out why this doesnt work, the ai hasnt been very helpful and i cant see anything wrong
this is what we usually do when we say maintenance
@tacit pasture hi pls help me idk what i did wrong but something isnt working it sucks aaa
.
@obtuse orchid pls post screenshot im from fone
also any error messages?
or like whats not working
no
it simply isnt giving more attack
5 min
im here
hi fapingvin
so
i require what is known as assistance
it doesnt do anything
the code
it looks fine but it isnt
this one
let me see
huh
okay so do you have modLogger?
if not just put this in your Main class public static ManualLogSource modLogger;
okay, but uh that won't make the logger visible elsewhere only in load method
idk why polyscripttemplate does that btw, but not important
do this
like this
so we are going to use the method of debugging by logging cause i dont see any issues with the code rn
but with logging we can get very useful info
ok
u mean like this
yes but ofc put it inside the method
true
the curly brackets define the region that the if is bound to
ok well never hurts to tell :)
the first one doesnt even show
the it loaded here?
why? theres no need, its just not there
or search for error
also this
there might have been a loading error
cntrl f "error" no results?
yeah ignore that
okay, so the log not showing up could mean various things:
- The patched method itself does not execute
- The patched method executes but harmony patching is at fault
- The dll was not correctly built/copied/loaded
So the first one with this specific method is kinda impossible, since we have patched this in past
Second one, harmony would show an error i am pretty sure, it is quite intelligent in that sense
Third one, sometimes vs code just- refuses to build lmao. I usually have this thinking it built and copy the previous version dll
or
actually
no or, cause you do have CreateAndPatchAll
if there is no error showing up in log files, is there exception, or something
no
wait.
i know
nvm
i do not know
here's the thing tho
dnspy builds the wrong harmony patch thing, it should be [HarmonyPatch(typeof(UnitDataExtensions), nameof(UnitDataExtensions.GetAttack), typeof(UnitState), typeof(GameState))]
but this is what it says
its goofy
nah that is okay they mean same stuff
and i think that just means you are patching an extension method but idhk
i may need to ask klipi
issue is probably something obvious i am not seeing
the only difference between this one and conquistor is that
conquistor doesnt check for specific unit type, it could be that
but also
conquistor gets the specific tile and the unit on it
this one does not
are you absolutely sure there are no errors in the logs?
yes
i am
100%
sure
there is only the one u said ignore
is anything wrong here
[HarmonyPostfix] [HarmonyPatch(typeof(UnitDataExtensions), nameof(UnitDataExtensions.GetAttack), typeof(UnitState), typeof(GameState))] public static void Empowerment(this UnitState unitState, GameState gameState, ref int __result) { modLogger.LogMessage("it loaded here"); var success = gameState.TryGetPlayer(unitState.owner, out PlayerState player); if(success) { modLogger.LogMessage("it was a success"); if(player.HasTech(EnumCache<TechData.Type>.GetType("vampirismsgn"))) { modLogger.LogMessage("no vampirism?"); if(unitState.type == EnumCache<UnitData.Type>.GetType("batsgn")||unitState.type == EnumCache<UnitData.Type>.GetType("vampiresgn")) { modLogger.LogMessage("yeah so it simply doesnt wanna add then huh"); __result = __result + 50; } } } }
@sour beacon i need your help, what is causing this to simply not work (not a typo in the names btw)
ok so all my units simply have no more attack value
thats really fun
really really fun
yippee
context
so i want to make a thing
that when a tech is researched
the units of the type gain +0.5 attack
but they dont get attack increased
and all my units now have 0 attack
also
none of the logger things show up
this patch is not executing
i mean they will deal 0 damage
remove what???
you override
this
oh
idk man i was just copying and pasting
this is ignored by harmony afaik
(warrior shoudlnt even be affected)
so the logger isnt logging
at all
wait wtf
so
leech doesnt work anymore now either
i hate polyscript so much
Bro something is wrong with the mod itself then
idfk what
Does the logger in Load method execute
yes
but
not the ones i put
in the methods
like i put one in leech
now leech isnt leeching anymore
and the logger isnt logging
i looked at comnquistor "harmonycreateandpatchall"
and there is a ", null" after it
idk if thats important but im trying it
that didnt do anything

well at least nobuild still works
@obtuse orchid try to send code frequently
like i would help you but i dont know what ur code looks like
not now
leech doesnt work and neither does empowerment when i activate it
like when i remove it from comment
bro do i really gotta download this
it makes all attack 0
for me it shows as like a txt file
ok so ur brackets are fucked up
i wanted to see errors too
yk
anyways
also
wtf was that null thing in createAndPatchAll
its in conquistor and conquistor works
the code didnt work before i added it in
it didnt change anything tho
so
its unnecessary
guess what still doesnt work 🎉
wait
leech works again
nice
@versed whale idk how changing the logger did anything but everything seems to work
let me get vampirism to test
ok so empowerment still doesnt work
so somehow
something here is wrong

|| does mean "or" right
it didnt tho
Try adding like 9999
ok but it isnt adding 50 anyway so how should 9999 change anything
it must be adding 50 to something else
or nothing at all
Also you can use += to replace = same + something
A = A + 1
Is equivalent to
A += 1
ok
well i didnt JUST change the logger, your brackets were fucked up aswell
you had your leech for example outside of the Main class
rip
its over guys
i cant even do brackets 💔
ok i tried adding 500 to the attack just to see
does it not show up or does it not deal more damage?
both
it neither shows up in the ui
or deals extra damage
Is getAttack int?
but the last logger message shows up?
ye
Cause you can have not int attack no?
bro its divided later by 100
bruuuh
Lol i forgor
best non polymod team polyscripter right here
it being divided isnt an issue cuz conquistor only adds 50
I was like "i heard of .5 attack it must not be int then"
hmm
It passed
```cs
[HarmonyPostfix]
[HarmonyPatch(typeof(UnitDataExtensions), nameof(UnitDataExtensions.GetAttack), typeof(UnitState), typeof(GameState))]
public static void EmpowermentAndLeech(this UnitState unitState, GameState gameState, ref int __result)
{
modLogger.LogMessage("it loaded here");
var success = gameState.TryGetPlayer(unitState.owner, out PlayerState player);
if(success) {
modLogger.LogMessage("it was a success");
if(player.HasTech(EnumCache<TechData.Type>.GetType("vampirismsgn")))
{
modLogger.LogMessage("no vampirism?");
if(unitState.type == EnumCache<UnitData.Type>.GetType("batsgn")||unitState.type == EnumCache<UnitData.Type>.GetType("vampiresgn"))
{
modLogger.LogMessage("yeah so it simply doesnt wanna add then huh");
__result += 50;
}
}
}
TileData tile = gameState.Map.GetTile(unitState.coordinates);
TileData tile2 = gameState.Map.GetTile(__instance.Target);
var success = gameState.TryGetPlayer(unitState.owner, out PlayerState player);
if (success)
{
if (tile.unit != null && tile2.unit != null)
{
if (tile.unit.id == unitState.id && tile.unit.HasAbility(EnumCache<UnitAbility.Type>.GetType("leechsgn"), null) && tile2.unit.health < tile.unit.health)
{
__result = __result + 100;
if (player.HasTech(EnumCache<TechData.Type>.GetType("vampirismsgn")))
{
__result += 50;
}
}
}
}
}``` idk
ok wtf is this
u are combining the leech attack increase and the empowerment attack increase?
into 1 method, because they work by adding to __result they should not interfere with each other
basically less patches but same thing
ok but the leech attack increase doesnt actually work
the code i had there
in the comment
doesnt work
cuz
i am unable to get the target's hp
or somethig
wdym
Cause how would you
unit.health
Like in GetAttack
There is no target
yeah so its an attack command thing
leech attack increase only happens when the target has less hp than the attacker, with leech
empowerment is a passive buff
btw i promised i would find the method to patch for leech
idk
battleresults?

which i encountered there before
shiiiiiiiiiiitcooooooooooode
well yeah
like it is gigantic method first of all
😖
and
in the end, damage is calculated
not attack
like get it
and how would you add to damage? if you don't know the formula
cause that could change
and is cringe
like hardcoding it
so
like in BattleHelpers attack damage is like starts here
like get attack
so basically in the middle of the method it gets unit attack
but
I think i can do it
i mean
i have an idea
prefixpostfix
would it be simpler to just remove empowerment completely
basically you prefix GetBattleResults, check if the opponent unit has less hp than yours and if so, add a custom temporary uniteffect. Patch GetAttack, if unit has that uniteffect, attack increases by 0.5 or something
Then postfix GetBattleResults, removing the unit effect
cringe
quite ingenious is you ask me @versed whale , but i only say that cause i thought of it
there is like something tiny broken there once we fix it method is flawless
lemme read goddamit
we just cant see it
i think i was too ambitious with sanginir
but as long as im not doing anything, i can start monuments
wooaaah
thats actually genius
yes i was fapingvin
cuz i literally have like
four harder things than leech attack increase
thats not bad tho, we can help
prefixpostfix to the win
5 maybe
bro leech attack increase is not hard and your method should work, there is something technical going on i think
send over current code pls
- ability that makes it when a unit with leech kills another unit inside ur borders, the city gains 1 pop
- ability that gives leech to units adjacent to a vampire, if they dont already have it
- ability that allows units to transform into another unit like a boat, but able to transform back at will instead of disembarking, and can also be done outside of ur own territory
- vampire castle connecting to capital from across the map without the trade route but if roads work a certain way this wouldnt be very hard
- maybe not hard but making it so a 0 attack unit (bat swarm, btw the unit transformed from #3 ) will gain the ability to attack
1: easy after leech is implemented
2: you can substitute ability with effects and ez
3: ez
4: my guess is this is the hardest of these lmao
5: 2 lines
ok so its not that bad
let me go look at roads tho
cuz im thinking
if it works like if the roads are adjacent or network or something till it reaches ur capital, and then the result is true
i can just fix the result to true for the vampire castle
nope thats not how it works im pretty sure
rip


huh???
polibrary reference?
and just copied sanginir code into an existing mod of mine instead of making new polyscript project
what demotivated you?
and it all came crashing down

life ig
idk
setting up a new polyscript project is sooooo time consuming
like there are two files
idk
yeah so i tested it and it worked

i mean i stripped everything related to sanginir
so not all the test
basically
cause i didnt want to make a patch.json for this
and also disabled other two methods
can you send me over the patch
you have
cause i can test more extensively
it literally works for me
obj > debug > net6.0 > dll is there
yes
bro
check modified date
on dll
maybe
vs code didnt build
and you keep copying old something
no its a new one
am i on the wrong version of dotnet
uh send over .csproj file?

its a skill issue
just a sec
100%

but you should still disable nullable in .csproj file
bro why would that change anything
idk
last resort
i mean
if csproj file and cs file is same
then how is it wrong?
vs code building perhaps
but
like
anyways, disable nullable cause that just causes issues
:(
then what can it possibly be
i can check
i have it on auto update
version 10.0.101
banan change load log message and build and check if u see the change
💀
❓ ❓ ❓ ❓ ❓
culprit found
ye
how does one fix this
uh literally start over, like a new project? this one has been clearly cursed by beelzebub

and just copy code
cause it worked for me
when i copied code
and it worked for you in other project
with conquistor
HELP
i need permission from myself
ok well
i just went and deleted everthing inside 
ez
no
fapingvin im very sorry but
it doesnt even work
WTF Ég.ehrlq
is it a pc issue
ok send mod file to me in dms
like the whole thing
im not gonna run the dll ofc
i just wanna see if i can build
but then how could you have built conquistor
maybe it is setup issue
idk
i thought i did all the steps
get the polyscript template, open as folder, do all the code in main.cs, build
do it exactly like how you did with conquistor and document steps here maybe you missed something
found it
:O
i think
whatd u change
i renamed shit from polyscripttemplate
oh my it was
yes
💀 and i didnt even notice
polyscript
nah ts aint polyscript
ok last time i tried to change polyscripttemplate name
it fucked up the mod
so i just renamed the dll after the mod was done
thats not how it works lmao
polyscript doesnt hate u forever
yippee yahoo guess what STILL DOESNT FUCKING WORK
namespace
delete solution file
delete solution
and reopen vs code
like close project
close vs code, the nreopen everything
cause it needs to regenerate
do you use the one i sent you or did you recreate changes?
i used the one u sent
great
share?
so um
there was prob an issue when i coped it
copied
to the mods folder
cuz i thought the folder would replace the other one
but they kinda merged and the new (or old idk) sanginir was inside the obj folder in the dbug folder etc etc
there was like a copy of the whole thing in there
it was weird
just delete whole thing, and put there whatever wasd did ig atp, cause it can get messy with vs code loading in two Main.cs files for example
for example.
ye i did
nope still doesnt work
my pc is autistic
im so done
like it has to be me
if it works for u guys
without changing anything
so
yk
fun
how about u guys just finish the mod for me at this point im clearly incapable of doing anything
at that point why doesnt someone else just make all my mods and all my tribes
my brain is so fried i saw "current" and i was like haha like water current did he mean corren- wait
mine is fried aswell
btw i had like 3 projects open today, whole day thinking about polytopia code and wrote exactly 0 new lines to any of them
my will to keep polytopia installed is being fried at this moment
nah when ancients come in december everything is gonna be solved
cant wait for new terrain really
for mapmaker
only benefit of skins for me
💀
since polyscript is out of the question rn
im going to make the monuments
here is the first monument
im thinking replacing altar of peace with "sacrificial altar" which is unlocked when you sacrifice a set number of units
but if that takes too much polyscript i am not doing it
Not before I was bloodless /joke
very cool
:(
just believe us when we say we are close to figuring it out
i mean
if it worked with conquistor there must be a way for it to work with sanginir
but now i have to go sleep soon
what would vampires do at a bazaar anyway
hmmm
wait
i just realized
u can only get the grand bazaar
from vampire castles
so maybe the grand bazaar can be something related to vampire castles
that isnt a vampire castle
Lol that soon at #1362225960585400450 message never came
wait this is fire
(dont look at my attempts, dont listen to them, i beg you)
hmmm how does one design a grand bazaar for vampires
People made fire tracks for tribes back in the day I think music used to work
yeah
There is also monkemewapi one
shalone was an absolute chef for the rastrapies skins
Monkewemapi maybe
Some day audio will be fixed and tribes will prosper again, you'd have quite a work to do then
me? i dont make music
last time i tried it sucked so bad i deleted all the files and emptied the recycling bim
bin
Delete the bin tio, burn all the evidence
lol
Personally I have several versions for toporzol and mica just waiting for the right moment
i can NOT be bothered to search for shitty soundfonts
ok touhou has alot but still
but ye we need audio
mr klippy can we get a fix
Soundfonts?
Yes
i might do one like next summer
perhaps after the mod jam
hopefully the next mod jam will be more popular
There are more tribes now
i think collabs should be allowed for the next mod jam
cuz
all the new modders
that cant do everything
they can team up
one person does gld
one person does sprites
etc
it would be epic
I usually shop for synthetic blood to feed to my carnivorous plant nursury. Stuff is so cheap when you buy it in bulk
why not just kidnap a few unsuspecting polytopians? it comes fresh and not lab-made
that's true, but killing a polytopian and trying to get it back out of the bazaar is difficult due to all the other vampires hiding in dark shadows that would try to mug you
I usually reserve fresh, natural blood for full grown plants and creatures in my garden since its harder to get
vampires dont mug other vampires
you must be a fake
in that case, dress yourself as a sanginir cultist
i will send you one of the gems
remember the 3rd robe otherwise they'll know you're fake
bruh I cant I have many legs 🗿
hide them idk
I mean maybe you havent seen them because they hide in the dark shadows
they also arent humanoid
lol reading ts without context is funni
so we can have 1 entry fighting for second place or wha
we just need actual good theme
hi
the +0.5 attack simply doesnt get added
thats the issue
it does build succesfully
but the +0.5 attack doesnt work
when i had the logger in, all the messages showed
ok imma see
even the one inside the bracket that increased attack by +0.5
soooooooooooooooooooooooooooo rip
ig
unless i keep it that way cuz as long as it works for everyone else its not really an issue
lol
i renamed an ability but didnt use ctrl + h
btw in code (so not json) there is rename symbol you can use after right clicking
and it renames it everywhere
also f2 is the shortcut
if you didnt know
or just keep the typo-ridden name and work with it from now on 
like midjiwan does with "tect" instead of "tech" in some places
i usually forget that i use my thingname_thingtype_tribe naming convention
THIS DOESNT WORK FOR ME WHYYYY
u run dotnet build Sanginir.csproj right?
brody idk what you are doing
mb
the other 2 are just skins
do u have latest polib
maybe
i have the one either you or fapingvin sent me in dms
what
the what
@tacit pasture did you send polib to banan in dms?
or wha
cuz if so then why
cuz
things broke and i needed fix
what fix
imma check git
ok i got latest polib
i am re-building sanginir.csproj just in case
btw how do i remove this in scout ship outline
No
ok
I think
@obtuse orchid are you comfortable with using non verified version of polibrary? my theory is that 2.1 still has effect code that somehow inteferes with unitdataextentions.getAttack
That is just github link and i think since then there were updates
but me and fap are on 2.1.1 (not yet released)
if it interferes its weird cuz conquistor still works and it needs polib to work
something with load order could be up
Isnt the issue confirmed to be some kind of build mistake?
polibrary getting patched after sanginir and shit
cant i just get it from the github
idk, is it?
you can but do so by copying the "mod folder"
cuz current release is 2.1
we want 2.1.1, when i rewrote effects
k so nothing can move
what
- issue wasnt fixed
wtf
bye bye polib
i got it from here btw
lmao it was a polib issue
ok time to do leech attack increase
which idk how to do
cuz attack command shenanigans dont work
@tacit pasture had an idea
basically
prefix patch attack action
give the unit a uniteffect
IF it has more hp than target
and then patch getAttack too
idk how to implement effects tho
and check for that effect
literally gld

