Jump to content


Bozu

Member Since 18 Mar 2009
Offline Last Active Oct 30 2009 01:59 PM

Topics I've Started

Scripts under BGT/BWP enviroment

19 April 2009 - 02:53 PM

Hi fellow gamers/modders,

I'm trying to code a few PC's AI scripts to better satisfy my needs. I'm running then in the Trilogy-BWP enviroment, and I'm aware that only BP series are compatible. Neverthless, and since I want really simple scripts, I decided to make an attempt, instead of trying to adaptate bpseries scripts.

Of course, I'm experiencing regular Crash To Desktops (when AI is on), and wondering if my scripts can be fixed. I'm actually trying to debug them, but I'm new on this "scripting thing".

Also, I observed that another annoying problem happens with all the standard bg2 scripts (if AI is on): the charaters are constantly interrupting actions. They stop in the middle when walking to a clicked point, interrupt casting (as if another order was given, although they don't really "DO" nothing). Instead, they stand there with that "on-guard" animation sequence (fast breathing).

That happens a lot, but not all the time.

Now, this is strange: I run a test with the "None" script (without giving scripts to the PCs).  
Even without scripts, the same happens, if the AI button is on.

That's bugging me...


About my scripts
I made this one to the protagonist:

There are some custom spells (all them are okay, since I run a test on each one).
As far as I know, the HPLT is uncompatible with BWP (so I removed that line on all the scripts).

Does anybody know any reasons why the mentioned issues are occuring?

//////////////////////////////////////////
// * Check HP and ForceCast unconciousness*
//////////////////////////////////////////

IF
TookDamage()
HPPercentLT(Myself,15)
CheckStatGT(Myself,20,MAXHITPOINTS)
Exists(NearestEnemyOf())
!StateCheck(Myself,STATE_INVISIBLE)
!StateCheck(Myself,STATE_SLEEPING)
THEN
RESPONSE #100
ForceSpellRES("ZOUTCMB2",Myself)
VerbalConstant(Myself(),DYING)
AttackReevaluate(NearestEnemyOf(Myself),10)
END

IF
TookDamage()
HPPercentLT(Myself,30)
Exists(NearestEnemyOf())
!StateCheck(Myself,STATE_INVISIBLE)
!StateCheck(Myself,STATE_SLEEPING)
THEN
RESPONSE #100
ForceSpellRES("ZOUTCMB2",Myself)
AttackReevaluate(NearestEnemyOf(Myself),10)
END

IF
TookDamage()
HPPercentLT(Myself,50)
THEN
RESPONSE #100
ApplySpellRES("ZCMBT",Myself)
END

////////////////
// *DETECTTRAPS
////////////////

IF
ActionListEmpty()
!Exists(NearestEnemyOf())
!ModalState(DETECTTRAPS)
!AreaType(CITY)
!AreaType(OUTDOOR)
!AreaType(FOREST)
THEN
RESPONSE #100
FindTraps()
END

////////////////
// * Gather Party  // this one was taken from a script tuto
////////////////

IF
ActionListEmpty()
HotKey(G)
THEN
RESPONSE #5
VerbalConstant(Myself(),LEADER)
GlobalShout(1001)
Wait(2)// seconds
RESPONSE #95    // reduced verbal because it's annoying
GlobalShout(1001)
Wait(2)// seconds
END
//
// Module#2, Respond to GlobalShout or Shout
// heard 1001 = COME_TO_ME

IF
ActionListEmpty()
Heard([PC],1001)
!See(NearestEnemyOf(Myself))
!Range(LastHeardBy(),10)

THEN
RESPONSE #100
SetInterrupt(FALSE)
AttackReevaluate(NearestEnemyOf(Myself),10)
SetInterrupt(TRUE)
MoveToObject(LastHeardBy())
Continue()
END



/////////////
// *ZATHTOME // this one works fine (it starts a container when an object is used)
the object creates ZTOM1 in the inventory for a few instants and removes it. is OK.
/////////////

IF
ActionListEmpty()
Delay(200)
!StateCheck(Myself,STATE_STUNNED)
THEN
RESPONSE #100
ForceSpellRES("ZREGSPEL",Myself)
END
  IF
ActionListEmpty()
HasItem("ZTOM1",Myself)
THEN RESPONSE #100
StartStore("zathtom1",Myself)
END






---------------------------------------------------------------------------------------

Did anybody ever seen...

31 March 2009 - 08:15 AM

"Strange graphic issue + Lock up/Freeze (got to reset) http://screencast.com/t/JvkDbvZfLT

Got the Big World 6.0 with only standard mods. This strange graphic issue doesn't seem to occur with original game, but with BGT.
Usually I can handle myself with problems like that, but this time i'm clueless.
It's really annoying. Specially because I was planing to convert an oooold mod of my own to BWP (still weiduing it, by the way, so nothing related to the issue). It can run for about 25min, 1hour, 10min… it`s random. The game suddenly goes blurry like THIS: http://screencast.com/t/JvkDbvZfLT

After this strange graphic effect, it goes running for about 20 or 30 seconds and then it freezes.

Trying to save the game is useless (if possible...) because it’ll not load (file is corrupted).

There is no AntiVirus or background running. This PC was intended to be devoted to BG.
So, I Initialy suspected it could be happening due to:

1.The size of the override folder. But I did a clean install, biffed and it’s now around 200mb, which (I think) is not much. It didn't help anyway.
2. Something related to corrupted savegames. But it's not. By the way Beregost crashfixer utility is great, although it can't help here
3.Direct X thing. Did a downgrade, and then an upgrade. It was useless. Reinstal graphic card drivers. Also useless.
4.Config files: Tried to disable the vertex padding. Tried another resolution, even tried without graphic 3D acceleration…. Didn’t work.
It's happening in both windowed and fullscreen modes.

5.I reduced the number of mods (all of them are for standard class for Big Project, so it’s supposed to be ok). Another thing, I didn’t went crazy installing every single mod, but only about half of the standard mods suggested for BGT instructions (strictly followed). Did'n work too....

Finally I formatted the system, fresh windows XP, and did a clean install again.
Game apparently was free of this problem for about... half a day.

The monitor is widescreen, but didn`t put a widescreen mod on by that time. Resolution used ingame: 1024 / 32bit, but it seems worthless to change that, since it also happening in 800.
The card on that machine (and I would like to kept that one dedicated to BGT… ) is NVidia 6200 GeForce Turbocrap. I upgraded the drivers, and it didn`t change a bit… Also tested other 3D applications (far heavier than the old BGII…) and they work fine (so, I think it`s not the card).
I tried to create a profile for ToB and BGmain on the NVidia panel, disabling VSync, and a few other things. Good for nothig....
At last, I've tried Rivatuner, but it could'nt help.
But as I recall, I've played IE games on that very same machine without problems before (was BGII SoA, without ToB).

Again, I formated all again and tried a fresh install. Installed the widescreen 1440 x 900, this time.
The game was fine for a about 4 days. Now it`s happening again...

Any ideas or am I doomed?

The most sincere thank's in advance.