I've written a table for the game, and it's posted here: viewtopic.php?t=12733 (I don't know how to link to the specific post, so scroll down a little)
In the table, I routinely desire to reference my specific communityID. That is, if I want to make a script for no bloodloss, I want it to only affect my community. In the table, the _community variable is a global variable established elsewhere. It's set to always refer to my community's, "uniqueID". So, if the community being referenced at the specific moment in the script is different than my community, it will move on and just do the normal code rather than injecting my changes.
The first way I learned how to make this check is like this:
...
label(noBloodLoss)
label(cleanUp)
label(code)
label(return)
newmem:
push rcx
push rdx
mov rcx,[rsi+290] //community
mov rdx,[rcx+98] //uniqueID
cmp [_community],rdx
jne cleanUp
movss xmm5,[noBloodLoss]
cleanUp:
pop rdx
pop rcx
code:
...
noBloodLoss:
dd (float)0
...
Which is, could I do this, instead, and have it work just fine:
...
newmem:
push rcx
mov rcx,[rsi+290] //community
mov rcx,[rcx+98] //uniqueID
cmp [_community],rcx
jne cleanUp
movss xmm5,[noBloodLoss]
cleanUp:
pop rcx
code:
...
My problem comes up whenever I want to reference a list. Like, when the offset is listed in the mono dissector as:
Spoiler
290 : Community (type: Community)
Spoiler
10 : AllCrops (type: System.Collections.Generic.List<PlantableCrop>)
So that's my question. How can I do this check? Many people might suggest using lua, which is a completely foreign language to me, but I'm asking a question to learn the answers. I'm not sure that I'm ready to learn lua, or the technique used in lua to easily dissect the list, but I'm open to recommendations. Ideally, I'd like to figure out how to do this using assembly, which I'm much more familiar with even though I'm still an elementary student in regards to it. As well, while I don't know how to reference my community from this method, I also don't really know how to reference the moisture level from the CropsManager method, since it's a list.
This won't work
push rdx
mov rdx,[rax+10] //offset for PlantableCrop list
mov [rdx+60],(float)10 //offset for currentMoistureLevel
pop rdx
I'm in way over my head here, and I'd like some help if I can get it.