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

Infestation hook and AI behavior #30

Closed
iquare opened this issue Mar 28, 2018 · 5 comments
Closed

Infestation hook and AI behavior #30

iquare opened this issue Mar 28, 2018 · 5 comments

Comments

@iquare
Copy link

iquare commented Mar 28, 2018

Crash issue was solved, thanks to BoomerangAide, but I found another particularly troubling bug with infestation hook, while working with my AI scripts.
For some reason, AI somehow still treats infested structures as enemy units (if I understand correctly). As result of that, AI refuses to train Infested Terrans from infested structures. Pre-placed Infested Command Centers work just fine.

I'm not sure what is the source of problem, but I checked it both with infestation hook enabled and disabled, so I'm sure the problem is here.

@BoomerangAide
Copy link
Owner

Thanks for reporting.
This is a though one, since I can't test if it's working again or not after doing a change.
What I will do is change the incrementUnitScores functions (because even if they are not related, they get in the way of debugging after all), then check more deeply the helpers readUnitsArray_Sub49EFA0 and initializeEmptyUnitsLinkedListRef_Sub49E4E0 for missing/wrong arguments, because they are the most likely cause.

@BoomerangAide BoomerangAide self-assigned this Apr 4, 2018
@BoomerangAide
Copy link
Owner

BoomerangAide commented Apr 4, 2018

I'm making some changes, but I don't feel like they would really fix a thing.
I need to confirm something: when you say "I checked it both with infestation hook enabled and disabled", did you make your mod with just the infestation hook disabled and tested it like that, or did you just compare the modded/unmodded behavior of Starcraft?
The issue is that I suspected that something went wrong with readUnitsArray_Sub49EFA0, but everything I saw should be correct, BUT I realized that that function is actually hooked (in give_unit.cpp), so if you just tested modded behavior against unmodded behavior, there's a possibility that the issue would come from the give_unit hook instead.
I will check the whole infestation hook again, but I still think only readUnitsArray could make things go wrong, so I hope you will be able to answer.

edit: I actually found something wrong.The function orderReturnToIdle used at the end of orderMorphIntoInfested...should not exist at all in this hook!!It should be actUnitReturnToIdle used there.
In addition to the previous confirmation, maybe you can try changing the code to use the correct function, and see if that work, and report about it.
Thanks in advance.

@iquare
Copy link
Author

iquare commented Apr 5, 2018

For "disabled" hook I just commented out infestation hook, the rest is the same. Thanks, I'll check it with new changes.

@iquare
Copy link
Author

iquare commented Apr 5, 2018

I checked it now, everything works, AI now produces Infested Terrans from Infested Command Centers and other infested buildings (I made Barracks, Factories, Starports and Supply Depots infestable, and added new infested structures for them).

@BoomerangAide
Copy link
Owner

Ok, thank you for your help.
Will consider it fixed in Version 4.025.

@BoomerangAide BoomerangAide removed their assignment Apr 5, 2018
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