Jump to content
  • 0

I challenge everybody...


john_smith_account
 Share

Question

Recommended Posts

  • 0
  On 6/10/2013 at 1:15 AM, Mallos31 said:

Kinda a long shot, but you might see if you can find anything in the code for the Beamos that makes it aim at link. Use that as a reference. 

You know, I was just thinking about that this morning...

 

You also have 3 planes to work with... unlike 2D which only has one. Your (X,Y), (X,Z) and (Z,Y). That should be useful to know how many angles you're dealing with.

 

When I was messing in RAM in my "Link Rotations" video, I saw a good list of degree values, and I think 0x8000 is 360 degrees.

Link to comment
Share on other sites

  • 0

There's at least one inverse trigonometric function (arctan I think) there but you don't even need to use it (directly) to get the actor to face Link. There is a function that will return the rotation value you need for any actor to face another actor, 80078068. Its arguments are: a0 = (pointer to current actor + 0x24), a1 = (pointer to target actor + 0x38). Take the return value of that function and store it to 0xB6 in your actor's RAM structure and it will face the target actor at all times.

 

If you want more detail on how it works, the game basically gets a direction vector from the x and z positions of the actors and works out the angle using the ratio and size of the two components and the direction of the vector. The function it uses to do that doesn't figure out the angle directly, it just converts the (magnitude of the) ratio into an index it uses to look up a result from a table (8012D310), which it then adds or subtracts numbers from to get the right direction (inverse trigonometric functions aren't 1 to 1).

  • Like 3
Link to comment
Share on other sites

  • 0

I love you, DeathBasket.

 

Well, now that I have aiming working correctly, I have encountered one last problem: collision. While implementing function calls to initialize collision (DeathBasket, you sent me a PM on this a while ago), nOVL simply crashes when I try converting the ELF to an overlay. There are no error codes, etc; nOVL just "stops responding".

Link to comment
Share on other sites

  • 0

I would love to have the modified actor Jason777 when it's ready. I have an idea where I will be using it.

 

I think I will make it a code stub, or expand another actor to work with it. I don't want it to be made into a totem pole, I want the raw code if it works.

Link to comment
Share on other sites

  • 0

Honestly, I think I may have to straight-up write the actor in assembly; I'm experiencing issues with both nOVL and GCC's MIPS C compiler that I think can be avoided if I just choose not to write it in C. I think that in the end it may be an issue with nOVL and relocation data so I don't know if I'll be able to fix it entirely.

 

Maybe there's something I'm not doing correctly here... Any of you who are experienced in writing actors in C might be able to find somewhere where I messed up. There are a lot of commented out things that I was mainly using for testing purposes. For some reason whenever I try to save the pointer that is returned by func_80032458, spawning no longer works correctly. There's also the issue of nOVL crashing whenever I try updating collision sphere placement...

 

 

  Reveal hidden contents

 

 

This is where it fucks up:

 

  Reveal hidden contents

 

 

Here are macros that one may need to know:

 

  Reveal hidden contents

 

 

... And here's the modified en_arow_trap actor with its timer removed (for those who care):

 

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

Try to avoid using variables in that manner (Collision and En_Arrow_Trap) - they end up in the .data section. Instead, use the AVAL macros on whatever space isn't used in the actor panel.

 

EDIT: Also try running nOVL with maximum verbosity - command line -vvv option. It may give you more insight as to why it is crashing.

Link to comment
Share on other sites

  • 0

I'm starting to think we just need to make an actor spawn these arrows instead, not the arrow trap. This is obviously doing no good... anyways, I think the variable for the arrows to hurt Link were 0030 or 0050. I forget as I have been very busy the past few weeks.

Link to comment
Share on other sites

  • 0
  On 6/16/2013 at 10:29 PM, Airikita said:

I'm starting to think we just need to make an actor spawn these arrows instead, not the arrow trap. This is obviously doing no good... anyways, I think the variable for the arrows to hurt Link were 0030 or 0050. I forget as I have been very busy the past few weeks.

That's what I was originally planning... I was going to make a few modifications here and there to en_arow_trap (remove the timer, remove proximity check) and then I was going to write a custom actor with collision, aiming, and a model which spawned en_arow_trap through its initialization function. Currently, both are done but the custom actor is running into some problems upon compiling.

 

EDIT: Alright the problem with collision is that nOVL seems to be handling virtual addresses as out-of-bounds memory addresses. I was under the impression that it should only be doing that for addresses that are less than or equal to 0x807FFFFF (within the range of absolute RAM addresses). As for spawning, I don't quite know why that isn't working correctly, yet.

 

As you can see in the picture below, nOVL starts by looking for relocations in the main function and then proceeds to look for more in the display function. Upon finishing its search it encounters a function call to func_8005dc4c and crashes upon scanning the delay slot. I say the delay slot because it follows immediately after the function call... that's a guess though.

 

Posted Image

 

Yeah... writing the custom actor in assembly seems like the only option at this point.

 

EDIT 2: Funny. I commented out one of the AVALs in the display function and the actor compiled. However, looking at the log given off by nOVL still shows how messed up it is:

 

Posted Image

 

Well, apparently the function prototype for the spawning function was incorrect. Spawning may be possibly fixed now; nOVL recognizes the function call to 0x80032458, but I have yet to test it.

 

EDIT 3: Alright well it turns out that spawning was working correctly but XYZ placement was not. The only thing that this actor lacks is collision... How does a progress video sound to you all?

Link to comment
Share on other sites

  • 0

Well, I finally got off my ass today and rewrote the actor in assembly just to make sure that it wasn't a problem with my coding... I'm happy to say that the actor works exactly as intended!

 

I will link to a new topic in this thread later today with the custom actor, its source, as well as other modifications I made to get everything working (including the original C actor that I ended up rewriting). Collision will be a part of a later release. In the meantime, I'll be throwing together a model and making a video after I'm done running errands and doing real-life shit today.

 

Happy day :)

Link to comment
Share on other sites

  • 0

From what I could tell, it changes the textures... I'm guessing... you might be right about the shiny coat, but the name makes me curious...

 

No spawning or model rendering.

 

EDIT:

I spawned it from Jabu Jabu during the cutscene when Jabu swallows Link, replacing the sparklies that appear to represent the air being sucked into Jabu's mouth. It doesn't crash, but it doesn't seem to do anything.

 

When I observed the actor, there are no spare object groups, just 0040. It's possible it's part of Jabu Jabu, but it has no significance other than possibly what is assumed... a possible shader to Lord Jabu Jabu? I'm tempted to attach this code to Lord Jabu Jabu somehow... perhaps its beta code doesn't work in this game anymore, or it just needs to be Linked it Jabu's model. It could be possible that it was used to render Lord Jabu Jabu's model before it was loaded into the map.

 

That being said, I'll have to dig through it, and attempt expanding Jabu's AI to insert the code, reconfiguring it to work. If I finish my work early today, I'll look into it tonight.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.