Instant death nodes

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).

Pages

AuthorTopic: Instant death nodes
Canned
Member # 8014
Profile #0
How do you make them? I have looked and I can't find out how. I want to know how to do it for when the party attacks a certain friendly person.

--------------------
I can transform into almost anything, but not sanity -Iffy
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
I like this image
Not in your shed -We are still under developement, but help would be nice. By the way, most of the conversation goes in the Moderator forum, in case your confused.
Everyone, just call me Iffy. Please.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Shock Trooper
Member # 10488
Profile #1
Try something like this in the START_STATE:
if(get_crime_level()>0){
kill_char(1000,3,0);
}
Or, if that doesn't work:
if(get_crime_level()>0){
i=0
while(i<4){
kill_char(i,3,0);
i = i + 1
}
}
(Maybe i<6 rather than i<4?)

Note: this should kill the party any time someone commits a crime. If you want it to run when a specific creature dies, you will have to give that creature a custom script - which could simply be a copy of basicnpc - and put the code in the DEAD_STATE, minus the if part.

[ Sunday, December 09, 2007 11:36: Message edited by: Celtic Minstrel ]
Posts: 334 | Registered: Friday, September 14 2007 07:00
Infiltrator
Member # 5576
Profile Homepage #2
Yes, you will want 6 rather than 4 in that loop if there are any NPCs attached to the party whom you want to kill. kill_char(1000,...) should do all that neatly for you though.

I will comment that as a player, I hate use of this tactic to prevent the party from doing things the designer doesn't want; anything else is preferable to me. I'd personally prefer this to be used only as a last resort.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Law Bringer
Member # 4153
Profile Homepage #3
If it's a friendly, important character, I can see why this is necessary. If it's just your personal cameo in your scenario, Iffy, then I'd say leave it alone and just make the character be level 100.

--------------------
TM: "I want BoA to grow. Evolve where the food ladder has rungs to be reached."

Gamble with Gaea, and she eats your dice.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Canned
Member # 8014
Profile #4
Yes, Iffy is level 100. But if he is attacked, he will be hostile. And if he is hostile, the scenario might be impossible. So an instant death node makes sense.

--------------------
I can transform into almost anything, but not sanity -Iffy
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
I like this image
Not in your shed -We are still under developement, but help would be nice. By the way, most of the conversation goes in the Moderator forum, in case your confused.
Everyone, just call me Iffy. Please.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Lifecrafter
Member # 7557
Profile #5
Level 100 means little, a GOD firebolt will blast a fire-resistant 2000HP level 100 character into dust with one hit. Then again thats what a GOD party is meant to be able to do but...

*Kicks self repeatedly*

Err um

Ah yes

As a script ignorant I'd like to know, would it be possible to have a script that would activate a death node that killed a PC if that script was set to kill the PC if his name was thus.
Posts: 942 | Registered: Sunday, October 8 2006 07:00
Shaper
Member # 7472
Profile Homepage #6
quote:
Originally written by Iffy:

Yes, Iffy is level 100. But if he is attacked, he will be hostile. And if he is hostile, the scenario might be impossible. So an instant death node makes sense.

Edit -Umm, I tried both and they don't work. Did I place this in wrong?

begintownscript;

variables;

short

body;

beginstate INIT_STATE;

// Setting crime low because Iffy is easily annoyed.
set_crime_tolerance(1);

if(get_crime_level(1)>0){
i=0
while(i<6){
kill_char(i,3,0);
i = i + 1
}
}
Note that copy and paste makes it a bit weird.

Wrong state. The kill node needs to be in the START_STATE, not INIT_STATE.

And also make sure to define the variable i. Otherwise, it thinks it's a mistake.

Nija - It depends on where the fire resistance comes from. If 25% fire resistance is coded into the data script for that creature, it'll always block at least 25% of incoming fire damage. Same applies to Ice, Magic, Mental, Poison/Acid, and Physical. So if one sets Magic resistance in the data script to 100%, that creature becomes completely immune to energy-based attacks, god party or not.

[ Sunday, December 09, 2007 12:18: Message edited by: Nioca ]

