Page 1 of 1
changing resurrection location
Posted: Mon Jan 16, 2012 11:34 pm
by agentorangeguy
How would I go about changing the resurrection location of the Avatar from the fellowship shelter? I don't think I was successful in editing the Avatar's usecode for that, it wouldn't work on the death event. Can someone help me figure this out?
Re: changing resurrection location
Posted: Tue Jan 17, 2012 3:15 am
by Dominus
When you tested this out, did you finish trinsic?
Re: changing resurrection location
Posted: Wed Jan 18, 2012 9:07 pm
by agentorangeguy
Hmm..... I never thought about that.....it may have been before I manually tripped the flag to allow the winches to work. i'll try again
Re: changing resurrection location
Posted: Wed Jan 18, 2012 9:16 pm
by Dominus
That was just what came to me on first look. Other than that I can offer no usefull help
Re: changing resurrection location
Posted: Wed Jan 18, 2012 9:24 pm
by agentorangeguy
I still keep resurrecting in the fellowship hall in Paws. Here is just a basic code I made, maybe it isn't functioning properly:
Code: Select all
void Avatar object# (0x400) ()
{
if (event == DEATH)
{
AVATAR->move_object([0x2f8, 0x237, 0x0]);
return;
}
}
Re: changing resurrection location
Posted: Thu Jan 19, 2012 10:37 am
by marzo
In BG, the function called when the Avatar dies is not 0x400, and the event is not the same as in SI; instead, it is function 0x60e event 4. You can alter this with a custom avatar_data.txt file, but you would need to manually call the old function instead of being able to use the .original syntax.
Re: changing resurrection location
Posted: Sat Jan 21, 2012 12:10 am
by agentorangeguy
I wouldn't know the first thing to do in that case. How would I go about doing that?
Re: changing resurrection location
Posted: Sat Jan 21, 2012 11:16 am
by marzo
Calling the old function using .original or shipping a custom avatar_data.txt?
If the former, then it goes like this:
Code: Select all
void AvatarFun object#(0x60E) ()
{
// code goes here
if (x == true) // Some random condition
AvatarFun.original(); // Calls the original function from BG
}
As for the latter: you create a text file called "avatar_data.txt" in the same directory as your mod's other data (shapes.vga, usecode, etc.). In this file, you paste the following:
Code: Select all
%%section usecode_info
#Format
# :type/function/event
#type is one of:
# 0 for death usecode
#function is either, the function number or :functionname
#event is the event id to use or -1 if event is not important
:0/0x60e/4
%%endsection
You replace 0x60e by the name (prepended with ':') or number of the function you want to call (in your case, either ':Avatar' or '0x400', without the single quotes); the function must be declared as object# or shape#. The '4' is the event number; to make it consistent with the si_tournament, you should swap it with a '7'.
Going this route means that you can't call the old function with the .original syntax I mention above; instead, you would have to do something like this:
Code: Select all
extern void OldAvatar object#(0x60e) ();
void Avatar shape#(0x400) ()
{
// Code goes here
if (x == true) // Some random condition
{
event = 4; // The old function only works for death with this event
OldAvatar(); // Call the original function from BG
}
}
Re: changing resurrection location
Posted: Sat Jan 21, 2012 4:00 pm
by agentorangeguy
Ok, let me make sure I state exactly what I need and if I'm following you correctly.
When the Avatar dies, I need a few things to happen:
-fade to black
-probably the normal 'death music'
-all nearby party resurrected
-all party healed
-teleported to LB's throne room (coords 0x3a7, 0x42f, main map, on my mod)
-unfade from black
So, one question I have is, if I go with the avatar_data.txt route, do I still need to make a seperate code, say 'avatar.uc' that calls the 'void Avatar shape(0x400)' function and make it 'if (event == DEATH)' as I tried in my original code?
Also, will I have to manually 're-create' what happens when the Avatar resurrects, as I mentioned in my above list? I've probably made this more confusing than it actually is lol
Re: changing resurrection location
Posted: Sat Jan 21, 2012 8:07 pm
by marzo
Yes to all.