jed37 said:
I'm trying to give the fireball weapon a kickback, but I can't find the part of the machinegun code that's responsible for that. Anybody have any hints?
Weapon codes are in two sections - the "Gun" code that controls the firing of the bullets, and the "Bullet" code which controls how the bullets move. Currently, you're looking in the bullet section of the code, and the kickback is in the gun part. I have recorded that the machine gun is at 0x41e3D0 and that the fireball gun is at 0x41e110. That should help.
jed37 said:
Well it wouldn't really fight for you unless you changed the AI. *coughCURLY*
I think it'd just damage your enemies on contact, while trying to attack you.
Here's the problem with an attack enemy, as was always the problem with curly. She can only attack a limited set of enemies. This set is not defined by
her code, but by the
enemy's code. Whenever an enemy that she can hit runs, it does a few comparisons, and depending, uploads its x and y into curly's target x and y.
For the record, if you do want to make an attack pet, this is the code that all the hittable enemies have:
Code:
push 64
push 50
call 0040F350
add esp,8
mov [004BBA2C],eax
mov eax,[ebp+0008]
mov ecx,[eax+0008]
mov [004BBA20],ecx
mov edx,[ebp+0008]
mov eax,[edx+000C]
mov [004BBA24],eax
And curly's targetx = [004BBA20], targety = [004BBA24]
It would actually only be a few steps to make an attack critter, but you would have to repeat one of them over and over and over.
1) Copy the critters code into an unused bullet or a bullet you aren't going to use.
2) Replace the player x and y ([49E654], [49E658]) with target x and y ([004BBA20], [004BBA24])
3) Make the Iamanenemy code into a function (DO NOT push ebp at the start of this, it NEEDS to be preserved)
4) Call to that function in the code of every enemy.
And done!