
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
baylor wrote:
> > Its easiest use would be in a scripted logic situation -- games where
> > the designer defines the options , but then gives the program some
> > ability to adapt their use. We'll be stuck with games like that for
> > quite some time yet....
>
> i actually got the idea when looking at Baldur's Gate's AI where the
> script looks something like
>
> IF
> seeEnemy()
> THEN
> #75
> castSpell(fireball)
> #25
> castSpell(lightning)
> END IF
>
> which means 75% of the time cast fireball, 25% cast lightning. i like
> this approach much more than the enemy that always casts the exact
> same spell but it requires the designer to hard code these
> percentages, and that i didn't care for
>
> -b
I would ask - how many monsters/unit types did they have to programs
(if many then I figure they were busy getting all of them programmed...)
How many spells are available to units (attack spells that would be
appropriate for
it -- acolytes dont cast Death Hurricane or End of World spells...)
If lots more, then its kind of skimpy option-wise. If only a few spells
available and they
match the units flavor( this is for a 'Fire-Mage' ...) , then I could
understand...
How many units in game and how old is it (is there enuf mem to give each
unit
customization data to stick your statistic stuff into(or something more
than that dataless
code example)) maybe even not enuf for significantly larger scripts (or
performance
problems with larger (richer) scripts)
Alot of these games also leave the strategy to the player who have to match
the
proper unit flavor as a counter to the oponents flavor mix.
Did any other units have more versatile script - like some arch-mage who
has
more versatile attacks (and maybe even filters to use them appropriately)
Actually the script is readable (years ago, I played with Redneck
Rampage's script which
took quite a bit of decyphering to figure out)
found one on my old laptops HD image :
//====== ====== ======== ========= ==== ===== ======
// The pig
// By Arthur Attila Donavan
action APIGATTACK 0 6 1 1 10
action APIGWALK 7 6 5 1 5
action APIGRUN 7 6 5 1 2
action APIGEAT 38 5 5 1 20
action APIGLOOKUP 58 2 5 1 10
action APIGLOOKDN 63 2 5 -1 10
action APIGMESSEDUP 22 4 1 1 10
move PIGWALKVEL 40
move PIGRUNVEL 80
move PIGSTOP
ai AIPIGWALK APIGWALK PIGWALKVEL randomangle geth
ai AIPIGRUN APIGRUN PIGRUNVEL randomangle geth
ai AIPIGHUNT APIGWALK PIGRUNVEL faceplayersmart // Pigs are smart
ai AIPIGATTACK APIGATTACK PIGSTOP faceplayer
ai AIPIGEAT APIGEAT PIGSTOP
ai AIPIGLOOKUP APIGLOOKUP PIGSTOP
ai AIPIGLOOKDN APIGLOOKDN PIGSTOP
actor PIGSTAYPUT PIGSTRENGTH ai AIPIGEAT sizeat 16 16 cactor PIG enda
actor PIGEAT PIGSTRENGTH ai AIPIGEAT cactor PIG enda
// Main code for pig.
useractor enemy PIG PIGSTRENGTH
fall
ifai 0
{
cstator 257
ai AIPIGEAT
}
ifpdistl 8192
{
ifrnd 1
sound PIGSOUND4
}
ifai AIPIGWALK
{
// Pig walking
ifactioncount 34
ifrnd 32
{
ai AIPIGLOOKDN
resetactioncount
soundonce PIGSOUND3
}
}
else ifai AIPIGEAT
{
// Pig eating
ifactioncount 40
ifrnd 8
{
ai AIPIGLOOKUP
resetactioncount
soundonce PIGSOUND4
}
}
else ifai AIPIGLOOKUP
{
// Pig looking up
ifactioncount 2
{
ai AIPIGWALK
ifrnd 16
soundonce PIGSOUND3
}
}
else ifai AIPIGLOOKDN
{
// Pig looking down
ifactioncount 2
{
ai AIPIGEAT
ifrnd 16
soundonce PIGSOUND3
}
}
else ifai AIPIGHUNT
{
// Pig hunting for player
ifcansee
{
ifpdistl 1024
{
ai AIPIGATTACK
}
}
else
ifrnd 4
ai AIPIGWALK
}
else ifai AIPIGATTACK
{
// Pig attacking player
ifp palive
{
ifpdistl 1096
{
ifrnd 8
{
addphealth PIG_GNAW_AMOUNT
state lnsndpain
}
ifrnd 128
soundonce PIGSOUND6
else
soundonce PIGSOUND7
}
else
ai AIPIGHUNT
}
else
ai AIPIGWALK
}
ifrnd 1
ifrnd 128
sound PIGSOUND3
ifhitweapon
{
spawn BLOOD
ifdead
{
move PIGSTOP
addkills 1
// sound SQUISHED
sound PIGSOUND5
guts JIBS2 1
guts JIBS3 2
guts JIBS4 3
guts JIBS5 2
guts JIBS6 3
killit
}
else
{
ifrnd 128
soundonce PIGSOUND1
else
soundonce PIGSOUND2
/*
// You made the pig angry, and he is going to hunt you down
// But first make 'em laugh
ifrnd 64
sound FART1
else ifrnd 64
sound FART2
else ifrnd 64
sound FART3
else ifrnd 64
sound FART4
*/
ai AIPIGHUNT
}
}
enda
| <-- __Chronological__ --> | <-- __Thread__ --> |
Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.