Page 1 of 1

usecode question

Posted: Thu Oct 28, 2010 5:56 pm
by agentorangeguy
Hello all, I've got a usecode question I need help with...

I've been trying to fiddle with the usecode to make npcs stand a certain way with the "stand" schedule. For example, I'm working on Jhelom in the U6 mod I've been working on and some npcs are supposed to face a certain way while standing rather than just at random. I can't seem to get it to work in usecode. Is there a certain way to do this?

Re: usecode question

Posted: Fri Oct 29, 2010 5:12 am
by Malignant Manor
The schedules you can modify with Exult and Exult Studio are defined in the game engine (Exult). You can edit the NPC's usecode to achieve what you want with a delay.

The following will check the npc periodically when the Avatar is near and if the npc's schedule is standing. If the npc is not standing north, it will change its frame. You'll need to check how well it works for you.


Code: Select all

void Dupre object#(0x404) ()
{
	var PROXIMITY = 0;
	var STANDTHERE = 10;
	
	if (event == PROXIMITY && get_schedule_type() == STANDTHERE
				&& get_item_frame_rot() != 0)
		set_item_frame_rot(0);

	Dupre.original();
}

Edit by wjp: removed the extra space mentioned below.

Re: usecode question

Posted: Fri Oct 29, 2010 8:44 pm
by agentorangeguy
it didn't seem to compile. are there missing brackets in it somewhere?

Re: usecode question

Posted: Fri Oct 29, 2010 10:55 pm
by Malignant Manor
Somehow a space found its way in.

Code: Select all

set_item_frame_ rot(0);
should be

Code: Select all

set_item_frame_rot(0);

Re: usecode question

Posted: Sun Oct 31, 2010 1:34 pm
by agentorangeguy
I saw the space and fixed that, I forgot to mention that. Even without the space, it didn't seem to work so i thought maybe there were some brackets missing somewhere?

Re: usecode question

Posted: Sun Oct 31, 2010 5:57 pm
by Malignant Manor
It compiles just fine for both games but is the wrong npc for SI. Dupre does not have the stand schedule by default in BG. It's hard to know what your problem is without your source code or even an error message.

Re: usecode question

Posted: Thu Nov 04, 2010 11:08 pm
by agentorangeguy
Ok I was just doing it wrong, i got it to work now, thanks!

Re: usecode question

Posted: Wed Nov 24, 2010 10:57 pm
by agentorangeguy
I'm trying to work on a few npc healers. I successfully made the usecode in the conversation work to where it will heal an npc to the exact hit points they should have, and to cure the npc. I cannot seem to figure out how to do make them resurrect someone. any ideas how to do that?

Re: usecode question

Posted: Sat Dec 18, 2010 2:02 am
by Wizardry Dragon
A bit of a belated answer, but you can find all of the healing code you need in the Healing Services UCC code in TFL, which is of course GPL code:

http://u7feudallands.cvs.sourceforge.ne ... iew=markup

----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca