A blow to the head will make you forget things like that.
Might be worth it to start up a re-indentification service if that were implemented.
Latest posts made by luteijn
-
RE: New Loot system/information on looting equipment
-
RE: Summon Creature Discussion (Ideas for Single Player version)
Abby's explanation makes sense, but I understood the original post to mean to use the ideas to re-implement the system, so the exact details of the specific CoA implementation would not really be needed.
-
RE: Polymorph Self
well, there's only a very limited number of quickslots, so I'd probably not want to waste them on things you can type in quickly, like ".ps 132!"; but rather use them for things tht you'd have to click through a few layers of menu for to access..
(oh another feature could be having .ps ! just cast the spell with whatever is the current polymorph target.)
-
RE: Polymorph Self
if you're finding yourself typing the same code twice, you're not using functions enough, (or down to unrolling loops and inlining functions by hand because your compiler can't do it for you :) )
-
RE: Polymorph Self
We can check for those two and default to some neutral form.
yes, you do have to do some checking of the validity of the stored state just before blindly using it, as it might be corrupted, not initialised etc. so that you know that if it's not what you expect it to be, you won't crash your plane or do something really unexpected, but some more or less harmless default instead. You (should) do this for digital circuits in hardware, it makes sense to do it for software too.
Anyway, if the state is already an integer instead of a string, your state-space is smaller, and also you can use a 'switch' instead of a big 'if-then-else'. I don't know if the 'switch' is compiled to anything different than the 'if-then-else', even if it isn't, a 'switch' is easier to read, especially if you have a few simple checks in advance to make sure the integer is between 0 and some MAX_POLY_ID constant you'd set up, and use fall through for ranges of invalid/undefined IDs.
Normally it's also a lot cheaper to use an integer as an index into a jump table (switch) than to repeatedly compare values until you find a match (if-tree).The conversion function is going to be rather a lot of work to type in, as you can't just use a hash table, or even iterate over an array, so I hope you're (or will be) using a program to generate the script text from the plain list of IDs and their Strings, so it's easier to change your mind on how to exactly implement/streamline the conversion function without having to do a lot of re-typing.
-
RE: Polymorph Self
I still think you want to make sure the value set is valid at the time it is being set or the caster will get a nasty surprise when polymorphing in the heat of battle, and by then any feedback wouldn't be as useful anymore
You can keep the player chat 'clean' (although according to other posts it is already pretty messy: /forum/viewtopic.php?t=107485&start=3 ) the way set kept the wildshape one clean, just call a worker script (or if the compiler/preprocessor being used allows it, use an include file.)
-
RE: Polymorph Self
What about converting to the poly-number and the HD-needed for it right away when the ".ps WhatEver" is given, and storing those two numbers instead of the string? As you'd usually set your favorite form and then stick to that, it would save a lot of repeated conversions at casting time, and you could e.g. catch a typo in '.ps BAISLISK' before you try and cast the spell, or tell the player it won't work for some other reason. (like insufficient HD) You'd just have to do a quick double check if the player is allowed to use that shape at casting time.
Also, why not just convert the string to uppercase once at the start of the conversion block, and store the result in sFormID:
string sFormID = GetStringUpperCase(GetLocalString(OBJECT_SELF, "sPolyFormID"));
Saves you doing the same conversion over and over again and makes the if statements more readable.
The conversion code could also just compare as many characters as are actually in the argument given, and pick the first match, so you wouldn't have to type out the whole word, just a unique enough prefix (and add some 'aliases' for commonly misspelled names, and things like "Green Dragon Wyrmling" with the most significant bit first..)
Actually you could even just publish a list of the Poly numbers and let people do their own conversions , as it's easier to memorize/refer to a note for your favorite few integers than typing in all those words all the time (this is used by casters that likely don't have many quickslots free…), I'd prefer typing .ps 231 over .ps WYRMLING GOLD DRAGON
I think TestStringAgainstPattern("*n",sFormID) can be used to detect if the sFormID is already a number and try to use it as is.
--
Note that you actually did miss-spell BASILISK in the script. (and at least INTELLECT DEVOURER too.)