Profile for Xoid

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
It's the A2Template! in Blades of Avernum
Shock Trooper
Member # 932
Profile #16
quote:
Originally written by Thralni, emperor of Riverrod:

Are you also going to reconstruct the towns, do you think, or will that be to much work?
Not a chance in hell of reconstructing all of them. Major towns, (The Castle, Tower of Magi, etc.) are a strong possibility. Primarily dependant on whether others already have, or failing that, I might decide to include it under a second scenario file like I'm (inevitably) going to do with the Vahnatai's lands.

Incidentally, just past Dharmon and the front lines is a section you can never get into - reconstructing this from Avernum 1 would be a highly subjective measure. Fort Spire (or it's ruins would be here. I know for a fact that Jeff never had a full section here - just enough so that can see mostly into it. However - there are two overlooked spots that a very observant person can see the road ends abruptly into this section - one from the Scree Pits (easy to notice), and one from the section Erika's Tower is in (very difficult...) - so things may not line up exactly.

After going through Avernum 1 and investigating that section it is obvious that it will not properly fit into there. I am considering reconstructing this section and simply trimming some squares (approximately 5 to 8 would need to be) from the left edge. From a cursory inspection only a few minor side passages would be lost. Doing that section (Fort Spire's if you've already forgotten) will be a true *****.

(Insert proper name for a female dog, as in I'm putting my b... out to stud, where the astericks are. Funnily enough, I do actually breed labradors. If I ever post about it I'm going to inadvertantly be censored by this infernal bulletin board.)

I'm likely to end up doing it if even a couple of people show interest in my doing so.

Also, I am aware of how to use an email client. And of course I'm going to compress it - regardless of how small it is my connection is slow - even a quarter meg seems to take millenia. (Sorry if all that reads like a snarky comment - I'm grumpy and tired.)

I was merely unable to reconcile what to do if people pop up out of the woodworks, so to speak, and ask for a copy after I've already sent the email off. I'd prefer not to be constantly sending out mass emails if I can - so I'd prefer to keep the "beta" testing group relatively small.

God, can I even call it a beta testing group really? It's not like it's an effort worthy of the name - merely reconstructing someone else's work. For the most part anyway. Might it more appropriately be called: 'poor batch of saps I've conned into bug testing the evidence that I lack a real life'?

G'night people. I'm going to sleep.

[ Thursday, September 15, 2005 22:49: Message edited by: CPeters ]

