Jump to content


Photo

Help needed on a dragon script


  • Please log in to reply
6 replies to this topic

#1 Radagast-The-Brown

Radagast-The-Brown
  • Member
  • 252 posts

Posted 11 September 2007 - 07:21 PM

Hello people,

I really need help on this. I'm trying to remake some dragons in the game to improve the gameplay and i'm testing some dragons with various scripts.
I just killed the dragon "Tapanasacar" from TDD with bp installed (after I made improvements on it's stats, immunities etc). Funny is the dragon NEVER used it's breath weapon attack on the whole fight...(which lasted REAL long) <_<
Also the dragon spammed some wing buffets in the beginning, then some spells, and then only attacked melee until it got to near death (after minutes), casted a stoneskin and cure critical and nothing else again.No breaths at all, and no buffets on most of the fight too...which sucks kinda...For the record I didn't cast a single spell on my party and he fell with no deaths at all, mainly with hacking melee... <_<

The script is here can an expert tell me what the heck is wrong with the script and the dragon never ever uses the topaz dragon breath attack?? :blink:
Attached File  dragtope.BCS   8.12K   279 downloads

Any suggestions for the script coding?
Thanx in advance.

PS : no wonder these dragons are easy with faulty scripts...

Edited by Radagast-The-Brown, 11 September 2007 - 07:26 PM.

Ignorance Is Bliss

#2 Cuv

Cuv

    Area Maker (retired)

  • Modder
  • 925 posts

Posted 11 September 2007 - 08:27 PM

Hello people,

I really need help on this. I'm trying to remake some dragons in the game to improve the gameplay and i'm testing some dragons with various scripts.
I just killed the dragon "Tapanasacar" from TDD with bp installed (after I made improvements on it's stats, immunities etc). Funny is the dragon NEVER used it's breath weapon attack on the whole fight...(which lasted REAL long) <_<
Also the dragon spammed some wing buffets in the beginning, then some spells, and then only attacked melee until it got to near death (after minutes), casted a stoneskin and cure critical and nothing else again.No breaths at all, and no buffets on most of the fight too...which sucks kinda...For the record I didn't cast a single spell on my party and he fell with no deaths at all, mainly with hacking melee... <_<

The script is here can an expert tell me what the heck is wrong with the script and the dragon never ever uses the topaz dragon breath attack?? :blink:
Attached File  dragtope.BCS   8.12K   279 downloads

Any suggestions for the script coding?
Thanx in advance.

PS : no wonder these dragons are easy with faulty scripts...


LOL, never bothered to install TDD... now I know why. That is a useless script, suprised it works at all. In all fairness though, the scripting commands for BG1 are limited. I can't help you with that, but for BGII or ToB, I have a Topaz dragon of my own and here is how I cast the breath weapon:

Your script first:

IF
	See(NearestEnemyOf(Myself))
	!Range(LastSeenBy(Myself),10)
	GlobalTimerExpired("TOPAZDRAGONBREATH","LOCALS")
THEN
	RESPONSE #100
		SetGlobal("WingBuffet","LOCALS",0)
		ForceSpellRES("SPPR962",LastSeenBy(Myself))
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",18)
END
I gotta assume that they used or modified SPPR952.spl for the breath weapon... it is the only spell that I can't identify in this script. It is either a broken spell, or not the breath weapon at all. Other than this snip, this dragon doesnt do much of anything except Wing Buffet and a few spells... and does it poorly. Range check here could be anything not close, but within sight. Have the sight check in a different snip, it is redundant here. I bet this script hangs.

My script:

IF
	Range(LastSeenBy(Myself),30)
	!GlobalTimerNotExpired("TOPAZDRAGONBREATH","LOCALS")
THEN
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",6)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",12)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",15)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
END

My script already establishes who he sees is the enemy. Sorry, won't give you the whole script... its a project in the works.

If you want to see some decent dragon scripts, either look at Dave's "Improved Abazigal" (look at Tamah), or Kensai Ryu's "Difficult Brown Dragon" for pointers on better AI.

Hope this helps.

Cuv

#3 Radagast-The-Brown

Radagast-The-Brown
  • Member
  • 252 posts

Posted 11 September 2007 - 09:31 PM

LOL, never bothered to install TDD... now I know why. That is a useless script, suprised it works at all. In all fairness though, the scripting commands for BG1 are limited. I can't help you with that, but for BGII or ToB, I have a Topaz dragon of my own and here is how I cast the breath weapon:


Who says its bg1? TDD is for bg2/tob... anyway doesnt matter much since the script sucks anyway.

I gotta assume that they used or modified SPPR952.spl for the breath weapon... it is the only spell that I can't identify in this script. It is either a broken spell, or not the breath weapon at all. Other than this snip, this dragon doesnt do much of anything except Wing Buffet and a few spells... and does it poorly. Range check here could be anything not close, but within sight. Have the sight check in a different snip, it is redundant here. I bet this script hangs.


I don't really know much about AI coding though I do try to learn some stuff here and then.I have no idea if they modified the file or not but it does seem logical that the TDD adds a topaz dragon breath to the game since that kind of dragon didn't exist in the original game. As for the range checks I don't really understand u, do u suggest to make the ranges bigger like 30-50 feet?

My script:

IF
	Range(LastSeenBy(Myself),30)
	!GlobalTimerNotExpired("TOPAZDRAGONBREATH","LOCALS")
THEN
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",6)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",12)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",15)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
END