--------------------
Nioca's Citadel - A resource for BoA graphics and scripts, as well as my scenarios.
In Last Hope's Light RP - The end is near...
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Infiltrator
Member # 5576
Profile Homepage #7
You'll also want to use Alint to check your scripts if you do much scripting. It's far more convenient to know where there are errors before you load the script in the game and it crashes. It'll help you catch things like the undefined variable sooner and more painlessly.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Law Bringer
Member # 4153
Profile Homepage #8
quote:
Originally written by Buckshot Party:

Level 100 means little, a GOD firebolt will blast a fire-resistant 2000HP level 100 character into dust with one hit. Then again thats what a GOD party is meant to be able to do but...
Yes, god parties break scenarios and we know this. Everybody knows this.

quote:
As a script ignorant I'd like to know, would it be possible to have a script that would activate a death node that killed a PC if that script was set to kill the PC if his name was thus.
...so you're asking if a script could kill PCs with a certain name? I'm afraid I don't understand what you were trying to say (nor do I understand why you'd do this).

--------------------
TM: "I want BoA to grow. Evolve where the food ladder has rungs to be reached."

Gamble with Gaea, and she eats your dice.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Agent
Member # 8030
Profile Homepage #9
Alint doesn't work on older platforms. I'm forced to do it the old-fashioned way.

--------------------
"There's a hole in the bucket, dear Excalibur, dear Excalibur..."
Posts: 1384 | Registered: Tuesday, February 6 2007 08:00
Infiltrator
Member # 5576
Profile Homepage #10
Not meaning to sidetrack the topic, but what platforms are you refering to, Excalibur? Classic Mac OS?

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Lifecrafter
Member # 6193
Profile Homepage #11
kill_char(1000,3,0) would work just as well as looping through the party. I'd do it that way.

And you can get by fine without Alint, I never use it (command line is teh suk) and I know TM doesn't either, although he doesn't have that excuse.

--------------------
"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
Agent
Member # 5814
Profile #12
Right now, the way the script works is if the party commits any crime, they will be killed. If the effect is specific only to the hostility of a character, though, you may want to use the character's hostility as a trigger.

--------------------
It's just trying to say hi!
Posts: 1115 | Registered: Sunday, May 15 2005 07:00
Lifecrafter
Member # 6193
Profile Homepage #13
Well in this case it amounts to the same thing, because if they commit any crime the town (and thus that NPC) will go hostile.

But yeah, if you want to auto-kill for attacking an important NPC, you should probably put the autokill code in that NPCs death state. There are basicnpc edits that call town states on death, I'd advise using one so you don't have to write a whole new custom script for said creature (Scripts that add functionality to basicnpc are a good thing to have so you can do simple tasks without writing whole new scripts.)

--------------------
"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
Canned
Member # 8014
Profile #14
Well, what I want is a message to appear right before death. How is that done? And I am really confused with this.

--------------------
I can transform into almost anything, but not sanity -Iffy
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
I like this image
Not in your shed -We are still under developement, but help would be nice. By the way, most of the conversation goes in the Moderator forum, in case your confused.
Everyone, just call me Iffy. Please.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Infiltrator
Member # 5576
Profile Homepage #15
Just put a message_dialog call with your message right before the death code. The message will be displayed, then the party will die.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Shock Trooper
Member # 10488
Profile #16
Okay. If it's only for when you kill a specific character, go into the Blades of Avernum Files folder, and copy basicnpc.txt into your scenario's folder. Rename it Iffy.txt (or whatever you like). Open it up, and replace the DEAD_STATE with this:
beginstate DEAD_STATE;
message_dialog("Your","Message");
kill_char(1000,3,0);
break;
Then set Iffy as your character's script.

That should work.

