Profile for Walker White

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

Recent posts

Pages

AuthorRecent posts
Post yer monster scripts here in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #13
quote:
Originally written by *i:

All right, I've uploaded the magekiller script.
I am not trying to disparage your coding skills *i (script looks fine to me and -- more importantly -- it is easy for beginners to read). However, now that I have read your magekiller script I wanted to point out a quick tip to everyone on optimizing code (as scripts can slow the game down).

The magekiller script has the following code fragment (UBB forces me to use ~ to represent space indentations):


randtarg = get_ran(1,0,1);
if (randtarg == 0) {
~~~if (char_with_highest_skill(11) >= 0) {
~~~~~~caster = char_with_highest_skill(11);
~~~} else {
~~~~~~caster = char_with_highest_skill(12);
~~~}
}

if (randtarg > 0) {
~~~if (char_with_highest_skill(12) >= 0) {
~~~~~~caster = char_with_highest_skill(12);
~~~} else {
~~~~~~caster = char_with_highest_skill(11);
~~~}
}


This is a lot of branch checking, which can be expensive (especially on Pentiums). Moreover, the second if group looks almost like the first, just with different numbers. Using a little mathematics, you can collapse this to a single if-else statement.


randtarg = get_ran(1,0,1);
if (char_with_highest_skill(11 + rantarg) >= 0) {
~~~caster = char_with_highest_skill(11 + rantarg);
} else {
~~~rantarg = 1 - rantarg;
~~~caster = char_with_highest_skill(11 + rantarg);
}


Of course, some people may find this a little harder to read (which is a legitimate concern if we are sharing scripts). However, it is more efficient.

Edit: And if you really want it tigher, you can edit it down to this.


randtarg = get_ran(1,0,1);
if (char_with_highest_skill(11 + rantarg) < 0) {
~~~rantarg = 1 - rantarg;
}
caster = char_with_highest_skill(11 + rantarg);


[ Thursday, March 25, 2004 17:01: Message edited by: Walker White ]
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum
Apprentice
Member # 4127
Profile #13
quote:
Originally written by *i:

All right, I've uploaded the magekiller script.
I am not trying to disparage your coding skills *i (script looks fine to me and -- more importantly -- it is easy for beginners to read). However, now that I have read your magekiller script I wanted to point out a quick tip to everyone on optimizing code (as scripts can slow the game down).

The magekiller script has the following code fragment (UBB forces me to use ~ to represent space indentations):


randtarg = get_ran(1,0,1);
if (randtarg == 0) {
~~~if (char_with_highest_skill(11) >= 0) {
~~~~~~caster = char_with_highest_skill(11);
~~~} else {
~~~~~~caster = char_with_highest_skill(12);
~~~}
}

if (randtarg > 0) {
~~~if (char_with_highest_skill(12) >= 0) {
~~~~~~caster = char_with_highest_skill(12);
~~~} else {
~~~~~~caster = char_with_highest_skill(11);
~~~}
}


This is a lot of branch checking, which can be expensive (especially on Pentiums). Moreover, the second if group looks almost like the first, just with different numbers. Using a little mathematics, you can collapse this to a single if-else statement.


randtarg = get_ran(1,0,1);
if (char_with_highest_skill(11 + rantarg) >= 0) {
~~~caster = char_with_highest_skill(11 + rantarg);
} else {
~~~rantarg = 1 - rantarg;
~~~caster = char_with_highest_skill(11 + rantarg);
}


Of course, some people may find this a little harder to read (which is a legitimate concern if we are sharing scripts). However, it is more efficient.

Edit: And if you really want it tigher, you can edit it down to this.


randtarg = get_ran(1,0,1);
if (char_with_highest_skill(11 + rantarg) < 0) {
~~~rantarg = 1 - rantarg;
}
caster = char_with_highest_skill(11 + rantarg);


[ Thursday, March 25, 2004 17:01: Message edited by: Walker White ]
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Disappointments in the editor in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #2
There probably should be a movement to add some improvements to the editor -- but let's wait until Jeff most of the bugs out of the main program first.

Personally, I want a tool that allows me to click on a square and tell me the x,y coordinates of that square. Relying on this "center square" stuff is annoying.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Disappointments in the editor in Blades of Avernum
Apprentice
Member # 4127
Profile #2
There probably should be a movement to add some improvements to the editor -- but let's wait until Jeff most of the bugs out of the main program first.

Personally, I want a tool that allows me to click on a square and tell me the x,y coordinates of that square. Relying on this "center square" stuff is annoying.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Article - Tips for Creating Challenging Monsters in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #7
quote:
Originally written by Captain Uglyhead:

Would there be any way to tie one monster's effectiveness to another monster?