My script already establishes who he sees is the enemy. Sorry, won't give you the whole script... its a project in the works.

Can't really understand the part of the locals 6, 12, 15... Seems like chinese to me or lots of code missing :/ You don't help much...

If you want to see some decent dragon scripts, either look at Dave's "Improved Abazigal" (look at Tamah), or Kensai Ryu's "Difficult Brown Dragon" for pointers on better AI.
Hope this helps.

Cuv


I already use those 2 mods-dragon scripts in my games and ye I know they r decent and good. LR scripting and Kensai Ryu did a hell of a job on dragons I don't doubt it. Meh I guess i need more research on their files.

Was just wondering though the exact mistake on this script that prevented the breath from happening... thanx anyway.
Ignorance Is Bliss

#4 Gort

Gort
  • Validating
  • 614 posts

Posted 11 September 2007 - 09:40 PM

you'd better past baf, not bcs if you want help=). Also, you may look at DSoA mod - it adds several dragons.

#5 Radagast-The-Brown

Radagast-The-Brown
  • Member
  • 252 posts

Posted 12 September 2007 - 03:24 AM

you'd better past baf, not bcs if you want help=). Also, you may look at DSoA mod - it adds several dragons.


Ye i know DsoA is installed cause Kensay Ryu's dragons pawn (though I did improve those too in immunities, stats etc) ^^

As for the baf file u say where should i look for it? and how am i supposed to know it's name file in order to find it?
Bah, never mind I found one in the TDD folder, I guess thats the one? : Attached File  DRAGTOPE.BAF   3.57K   217 downloads

Edited by Radagast-The-Brown, 12 September 2007 - 04:06 AM.

Ignorance Is Bliss

#6 Cuv

Cuv

    Area Maker (retired)

  • Modder
  • 925 posts

Posted 12 September 2007 - 07:20 AM

I already use those 2 mods-dragon scripts in my games and ye I know they r decent and good. LR scripting and Kensai Ryu did a hell of a job on dragons I don't doubt it. Meh I guess i need more research on their files.

Was just wondering though the exact mistake on this script that prevented the breath from happening... thanx anyway.


I just can't believe that the priest spell it mentions is actually the breath weapon. I can't see Po or Death making that mistake (the guys who made the mod), they should have created their own custom spell for the breath. Ah well, it was a long time ago.

!GlobalTimerNotExpired("TOPAZDRAGONBREATH","LOCALS") - this means that the timer has expired... in a double-negative sorta way. Try using this trigger in that script instead of GlobalTimerExpired... and see if that helps at all. I know that GlobalTimerExpired tends to sometimes hang or stutter a script... that is why most scripters use !GlobalTimerNotExpired.

Okay. Well, have you tried looking for scripting references and guides? I know Sim made a good one. KR doesnt script anymore. In fact, there are few people left that know much about scripting. I know some, and write my own scripts. Can try to explain a few things about the scripts:

IF
	Range(LastSeenBy(Myself),30)
	!GlobalTimerNotExpired("TOPAZDRAGONBREATH","LOCALS")
