NPC Script Question
Author | Topic: NPC Script Question |
---|---|
Infiltrator
Member # 148
|
written Sunday, September 30 2007 17:56
Profile
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
|
written Sunday, September 30 2007 19:43
Profile
Homepage
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
|
written Sunday, September 30 2007 20:48
Profile
Homepage
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! Amnesia • El Presidente • Where the Rivers Meet • A Visit to the Madhouse Posts: 2686 | Registered: Friday, September 8 2006 07:00 |
Master
Member # 5977
|
written Sunday, September 30 2007 21:50
Profile
Homepage
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
|
written Tuesday, October 2 2007 04:42
Profile
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
|
written Tuesday, October 2 2007 05:43
Profile
Homepage
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
|
written Tuesday, October 2 2007 10:34
Profile
Homepage
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
|
written Tuesday, October 2 2007 11:03
Profile
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
|
written Tuesday, October 2 2007 15:45
Profile
Homepage
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 |