ai behavior question

Users who are viewing this thread

Khalid ibn Walid

Sergeant Knight at Arms
(using python files) I've been wasting hours trying to figure this out with all sort of permutations of the ai_bhvr code.

How do you get one party (call it A) to travel to or track another party (B), if A nor B is neither you nor a city? i.e. How do you get NPCs to follow or go to another NPC on the map.

And can someone please explain why reg(0) (usually a town or the distance between towns) is always assigned to "$x_id", where x is the pt name? Any other reg doesn't seem to work. And how is it after the creation of a party does the code know to link $x_id to pt_x without a line telling it to? Does reg(0) or $x_id have some magical properties I'm not seeing?

And now that I'm on python questions, is there a clean way of counting together all non-regular prisoners (i.e. a bunch of heroes)?
 
Hi Khalid,

Khalid ibn Walid said:
How do you get one party (call it A) to travel to or track another party (B), if A nor B is neither you nor a city? i.e. How do you get NPCs to follow or go to another NPC on the map.

Assuming id's of A and B are held in variables, "$party_A_id", "$party_B_id" respectively,

(party_set_ai_behavior, "$party_A_id", ai_bhvr_track_party),
(party_set_ai_object, "$party_A_id", "$party_B_id"),

And can someone please explain why reg(0) (usually a town or the distance between towns) is always assigned to "$x_id", where x is the pt name? Any other reg doesn't seem to work. And how is it after the creation of a party does the code know to link $x_id to pt_x without a line telling it to? Does reg(0) or $x_id have some magical properties I'm not seeing?
Reg(0) is a special register. Some operations store their result directly into reg(0). These start with the prefix "store0_" rather than the usual "store_". Also when a party is created its id is automatically put into reg(0).
And now that I'm on python questions, is there a clean way of counting together all non-regular prisoners (i.e. a bunch of heroes)?
Unfortunately no.
 
armagan said:
Hi Khalid,

Khalid ibn Walid said:
How do you get one party (call it A) to travel to or track another party (B), if A nor B is neither you nor a city? i.e. How do you get NPCs to follow or go to another NPC on the map.

Assuming id's of A and B are held in variables, "$party_A_id", "$party_B_id" respectively,

(party_set_ai_behavior, "$party_A_id", ai_bhvr_track_party),
(party_set_ai_object, "$party_A_id", "$party_B_id"),

And can someone please explain why reg(0) (usually a town or the distance between towns) is always assigned to "$x_id", where x is the pt name? Any other reg doesn't seem to work. And how is it after the creation of a party does the code know to link $x_id to pt_x without a line telling it to? Does reg(0) or $x_id have some magical properties I'm not seeing?
Reg(0) is a special register. Some operations store their result directly into reg(0). These start with the prefix "store0_" rather than the usual "store_". Also when a party is created its id is automatically put into reg(0).
And now that I'm on python questions, is there a clean way of counting together all non-regular prisoners (i.e. a bunch of heroes)?
Unfortunately no.

Hi Armagan. I have two questions for you.

1/ When is the Module System Documentation going to be completed? Not knowing things like reg(0) being a 'special register' makes Mod making very confusing.

2/ Is it possible to change AI within battle scenes? For example I want to make a 'dungeon' and I want enemy creatures to not know where you are. They wait in the same place until you are in their line of sight. Is there some way to use the player commands ('stay here', 'charge') on enemy troops?

Thanks.
 
Sheek:
Hopefully I'll write some more documentation after I release the new version.

2/ Is it possible to change AI within battle scenes? For example I want to make a 'dungeon' and I want enemy creatures to not know where you are. They wait in the same place until you are in their line of sight. Is there some way to use the player commands ('stay here', 'charge') on enemy troops?
Sorry. That's not possible at the moment.
 
Back
Top Bottom