--------------------
Microsoft Patents Ones, Zeroes (March 25, 1998)
"Asians are good at Starcraft because they're always squinting, thus they can see things sharply. Remember to always squint in war." ~ Sun-Tzu
Posts: 215 | Registered: Sunday, April 7 2002 08:00
It's the A2Template! in Blades of Avernum Editor
Shock Trooper
Member # 932
Profile #12
Considering that none of you are mind (can't believe I added a 'not', even after the fifth revision of this post, note to self: stop editing my posts, and stop writing posts late at night.) readers I should have made myself clear - sorry about that. The original post was simply to gauge interest in the finished product. I will release it to the public when I'm done recreating the terrain.

Whilst I'm on the topic of when I'll have it done: I've currently got about 4/7 of Avernum done, performing clean up on some sections and should be starting on the section containing the Tower of Elderan in 2 days at most.

I'm actually unsure of the logistics when it comes to emailing a fair sized attachment over my god-awful and slow modem - so I'm not going to send it to more than a dozen at most for the beta stage.

I should have the scenario (terrain only) ready for criticism in a week and a half, two at tops.

[ Thursday, September 15, 2005 06:39: Message edited by: CPeters ]

--------------------
Microsoft Patents Ones, Zeroes (March 25, 1998)
"Asians are good at Starcraft because they're always squinting, thus they can see things sharply. Remember to always squint in war." ~ Sun-Tzu
Posts: 215 | Registered: Sunday, April 7 2002 08:00
It's the A2Template! in Blades of Avernum
Shock Trooper
Member # 932
Profile #12
Considering that none of you are mind (can't believe I added a 'not', even after the fifth revision of this post, note to self: stop editing my posts, and stop writing posts late at night.) readers I should have made myself clear - sorry about that. The original post was simply to gauge interest in the finished product. I will release it to the public when I'm done recreating the terrain.

Whilst I'm on the topic of when I'll have it done: I've currently got about 4/7 of Avernum done, performing clean up on some sections and should be starting on the section containing the Tower of Elderan in 2 days at most.

I'm actually unsure of the logistics when it comes to emailing a fair sized attachment over my god-awful and slow modem - so I'm not going to send it to more than a dozen at most for the beta stage.

I should have the scenario (terrain only) ready for criticism in a week and a half, two at tops.

[ Thursday, September 15, 2005 06:39: Message edited by: CPeters ]

--------------------
Microsoft Patents Ones, Zeroes (March 25, 1998)
"Asians are good at Starcraft because they're always squinting, thus they can see things sharply. Remember to always squint in war." ~ Sun-Tzu
Posts: 215 | Registered: Sunday, April 7 2002 08:00
It's the A2Template! in Blades of Avernum Editor
Shock Trooper
Member # 932
Profile #9
Got another trio of sections from around the center of Avernum done ontop of whatever else.

@ Drakefyre: Yes, my scenario only fills about 10 sections, but I needed to tack on another two or so sections to prevent the appearence of the world suddenly ending. Got kind of carried away doing that done more than I needed to and figure I might as well finish the job. At a rate of 2-3 sections a day, shouldn't take too long to finish up the entirety of Avernum 2's terrain.

@ Archmagus Micael: Didn't think about the Vahnatai. I'll finish up on this [Avernum proper] then most likely end up doing the Vahnatai's lands as well. Damn you for stirring another plot line idea in my head - even If I never get around to making a proper scenario set in the Vahnatai's land, I'm still gonna end up making the terrain for their lands so I at least have the possibility of doing so at a later date.

[ Monday, September 12, 2005 03:13: Message edited by: CPeters ]

--------------------
Microsoft Patents Ones, Zeroes (March 25, 1998)
"Asians are good at Starcraft because they're always squinting, thus they can see things sharply. Remember to always squint in war." ~ Sun-Tzu
Posts: 215 | Registered: Sunday, April 7 2002 08:00
It's the A2Template! in Blades of Avernum
Shock Trooper
Member # 932
Profile #9
Got another trio of sections from around the center of Avernum done ontop of whatever else.

@ Drakefyre: Yes, my scenario only fills about 10 sections, but I needed to tack on another two or so sections to prevent the appearence of the world suddenly ending. Got kind of carried away doing that done more than I needed to and figure I might as well finish the job. At a rate of 2-3 sections a day, shouldn't take too long to finish up the entirety of Avernum 2's terrain.

@ Archmagus Micael: Didn't think about the Vahnatai. I'll finish up on this [Avernum proper] then most likely end up doing the Vahnatai's lands as well. Damn you for stirring another plot line idea in my head - even If I never get around to making a proper scenario set in the Vahnatai's land, I'm still gonna end up making the terrain for their lands so I at least have the possibility of doing so at a later date.

[ Monday, September 12, 2005 03:13: Message edited by: CPeters ]

--------------------
Microsoft Patents Ones, Zeroes (March 25, 1998)
"Asians are good at Starcraft because they're always squinting, thus they can see things sharply. Remember to always squint in war." ~ Sun-Tzu
Posts: 215 | Registered: Sunday, April 7 2002 08:00
It's the A2Template! in Blades of Avernum Editor
Shock Trooper
Member # 932
Profile #0
EDIT: Critique this, now. I command you.

---

I'm making a scenario that is set inbetween Avernum 2 and 3, taking place (roughly) from Angierach to Almaria. While it is debatable whether the scenario will see light of day. (Yes, it is somewhat large, but I have oodles of time to waste, so that is not the concern...) Regardless, the terrain for these areas is still done.

I've got roughly 15~16 of the 49 sections of Avernum 2 recreated, and was wondering if anyone would actually like me post the scenario, before/after I start making towns. (I will not include any NPCS, special encounters, etc.)

I primarily envisage people using it as a template for scenarios taking place around that area/time.

Note(s): There are subtle differences between Avernum 2's wall configuration and the ones I use - I altered the wall configuration in a few areas so that there was no 'clipping'. Area descriptions also more closely follow the 'contours' of the object they surround now. There are NO terrain #255 "solid stone" and #71 "pit" mixups like in Avernum 2.

(What is he talking about, you ask? Ensure you have the Orb of Thralni for most of these, you can walk through the walls in some places... Check out Angierach, the 2x1 pit to the right of Kothtar, and the secret passage past the Lair of Sulfras - where the Jade Halberd is. Sloppy, sloppy, Spiderweb.)

Apart from that, I have differed from less than 20 squares of the 2304 squares per section.

[ Wednesday, December 28, 2005 13:35: Message edited by: CPeters ]
Posts: 215 | Registered: Sunday, April 7 2002 08:00
It's the A2Template! in Blades of Avernum
Shock Trooper
Member # 932
Profile #0
EDIT: Critique this, now. I command you.

---

I'm making a scenario that is set inbetween Avernum 2 and 3, taking place (roughly) from Angierach to Almaria. While it is debatable whether the scenario will see light of day. (Yes, it is somewhat large, but I have oodles of time to waste, so that is not the concern...) Regardless, the terrain for these areas is still done.

I've got roughly 15~16 of the 49 sections of Avernum 2 recreated, and was wondering if anyone would actually like me post the scenario, before/after I start making towns. (I will not include any NPCS, special encounters, etc.)

I primarily envisage people using it as a template for scenarios taking place around that area/time.

Note(s): There are subtle differences between Avernum 2's wall configuration and the ones I use - I altered the wall configuration in a few areas so that there was no 'clipping'. Area descriptions also more closely follow the 'contours' of the object they surround now. There are NO terrain #255 "solid stone" and #71 "pit" mixups like in Avernum 2.

(What is he talking about, you ask? Ensure you have the Orb of Thralni for most of these, you can walk through the walls in some places... Check out Angierach, the 2x1 pit to the right of Kothtar, and the secret passage past the Lair of Sulfras - where the Jade Halberd is. Sloppy, sloppy, Spiderweb.)

Apart from that, I have differed from less than 20 squares of the 2304 squares per section.

[ Wednesday, December 28, 2005 13:35: Message edited by: CPeters ]
Posts: 215 | Registered: Sunday, April 7 2002 08:00
My thoughts on hex editing and keygens... in General
Shock Trooper
Member # 932
Profile #0
Before reading the post, please take these two things into consideration:

1) I have paid for every Spiderweb Software game that I've played past the demo section of. Actually, I've paid for every game I've played the full version of.
2) I do not condone using cracks, hacks, serials, etc, to defraud ANYBODY, even Micro$oft.