Say you've got this huge, beefed-up magical bodyguard critter that protects a physically frail spellcaster. Would there be any way to suddenly cripple such bodyguard creature(s) if the spellcaster is killed before they are? (the spellcaster is the source of their power- would be explained in plot/dialogue)

That can be done with messaging capabilities, but you have to make a script for each. In the DEAD_STATE of the spellcaster, just send a message to the bodyguard, calling a state that drops the bodyguard's stats.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Article - Tips for Creating Challenging Monsters in Blades of Avernum
Apprentice
Member # 4127
Profile #7
quote:
Originally written by Captain Uglyhead:

Would there be any way to tie one monster's effectiveness to another monster?

Say you've got this huge, beefed-up magical bodyguard critter that protects a physically frail spellcaster. Would there be any way to suddenly cripple such bodyguard creature(s) if the spellcaster is killed before they are? (the spellcaster is the source of their power- would be explained in plot/dialogue)

That can be done with messaging capabilities, but you have to make a script for each. In the DEAD_STATE of the spellcaster, just send a message to the bodyguard, calling a state that drops the bodyguard's stats.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #11
Ah. Much Better.

That is what I really wanted to do. Now my phase spiders teleport for real. They get in a hit, and if you manage to hit them back, they teleport to safety. In fact, I used memory cells to define a lot of "safety locations" so that you can have them teleporting all over the place.

To fight it out with the spiders, try this one room scenario. Programmers might also want to look at the room to see how I use the memory cells.

If you are just interested in the script , here is the source code. For intermediate/low-level programmers, note how I used a lot of different states for combat. There is a defensive webbing state, and a melee attack state. I also have transition states for moving between the two using set_state_continue().
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum
Apprentice
Member # 4127
Profile #11
Ah. Much Better.

That is what I really wanted to do. Now my phase spiders teleport for real. They get in a hit, and if you manage to hit them back, they teleport to safety. In fact, I used memory cells to define a lot of "safety locations" so that you can have them teleporting all over the place.

To fight it out with the spiders, try this one room scenario. Programmers might also want to look at the room to see how I use the memory cells.

If you are just interested in the script , here is the source code. For intermediate/low-level programmers, note how I used a lot of different states for combat. There is a defensive webbing state, and a melee attack state. I also have transition states for moving between the two using set_state_continue().
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #9
quote:
Originally written by Drakefyre:

In that magekiller script, monsters will target characters based on spell-level, which is a more simplistic way of going about it and doesn't take much more into account, but it's still great to have.
That's one way to do it, but for such scripts, we should ideally make them as general as possible. Use memory cells to customize priorities such as mage spells, priest spells, missile fire or melee skill. That way, script-shy people can just customize the memory-cell values.

At least that is what my next project is.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum
Apprentice
Member # 4127
Profile #9
quote:
Originally written by Drakefyre:

In that magekiller script, monsters will target characters based on spell-level, which is a more simplistic way of going about it and doesn't take much more into account, but it's still great to have.
That's one way to do it, but for such scripts, we should ideally make them as general as possible. Use memory cells to customize priorities such as mage spells, priest spells, missile fire or melee skill. That way, script-shy people can just customize the memory-cell values.

At least that is what my next project is.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #8
quote:
Originally written by *i:

Actually you can indeed move monsters around and simulate teleportation. Look at the cutscene calls.
Ah. That would be the relocate_character() call. Missed that; thanks. Will put out v1.1 of the Phase Spider later to fix that.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum
Apprentice
Member # 4127
Profile #8
quote:
Originally written by *i:

Actually you can indeed move monsters around and simulate teleportation. Look at the cutscene calls.
Ah. That would be the relocate_character() call. Missed that; thanks. Will put out v1.1 of the Phase Spider later to fix that.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #2
quote:
Originally written by Boots:

EDIT: Of course, now that I actually read your entire post, I see that next week may deliver just this. Sorry.
Actually, I was planning to show how to intelligently assess combatant abilities so that archers don't waste time on the fighters (which select_target() usually returns) when they clearly should be killing the ice lance mage. Or the fighter healing cleric.

However, I will see about addressing your concern.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum
Apprentice
Member # 4127
Profile #2
quote:
Originally written by Boots:

EDIT: Of course, now that I actually read your entire post, I see that next week may deliver just this. Sorry.
Actually, I was planning to show how to intelligently assess combatant abilities so that archers don't waste time on the fighters (which select_target() usually returns) when they clearly should be killing the ice lance mage. Or the fighter healing cleric.

However, I will see about addressing your concern.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #0
I am way too busy to ever finish a scenario. I would like to believe otherwise, but BoE taught me the reality (and I had a lot of free time then).