THEN
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",6)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",12)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
	RESPONSE #100
		SetGlobalTimer("TOPAZDRAGONBREATH","LOCALS",15)
		ForceSpellRES("KESSYL1",LastSeenBy(Myself))
END

Can't really understand the part of the locals 6, 12, 15... Seems like chinese to me or lots of code missing :/ You don't help much...


Those number are timers. They count down, when they reach 0.. then the script snippet becomes True, and the breath weapon is cast as a spell. In my script, KESSYL1 is the spell for the Topaz Dragon Breath.

[Edit] I started to post the code from the script you attached to help explain what is happening , but looked at it more closely. It is not a good script. So much is wrong with it that I can't begin to tell you. It has redundant globals and locals, weird range checks, casts only ForceSpell, duplicated fake triggers, poor melee, etc.

I am willing to bet that with some practice and study, you can write a better script than this in just a few minutes. Too bad their aren't any scripting groups left around... or I would direct you to one of them to learn more. Sorry I can't be more help right now.

I would like to know what kind of immunity opcodes and stat increases you used for your upgrades? It is possible that something has become incompatible... not likely, but possible.

Maybe we can start a scripting forum here at SHS? Liam or Seb?

Cuv

#7 Radagast-The-Brown

Radagast-The-Brown
  • Member
  • 252 posts

Posted 12 September 2007 - 07:48 AM

!GlobalTimerNotExpired("TOPAZDRAGONBREATH","LOCALS") - this means that the timer has expired... in a double-negative sorta way. Try using this trigger in that script instead of GlobalTimerExpired... and see if that helps at all. I know that GlobalTimerExpired tends to sometimes hang or stutter a script... that is why most scripters use !GlobalTimerNotExpired.

K thanx for that tip I guess i'll try it and see.

Okay. Well, have you tried looking for scripting references and guides? I know Sim made a good one. KR doesnt script anymore. In fact, there are few people left that know much about scripting.

No kidding, no wonder few people answer on questions about scripting. Too bad no forum good enough for that topic.

I started to post the code from the script you attached to help explain what is happening , but looked at it more closely. It is not a good script. So much is wrong with it that I can't begin to tell you. It has redundant globals and locals, weird range checks, casts only ForceSpell, duplicated fake triggers, poor melee, etc.

No wonder I get lost when i look at it :wacko: . Bad is that many dragons from BPP, TDD and SoS mega mods suffer from the same problem. Most of the scripts in those mods are kinda same and look really weird. You said something about redundant globals and locals. You mean that some of these globals and locals don't even exist in the game that's why they never work? Or that the way they are coded they never take place? As for the poor melee I noticed it in action the dragon only tried to hit players like 10 times in the whole fight max... As for the forcespell ye i noticed... Not even ReallyForceSpell or Applyspell are used... that's why the dragon is so slow in actions...

I would like to know what kind of immunity opcodes and stat increases you used for your upgrades? It is possible that something has become incompatible... not likely, but possible.
Maybe we can start a scripting forum here at SHS? Liam or Seb?

I mainly increased stats through NI : stats, number of attacks, resistances, saving throws, thac0, AC, added some items like helm for immunity criticals, dragring,ring97 for dragon immunities, as well as add some effects for invisibility detection via script, immunity to backstab and movement rate bonus. Not likely to make things incompatible with just some additions on the cre file don't u think?
Ye a scripting forum would be great indeed.
Thnx for the help nonetheless.

Edited 1: Made loads of changes and additions in the file using some guidance from other creature scripts such as the Weimer's Ritual dragon, KR's brown dragon, LR's Abazigal+Saladrex. The result is way better now though it still needs some improvement. Here it is : Attached File  dragtope.BCS   18K   233 downloads

Edited 2 : Meh.. Still the same issue everything seems to work except the topaz dragon breath... Probably needs script changing in the coding. The"spell" topaz dragon breath says in NI/DLTCP that it deals some minor cold dmg (total of 12d6+12/save for half) and greatly decreases the strength of those hit. :wacko: Unfortunately it doesn't work still...

R@d@g@st The Brown

Edited by Radagast-The-Brown, 12 September 2007 - 07:46 PM.

Ignorance Is Bliss