After reading the Code of Conduct I was somewhat annoyed to have discovered that discussion of hex editing was listed under infractions. I often use a hex editor to re-register my copy of Avernum 1-3 after I finish formating my computer for the billionth time. I find that it is simply a matter of convenience to hex edit a particular file, so that I can re-register my game without needing to email Jeff & Co. for a billionth time.

Considering the fact that there is probably at least one other person who has purchased one of the Avernum series, who then formats their computer, WITHOUT backing up the necessary file due to momentary lapses, or the fact that their A drive is always on the blink, they don't have a CD burner, can't afford a memory stick, etc to store it on, I thought that writing a small tutorial on how to re-register the game you already own would save Spiderweb some effort of checking personal details and emailing out registration keys.

[If I didn't use my method, or a keygen, spiderweb would have been emailing me a new code nearly every second month for the last three years - something I'm sure they'd not appreciate.]

Admittedly, I'm likely breaching the EULA by 'reverse-engineering' or somesuch, but I really don't see an issue with what I do: I've already paid for the game, the code is NOT one that has to be unique for every user (unlike CD Keys for Starcraft, for instance) so using hex editing to re-use my old key isn't affecting anyone. Using a keygen falls under the same banner as far as I'm concerned.

Whilst I can understand that giving information out on how to find a keygenerator is crossing the line, I'm wondering... Would providing a tutorial on Hex Editing four bytes of data to re-register a game you've already paid for would also be crossing that line?

Certainly - one could trawl Usenet to find a registration code and its subsequent key, and defraud Spiderweb using the tutorial I was planning to write, but anyone who could do that is undoubtedly capable of finding and downloading a keygen to do the same.

I'm curious to other's thoughts on this, nevertheless, until the Code of Conduct changes the half finished tutorial is staying that way.

[ Monday, August 15, 2005 23:35: Message edited by: CPeters ]

--------------------
Microsoft Patents Ones, Zeroes (March 25, 1998)
"Asians are good at Starcraft because they're always squinting, thus they can see things sharply. Remember to always squint in war." ~ Sun-Tzu's The Fart of War
Posts: 215 | Registered: Sunday, April 7 2002 08:00
Avernum 2 - Empire Caches in The Avernum Trilogy
Shock Trooper
Member # 932
Profile #0
Does any one know the SDFs and what they need to be set to for the Empire's supply caches? I've already found four of them, and I'm fairly certain that there were only four, yet the Scimitar operatives near Fort Dranlon(sp?) don't recognise that I've found them all.

Summary: If my memory is off, and there are more than four caches, please tell me. If there are only four caches, I would like the SDFs and what they need to be set to for that quest.

EDIT: Damn I feel like an idiot, found the fifth. And to think I used to know Avernum 2 inside out... *sigh*

[ Tuesday, August 16, 2005 04:40: Message edited by: CPeters ]
Posts: 215 | Registered: Sunday, April 7 2002 08:00
Graphics Question in Blades of Avernum Editor
Shock Trooper
Member # 932
Profile #7
This is pretty much most of the email I sent Brett on this. FYI I'm the culprit responsible for the graphic that raised this issue.

quote:
You theoretically could have the 16x16 icons required for both terrain and floors (there is a difference in the two terms here. "Terrain" is basically layed on top of "Floors". This is the terminology used in the actual script for each scenario. "valleydydata.txt", from VoDT, has enough examples of this. The glowing portcullis is "terrain". The slimy floors are "floors".)

Using DwtD as an example, sheet #501 is only 5 cells wide. Since BoA dosen't chuck a hissy fit about this I'm assuming that any graphics sheet can be less than the 10 cells required as is actually written in the documentation. (Either this or Jeff made a boo-boo when porting to windows...)

If you can find a width for the image, which is both divisible by the width of an icon (the 16x16 ones are what I'm referring to here.) - including the border, that was also divisible by the width of a 46x55 cell - including the border, and also find a height that would make it seem like a sheet usable for both the 16x16 icons and the 46x55 cells then - and only then - could it work.

I am assuming here that Jeff has some kind of verification for the graphic's size. Using the above rules you would religiously stick to BoA's so called "requirements". In practice (on a windows version at least...) you can have any width and height - as long as you never ask BoA to use a graphic from it that is larger than the physical dimensions.

In plain english? As long as the graphic is at least 48x57 (border already included) and you position your 18x18 icons (border included) in the correct place - it will work. I have tested this on windows, cannot verify on others. Jeff should really have put validation routines on the graphical input side of things.

In the case of it being too far above your head or I wrote something that will only ever make sense to me... I have attached a zip file with a scenario to demonstrate. I have also included a *.gif to show you what I meant, the *.gif should be converted to a *.bmp or *.pict (I think, I'm not sure of *anything* when it comes to Macs...). If you are using a PC then open the *.gif in MS Paint, save as an 8 Bit or 24 Bit *.bmp and rename to "G500.bmp". If using a Mac, put it in a resource ala Jeff's instructions in the editor's docs, not having a mac I can't do this for you.

If it does work as expected, Jeff didn't put any validation routines on graphic sheets apart from "does this sheet even exist". If the scenario doesn't work then the Mac version might be dodgy, or Jeff's port was less than perfect.
I do not have web space to host the scenario. Basically any scenario would do for testing. The only issue with the method I outlined is that if you are referencing a 46x55 cell that is that if your reference past the first "row", e.g. "te_which_icon = 22", then that might (i.e. most likely will) cause problems.

So apart from the first row of 46x55 cells, the rest of the sheet would have to consist of the 16x16 icons, or vice versa. Might save space in rare circumstances when someone is using a 16 Bit image or higher, or if the icon sheet would only consist of 1 icon otherwise.

I'm not too sure if this makes sense without a drawn example. Since I can't host the scenario, unless someone is willing to, we'll have to wait for Brett to test it - because I'm not going to spend all day emailing it out if you'd feel like being my guinea pig.

Keep in mind, if this does not work on a Mac, then in the unlikely situation that your graphic would meet the obscure requirements needed to save space - enough to make stuffing around like this actually worth it - then the resulting graphic would only be useful on a PC.
Posts: 215 | Registered: Sunday, April 7 2002 08:00
Graphics Question in Blades of Avernum
Shock Trooper
Member # 932
Profile #7
This is pretty much most of the email I sent Brett on this. FYI I'm the culprit responsible for the graphic that raised this issue.

quote:
You theoretically could have the 16x16 icons required for both terrain and floors (there is a difference in the two terms here. "Terrain" is basically layed on top of "Floors". This is the terminology used in the actual script for each scenario. "valleydydata.txt", from VoDT, has enough examples of this. The glowing portcullis is "terrain". The slimy floors are "floors".)

Using DwtD as an example, sheet #501 is only 5 cells wide. Since BoA dosen't chuck a hissy fit about this I'm assuming that any graphics sheet can be less than the 10 cells required as is actually written in the documentation. (Either this or Jeff made a boo-boo when porting to windows...)

If you can find a width for the image, which is both divisible by the width of an icon (the 16x16 ones are what I'm referring to here.) - including the border, that was also divisible by the width of a 46x55 cell - including the border, and also find a height that would make it seem like a sheet usable for both the 16x16 icons and the 46x55 cells then - and only then - could it work.

I am assuming here that Jeff has some kind of verification for the graphic's size. Using the above rules you would religiously stick to BoA's so called "requirements". In practice (on a windows version at least...) you can have any width and height - as long as you never ask BoA to use a graphic from it that is larger than the physical dimensions.

In plain english? As long as the graphic is at least 48x57 (border already included) and you position your 18x18 icons (border included) in the correct place - it will work. I have tested this on windows, cannot verify on others. Jeff should really have put validation routines on the graphical input side of things.

In the case of it being too far above your head or I wrote something that will only ever make sense to me... I have attached a zip file with a scenario to demonstrate. I have also included a *.gif to show you what I meant, the *.gif should be converted to a *.bmp or *.pict (I think, I'm not sure of *anything* when it comes to Macs...). If you are using a PC then open the *.gif in MS Paint, save as an 8 Bit or 24 Bit *.bmp and rename to "G500.bmp". If using a Mac, put it in a resource ala Jeff's instructions in the editor's docs, not having a mac I can't do this for you.

If it does work as expected, Jeff didn't put any validation routines on graphic sheets apart from "does this sheet even exist". If the scenario doesn't work then the Mac version might be dodgy, or Jeff's port was less than perfect.
I do not have web space to host the scenario. Basically any scenario would do for testing. The only issue with the method I outlined is that if you are referencing a 46x55 cell that is that if your reference past the first "row", e.g. "te_which_icon = 22", then that might (i.e. most likely will) cause problems.

So apart from the first row of 46x55 cells, the rest of the sheet would have to consist of the 16x16 icons, or vice versa. Might save space in rare circumstances when someone is using a 16 Bit image or higher, or if the icon sheet would only consist of 1 icon otherwise.

I'm not too sure if this makes sense without a drawn example. Since I can't host the scenario, unless someone is willing to, we'll have to wait for Brett to test it - because I'm not going to spend all day emailing it out if you'd feel like being my guinea pig.

Keep in mind, if this does not work on a Mac, then in the unlikely situation that your graphic would meet the obscure requirements needed to save space - enough to make stuffing around like this actually worth it - then the resulting graphic would only be useful on a PC.
Posts: 215 | Registered: Sunday, April 7 2002 08:00
Please Help Me Experienced Editors... in Blades of Avernum Editor
Shock Trooper
Member # 932
Profile #56
I'm fairly certain that unless you had them backup whatever graphic you wished to replace, then put the new one into the folder there is no way. I am talking from a Windows user perspective here, and I understand that there is far more that would need to be done for a Mac, enough so that there is little to no point in trying.

Apart from that I can't think of any other method to modify the default graphics. I could be wrong mind you.
Posts: 215 | Registered: Sunday, April 7 2002 08:00
Please Help Me Experienced Editors... in Blades of Avernum
Shock Trooper
Member # 932
Profile #56
I'm fairly certain that unless you had them backup whatever graphic you wished to replace, then put the new one into the folder there is no way. I am talking from a Windows user perspective here, and I understand that there is far more that would need to be done for a Mac, enough so that there is little to no point in trying.

Apart from that I can't think of any other method to modify the default graphics. I could be wrong mind you.
Posts: 215 | Registered: Sunday, April 7 2002 08:00
Possession & Rage Script in Blades of Avernum Editor
Shock Trooper
Member # 932
Profile #0
I've tested this, and it seems to work. If anyone would like to test it more thoroughly, comment on it, whatever, go ahead.

EDIT 1:
Oops. Forgot to check for party size... Shouldn't have been coding at 2am.
// rager.txt
//
// A relatively simple text. Creature attacks anything it hates
// nearby, and will occasionally "possess" someone.
//
// Memory Cells:
// Cell 0,1 - Stuff done flag.
// --------------------------------------------------------------
// If both 0, nothing. Otherwise when this is killed, set to 1.
// [Example: If cell 1 is 3 and cell 2 is 5, when creature
// is killed, sets SDF(3,5) to 1.]
// --------------------------------------------------------------
// Cell 2 - Dialogue node to start with if talked to.
// If left at 0, this character doesn't talk.
// --------------------------------------------------------------
// Cell 3 - Can possess?
// When possessing someone, the creature will become immobile,
// and charm it's last target every turn, unless it's target
// is dead OR the target is cured of their charmed status.
// If the party size is equal to 1, then possession will
// never happen. If using multiples of this script, let only
// one of them to do this.
// --------------------------------------------------------------
// <= 0 - False
// >= 1 - True
// --------------------------------------------------------------
// Cell 4 - Goes invulnerable while in possession of someone?
// Status will be set to invulnerable whilst in possession of
// a victim.
// --------------------------------------------------------------
// <= 0 - False
// >= 1 - True
// --------------------------------------------------------------
// Cell 5 - Can rage?
// Will be divinely touched when at 2/3 of full health, will
// continue to be touched every 5 turns with a 5 turn effect.
// [The reason being so that if the creature is healed that the
// rage can wear off over a few rounds. Yeah, just like in real
// life.]
// --------------------------------------------------------------
// <= 0 - False
// >= 1 - True
// --------------------------------------------------------------
// Cell 6 - Unused
// Cell 7 - Unused
// Cell 8 - Unused
// Cell 9 - Unused

begincreaturescript;

variables;

short last_rage; // For telling when the last rage was.
short last_update,last_target,last_possession;
short possession;

body;

beginstate INIT_STATE;
last_update = get_current_tick();
last_target = -1;
last_rage = get_current_tick();
last_possession = -1;
possession = -1;
break;

beginstate DEAD_STATE;
// Set the appropriate stuff done flag for this character being dead.
if ((get_memory_cell(0) != 0) || (get_memory_cell(1) != 0))
set_flag(get_memory_cell(0),get_memory_cell(1),1);
break;

beginstate START_STATE;
if (target_ok()) {
if (dist_to_char(get_target()) <= 16)
set_state(3);
else set_target(ME,-1);
}

// Look for a target, attack it if visible
if (select_target(ME,8,0)) {
do_attack();
set_state(3);
}

// Have I been hit? Strike back!
if (who_hit_me() >= 0) {
set_target(ME,who_hit_me());
do_attack();
set_state(3);
}
break;

beginstate 3; // Attack State
// If "can rage" is true, and we are below half our health
// and we have waited a decent amount of time THEN rage
if ((get_memory_cell(5) > 0) && (get_health(ME) < (get_max_health(ME) * 2) / 3) && (tick_difference(last_rage,get_current_tick()) >= 5)) {
print_named_str(ME,"enters a demonic rage!");

put_sparkles_on_char(ME,1,10);
run_animation_sound(48);
set_char_status(ME,16,5,1,0);
last_rage = get_current_tick();
}

// If we possessing something that fell over and died...
if ((possession == 1) && (char_ok(last_target) == FALSE)) {
// Remove invulnerablity if Cell 4 is a positive integer.
if (get_memory_cell(4) >= 1)
set_char_status(ME,4,-1,1,0);
last_target = -1;
// Reset last_possession so we wait at LEAST five ticks
// before attempting to possess again.
last_possession = get_current_tick();
possession = -1;
set_mobility(ME,1);
}

// If we aren't possessing something & our target is dead,
// then return to START_STATE.
if (target_ok() == FALSE)
set_state(START_STATE);

// Update possession if we are possessing someone, they are a
// living target, and at least 1 turn has passed since we last
// updated this phase.
if ((possession == 1) && (char_ok(last_target)) && (tick_difference(get_current_tick(),last_update) >= 1)) {
if (get_char_status(last_target,8) == 0) {
if (get_memory_cell(4) >= 1)
set_char_status(ME,4,-1,1,0);
set_target(ME,last_target);
last_target = -1;
last_possession = get_current_tick();
possession = -1;
set_mobility(ME,1);
}

else {
if (get_memory_cell(4) >= 1)
set_char_status(ME,4,1,1,0);
// We do NOT want to update the possession more than once
// per turn. Apart from that, it makes it difficult to
// turn off the charmed & invulnerability status.
set_char_status(last_target,8,1,1,0);
last_update = get_current_tick();
}
}

// If can possess is true, we haven't already possessed someone,
// we have waited a half decent amount of time & we get a < 50
// THEN possess our current target.
if ((get_memory_cell(3) >= 1) && (party_size() >= 2) && (possession == -1) && (get_ran(1,0,100) < 50) && (tick_difference(last_possession,get_current_tick()) >= 5)) {
print_named_str(get_target(),"is possessed!");

// Setup and play SFX + sound
put_sparkles_on_char(ME,10,10);
put_effect_on_char(get_target(),2,10,0);
run_animation_sound(7);

// Set creature invulnerable if Cell 4 is a positive integer.
if (get_memory_cell(4) >= 1)
set_char_status(ME,4,1,1,0);
set_char_status(get_target(),8,2,1,0);

last_update = get_current_tick();
last_target = get_target();
last_possession = get_current_tick();
possession = 1;
set_target(ME,-1);
set_mobility(ME,0);
}

do_attack();
break;

beginstate TALKING_STATE;
if (get_memory_cell(3) == 0) {
print_str("Talking: It doesn't respond.");
end();
}
begin_talk_mode(get_memory_cell(3));
break;


[ Tuesday, September 14, 2004 13:48: Message edited by: CPeters ]
Posts: 215 | Registered: Sunday, April 7 2002 08:00
Possession &amp; Rage Script in Blades of Avernum
Shock Trooper
Member # 932
Profile #0
I've tested this, and it seems to work. If anyone would like to test it more thoroughly, comment on it, whatever, go ahead.

EDIT 1:
Oops. Forgot to check for party size... Shouldn't have been coding at 2am.
// rager.txt
//
// A relatively simple text. Creature attacks anything it hates
// nearby, and will occasionally "possess" someone.
//
// Memory Cells:
// Cell 0,1 - Stuff done flag.
// --------------------------------------------------------------
// If both 0, nothing. Otherwise when this is killed, set to 1.
// [Example: If cell 1 is 3 and cell 2 is 5, when creature
// is killed, sets SDF(3,5) to 1.]
// --------------------------------------------------------------
// Cell 2 - Dialogue node to start with if talked to.
// If left at 0, this character doesn't talk.
// --------------------------------------------------------------
// Cell 3 - Can possess?
// When possessing someone, the creature will become immobile,
// and charm it's last target every turn, unless it's target
// is dead OR the target is cured of their charmed status.
// If the party size is equal to 1, then possession will
// never happen. If using multiples of this script, let only
// one of them to do this.
// --------------------------------------------------------------
// <= 0 - False
// >= 1 - True
// --------------------------------------------------------------
// Cell 4 - Goes invulnerable while in possession of someone?
// Status will be set to invulnerable whilst in possession of
// a victim.
// --------------------------------------------------------------
// <= 0 - False
// >= 1 - True
// --------------------------------------------------------------
// Cell 5 - Can rage?
// Will be divinely touched when at 2/3 of full health, will
// continue to be touched every 5 turns with a 5 turn effect.
// [The reason being so that if the creature is healed that the
// rage can wear off over a few rounds. Yeah, just like in real
// life.]
// --------------------------------------------------------------
// <= 0 - False
// >= 1 - True
// --------------------------------------------------------------
// Cell 6 - Unused
// Cell 7 - Unused
// Cell 8 - Unused
// Cell 9 - Unused

begincreaturescript;

variables;

short last_rage; // For telling when the last rage was.
short last_update,last_target,last_possession;
short possession;

body;

beginstate INIT_STATE;
last_update = get_current_tick();
last_target = -1;
last_rage = get_current_tick();
last_possession = -1;
possession = -1;
break;

beginstate DEAD_STATE;
// Set the appropriate stuff done flag for this character being dead.
if ((get_memory_cell(0) != 0) || (get_memory_cell(1) != 0))
set_flag(get_memory_cell(0),get_memory_cell(1),1);
break;

beginstate START_STATE;
if (target_ok()) {
if (dist_to_char(get_target()) <= 16)
set_state(3);
else set_target(ME,-1);
}

// Look for a target, attack it if visible
if (select_target(ME,8,0)) {
do_attack();
set_state(3);
}

// Have I been hit? Strike back!
if (who_hit_me() >= 0) {
set_target(ME,who_hit_me());
do_attack();
set_state(3);
}
break;

beginstate 3; // Attack State
// If "can rage" is true, and we are below half our health
// and we have waited a decent amount of time THEN rage
if ((get_memory_cell(5) > 0) && (get_health(ME) < (get_max_health(ME) * 2) / 3) && (tick_difference(last_rage,get_current_tick()) >= 5)) {
print_named_str(ME,"enters a demonic rage!");

put_sparkles_on_char(ME,1,10);
run_animation_sound(48);
set_char_status(ME,16,5,1,0);
last_rage = get_current_tick();
}

// If we possessing something that fell over and died...
if ((possession == 1) && (char_ok(last_target) == FALSE)) {
// Remove invulnerablity if Cell 4 is a positive integer.
if (get_memory_cell(4) >= 1)
set_char_status(ME,4,-1,1,0);
last_target = -1;
// Reset last_possession so we wait at LEAST five ticks
// before attempting to possess again.
last_possession = get_current_tick();
possession = -1;
set_mobility(ME,1);
}

// If we aren't possessing something & our target is dead,
// then return to START_STATE.
if (target_ok() == FALSE)
set_state(START_STATE);

// Update possession if we are possessing someone, they are a
// living target, and at least 1 turn has passed since we last
// updated this phase.
if ((possession == 1) && (char_ok(last_target)) && (tick_difference(get_current_tick(),last_update) >= 1)) {
if (get_char_status(last_target,8) == 0) {
if (get_memory_cell(4) >= 1)
set_char_status(ME,4,-1,1,0);
set_target(ME,last_target);
last_target = -1;
last_possession = get_current_tick();
possession = -1;
set_mobility(ME,1);
}

else {
if (get_memory_cell(4) >= 1)
set_char_status(ME,4,1,1,0);
// We do NOT want to update the possession more than once
// per turn. Apart from that, it makes it difficult to
// turn off the charmed & invulnerability status.
set_char_status(last_target,8,1,1,0);
last_update = get_current_tick();
}
}

// If can possess is true, we haven't already possessed someone,
// we have waited a half decent amount of time & we get a < 50
// THEN possess our current target.
if ((get_memory_cell(3) >= 1) && (party_size() >= 2) && (possession == -1) && (get_ran(1,0,100) < 50) && (tick_difference(last_possession,get_current_tick()) >= 5)) {
print_named_str(get_target(),"is possessed!");

// Setup and play SFX + sound
put_sparkles_on_char(ME,10,10);
put_effect_on_char(get_target(),2,10,0);
run_animation_sound(7);

// Set creature invulnerable if Cell 4 is a positive integer.
if (get_memory_cell(4) >= 1)
set_char_status(ME,4,1,1,0);
set_char_status(get_target(),8,2,1,0);

last_update = get_current_tick();
last_target = get_target();
last_possession = get_current_tick();
possession = 1;
set_target(ME,-1);
set_mobility(ME,0);
}

do_attack();
break;

beginstate TALKING_STATE;
if (get_memory_cell(3) == 0) {
print_str("Talking: It doesn't respond.");
end();
}
begin_talk_mode(get_memory_cell(3));
break;


[ Tuesday, September 14, 2004 13:48: Message edited by: CPeters ]
Posts: 215 | Registered: Sunday, April 7 2002 08:00

Pages