(Note: I omitted the set SDF code because it won't do anything if you die right after.)

You could probably also alter it to be triggered when you attack the character, but I'm not sure how you would do that. It would still require the Iffy.txt though.

[ Sunday, December 09, 2007 17:49: Message edited by: Celtic Minstrel ]
Posts: 334 | Registered: Friday, September 14 2007 07:00
Shaper
Member # 3442
Profile Homepage #17
quote:
Originally written by Niemand:

I will comment that as a player, I hate use of this tactic to prevent the party from doing things the designer doesn't want; anything else is preferable to me. I'd personally prefer this to be used only as a last resort.
As a designer, I find that kill nodes are bad, too. It makes beta-testers cry. Of course, if you try to kill the uber-boss guy, you're not going to get off lightly, but still.

I like to put in a warning, and then boot the party out of the scenario, with a end_scenario(2) call - in game, I'd say they were exiled from town or whatever. Much nicer, and the player doesn't have to reload.

quote:
Originally written by Lazarus:

And you can get by fine without Alint, I never use it (command line is teh suk) and I know TM doesn't either, although he doesn't have that excuse.
I've used it once or twice. I think I was getting weird errors in TV, and I couldn't work out why. Turns out setting memory cells above the expected limits is bad.

--------------------
Nikki's Nook - bigger than Jesus?
Posts: 2864 | Registered: Monday, September 8 2003 07:00
Canned
Member # 8014
Profile #18
It doesn't take that long to reload.
Also, Iffy is the only one in the cave. So a message then death when you attack him would be okay without making a custom creature script.

Edit -are you guys glad that I am finally making Muffins n' Hell?

[ Tuesday, December 11, 2007 11:08: Message edited by: Iffy ]

--------------------
I can transform into almost anything, but not sanity -Iffy
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
I like this image
Not in your shed -We are still under developement, but help would be nice. By the way, most of the conversation goes in the Moderator forum, in case your confused.
Everyone, just call me Iffy. Please.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Shaper
Member # 7472
Profile Homepage #19
So long as it doesn't amount to Foul Hordes version 2, then yes, I'm glad. Because it means not only will we have another scenario in our community, but it may just lead you onto bigger and better scenarios. As the wise Creator said:
quote:
Then, finally, it out there for people to play! Congratulations! You have
just released your worst scenario!

Please note that this is not an insult. Your scenario might be very good -
but even then, your next scenario will almost certainly be better.

- Excerpt from Your First Scenario by The Creator


--------------------
Nioca's Citadel - A resource for BoA graphics and scripts, as well as my scenarios.
In Last Hope's Light RP - The end is near...
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Lifecrafter
Member # 6193
Profile Homepage #20
I'll second what Nioca said (and what the rest of the Creator's article said as well.)

--------------------
"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
Law Bringer
Member # 4153
Profile Homepage #21
I'm glad to see it happening, 'cause it means you're learning Avernumscript. And that means better scenarios down the road, as others have said. As for the specific content of the scenario, well, we'll see... I'm not exactly expecting Pulitzer-winning storytelling here.

--------------------
TM: "I want BoA to grow. Evolve where the food ladder has rungs to be reached."

Gamble with Gaea, and she eats your dice.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Agent
Member # 8030
Profile Homepage #22
quote:
Edit -are you guys glad that I am finally making Muffins n' Hell?
I...don't know.

--------------------
"There's a hole in the bucket, dear Excalibur, dear Excalibur..."
Posts: 1384 | Registered: Tuesday, February 6 2007 08:00
Canned
Member # 8014
Profile #23
quote:
And also make sure to define the variable i. Otherwise, it thinks it's a mistake.

Uh, what do you mean by "define the variable i"?

--------------------
Don't judge a sentence until you know all the words.
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
Muffins n' Hell: The End is Near
Not in your shed -We are sort of done. Helpful criticism is welcome.
Everyone, just call me Iffy. Please.

Be grateful you have your unsellabe trowels -Goldenking

Just so you know, I am working on Muffins n' Hell the scenario.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
The Establishment
Member # 6
Profile #24
Take a look at any of Jeff's scenario town scripts. Near the top, you will see a section for variables. You will often see:

int i, j
short choice

"i", "j", and "choice" are variables that are used throughout the script. You may define your own. Read the section on it in the documentation. If this gives you trouble, read up on the BASIC programming language. It should give you a basic understanding of the variable.

--------------------
Your flower power is no match for my glower power!
Posts: 3726 | Registered: Tuesday, September 18 2001 07:00

Pages