NPC Script Question

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: NPC Script Question
Infiltrator
Member # 148
Profile #0
Okay I know that NPC's have script issues. However if you set a default script in the scendata.txt file for that creature will the script then run properly?

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Lifecrafter
Member # 6193
Profile Homepage #1
I believe you're talking about joined NPCs, in which case no, there is no way to get them to behave in any way other than basicnpc (custom death states are possible, but that's it)

--------------------
"Heart of Earth located in Europe, Ass of Earth located in USA."

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Shaper
Member # 7472
Profile Homepage #2
There is a way to work around that. The creature could be modified to do stuff directly from the START_STATE of the town or scenario script. Of course, this can be tricky and unreliable at times, but it's the best we have available to us.

--------------------
Scenarios need reviews! Please rate these scenarios at the CSR after playing them!
AmnesiaEl PresidenteWhere the Rivers MeetA Visit to the Madhouse
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Master
Member # 5977
Profile Homepage #3
Also, it will probably slow down the entire town if a complete creature script will have to be run from the START_STATE. That, and it seems quite a hassle to me.

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00
Shock Trooper
Member # 10488
Profile #4
Plus you would have to repeat the code in every town! Not really worth it...
Posts: 334 | Registered: Friday, September 14 2007 07:00
Lifecrafter
Member # 6193
Profile Homepage #5
It actually seemed like a pretty cool idea to me. You could put it in a terrain script and make it so it runs ever turn (even from far away. Terrain scripts run in between combat turns as well, which could be useful.) That way each town you just put a terrain script down.

I don't see why it would slow things down. Well the terrain script idea might because it'd be run so often in combat, but checks could be made so that it only runs once per combat turn.

--------------------
"Heart of Earth located in Europe, Ass of Earth located in USA."

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Guardian
Member # 6670
Profile Homepage #6
One technique I thought up a while ago was to alter basicnpc.txt itself. Wrap the default behaviour in an else, and then add your own scripting in ifs that test for the desired condition. For instance, before the default else, test to see if the creature's number is X, where X is the creature number for Hank the Hireling.

I have yet to get around to implementing it, though.

--------------------
I wouldn't shake his hand if I were you. I hear he licks his thumb.
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
Shock Trooper
Member # 10488
Profile #7
That would work... provided the behaviour actually uses basicnpc.txt (which it probably does) rather than being hard-coded or something...
Posts: 334 | Registered: Friday, September 14 2007 07:00
Lifecrafter
Member # 6193
Profile Homepage #8
I think it's hard coded, because technically you don't HAVE to have a basicnpc script at all. Or maybe not... Anyway it's worth a shot.

--------------------
"NOW PASS ME MY BOOTS. I HAVE AN APPOINTMENT WITH A FACE." -Nikki

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00