But I can whip out some pretty cool monster scripts quickly. And since some people might be overwhelmed by the scripting language, I thought that I would make some of my ideas freely available as a public service -- and to have my ideas see the light of day. Feel free to use these in your scenario, as long as my name remains in the credits in the script header.

I have a few ideas for some monsters and hope to post one a week. The first one is a monster that I desparately wanted to do in BoE: the phase spider. Unfortunately, I could not do it for two reasons.
A monster cannot both web and be invisible.I could not control monster movement to make the spider teleport.Unfortunately, BoA does not allow me 1 or 2 either (you can select a destination for movement, but movement is controlled by the path-finding algorithms, and you cannot teleport non-player creatures) because of very legitimate design decisions on Jeff's part.
But that's okay, because with scripts I can fake it. For example, the spiders don't really teleport, I just use effects and cutscene calls to make it look like they do.

For those interested, download my arena and try them out. Completing this adventure will not increment your scenarios won or started, so you can experiment safely.

Phase Spider Example

Next week: Manual combat targetting for user-defined combat AI.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
Post yer monster scripts here in Blades of Avernum
Apprentice
Member # 4127
Profile #0
I am way too busy to ever finish a scenario. I would like to believe otherwise, but BoE taught me the reality (and I had a lot of free time then).

But I can whip out some pretty cool monster scripts quickly. And since some people might be overwhelmed by the scripting language, I thought that I would make some of my ideas freely available as a public service -- and to have my ideas see the light of day. Feel free to use these in your scenario, as long as my name remains in the credits in the script header.

I have a few ideas for some monsters and hope to post one a week. The first one is a monster that I desparately wanted to do in BoE: the phase spider. Unfortunately, I could not do it for two reasons.
A monster cannot both web and be invisible.I could not control monster movement to make the spider teleport.Unfortunately, BoA does not allow me 1 or 2 either (you can select a destination for movement, but movement is controlled by the path-finding algorithms, and you cannot teleport non-player creatures) because of very legitimate design decisions on Jeff's part.
But that's okay, because with scripts I can fake it. For example, the spiders don't really teleport, I just use effects and cutscene calls to make it look like they do.

For those interested, download my arena and try them out. Completing this adventure will not increment your scenarios won or started, so you can experiment safely.

Phase Spider Example

Next week: Manual combat targetting for user-defined combat AI.
Posts: 48 | Registered: Saturday, March 20 2004 08:00
When are scripts loaded? in Blades of Avernum Editor
Apprentice
Member # 4127
Profile #0
I have been playing around with modifying corescendata.txt in the Avernum files. The reason? In all of the Avernum series (1-3 and now Blades), I have never once seen a spider throw webs. Supposedly they have the ability (cr_special_abil = 5), but I have never, ever seen them use it.

Examining the scripts in corescendata.txt I suspect it is because they have the melee AI. So, I wanted to change the default spider behavior to archer/caster, which is what it was in the Exile series (and the reason why spider rooms were some of the most deadly encounters ever).

I changed the file and loaded a default game (in VoDT) where I was about to enter a spider room. Nothing happened. Spiders still run into melee, making them boring, flavorless monsters.

Now, I know the file is being loaded, because I misspelt cr_default_strategy the first time, and hence it would not process my saved game. After fixing the spelling mistake, the game loaded perfectly. But the changes did not register.

So, what's the issue here? Will script changes only load each time you start up a new scenario, with mid-scenario being ignored? Or can we not make global changes in corescendata.txt (Spiders need to be fixed, dammit)?
Posts: 48 | Registered: Saturday, March 20 2004 08:00
When are scripts loaded? in Blades of Avernum
Apprentice
Member # 4127
Profile #0
I have been playing around with modifying corescendata.txt in the Avernum files. The reason? In all of the Avernum series (1-3 and now Blades), I have never once seen a spider throw webs. Supposedly they have the ability (cr_special_abil = 5), but I have never, ever seen them use it.

Examining the scripts in corescendata.txt I suspect it is because they have the melee AI. So, I wanted to change the default spider behavior to archer/caster, which is what it was in the Exile series (and the reason why spider rooms were some of the most deadly encounters ever).

I changed the file and loaded a default game (in VoDT) where I was about to enter a spider room. Nothing happened. Spiders still run into melee, making them boring, flavorless monsters.

Now, I know the file is being loaded, because I misspelt cr_default_strategy the first time, and hence it would not process my saved game. After fixing the spelling mistake, the game loaded perfectly. But the changes did not register.

So, what's the issue here? Will script changes only load each time you start up a new scenario, with mid-scenario being ignored? Or can we not make global changes in corescendata.txt (Spiders need to be fixed, dammit)?
Posts: 48 | Registered: Saturday, March 20 2004 08:00

Pages