Jump to content

CRE modding questions


Miloch

Recommended Posts

What do you mean 'sometimes'? Is there a way to check for sure in the item or proficiency code somewhere?

 

I just put equal large and small sword proficiencies on my CREs that are supposed to be proficient in wakizashi or whatever. I guess it'll work but it seems a tad inelegant (but hey, that's IE modding for you).

Link to comment
Check the category field (it's a short at 0x1c, I believe).
Ok, that works for swords (the ones I've looked at have an item type of either large or small sword). But now I'm looking at things like crossbows, which have an item type of crossbow. There is no BG1 crossbow proficiency, so I'm wondering how to tell if it's considered a bow or missile weapon or what. The description says missile, but I've learned not to trust descriptions. And apparently, there are no item proficiencies assigned in BG1, so how does the game even know whether a CRE's proficiency covers the item?

 

(Yeah I guess this is more about ITM modding than CRE modding but I started the discussion here and didn't feel like spinning off a new thread. :))

Link to comment

It's a hard-coded list. The game knows which categories correspond to which proficiencies; for missile weapons, it's the categories assigned to slings, crossbows, and I think darts (and any other crappy missiles I forgot). Bow proficiency really does cover only bows.

Link to comment

Ok, thanks. Getting back to CRE modding - how can I code a compound # of attacks per round value (0x53), like 3/2, or can I? According to the IESDP, it takes a value from 0-10. All the CREs I've looked at have a single value, like 1, 2 or 3.

Link to comment
Obviously, you'll want something less dumb for the targetting (e.g. ([GOODCUTOFF.0.0.LONG_BOW]) ) but that's a start.
BG1 doesn't seem to recognise GOODCUTOFF. I didn't realise how primitive the BG1 scripting engine was. This block compiles fine in Tutu (BG2) but craps out in BG1:
IF
 OR(4)
See(NearestEnemyOfType([GOODCUTOFF.0.0.BARD_ALL]))
See(NearestEnemyOfType([GOODCUTOFF.0.0.DRUID_ALL]))
See(NearestEnemyOfType([GOODCUTOFF.0.0.CLERIC_ALL]))
See(NearestEnemyOfType([GOODCUTOFF.0.0.MAGE_ALL]))
 False()
THEN
 RESPONSE #100
END

And it's not the ALL values either - I played around with and removed those. In fact, it seems to have trouble with OR blocks entirely. Being as how this is a Dudleyfix intended for BG1 and the whole point of giving someone 'miscast magic' would be to target spellcasters, how could one resolve this? Apart from leaving out the targetting block and just hoping the spell happens to hit a caster (that's what I've done for now - a rather lame solution though).

Link to comment

Multiple blocks. You don't really need an OR -- See(A) THEN Do() See(B) THEN Do() See(D) THEN Do() is going to behave identically to OR(3) See(D) See(B) See(A) THEN Do(). (Fucking forum software won't let me write LPAREN C RPAREN.)

 

The EA parameter for specs in NearestOfType objects is ignored in BG2. This is crap for NearestMyGroup (which is specifics matching without any EA requirement), of course, but the engine will decide if the allegiance of the targeted object meets the "EnemyOf" requirement.

 

I'm begging you: please, PLEASE include some action in your targeting blocks. NoAction() or Continue() or whatever. There's no evidence that an actionless block is even a valid BCS block; it's something that should have stopped years ago.

Link to comment

I didn't want to wrap the whole thing in code, so it was either copyright or (D). :)

 

Note that the stat is a literal value check; CheckStatGT(Myself,4,8) will return true for 5 attacks and 1/2, 3/2, 5/2, etc. :(

 

And if you really want just targeting, you can not everything without OR (OR(3) See(Nearest) See(SecondNearest) See(ThirdNearest) is equivalent to !See(ThirdNearest) !See(SecondNearest) !See(Nearest) is equivalent to !See(ThirdNearest)). But you really have to check to make sure anything works in BG. (Note that OfType objects will only ever return the nearest object of optional type, regardless of which nthNearest you specify.)

Link to comment
Multiple blocks. You don't really need an OR -- See(A) THEN Do() See(B) THEN Do() See(D) THEN Do() is going to behave identically to OR(3) See(D) See(B) See(A) THEN Do().
Yeah, I was trying to avoid that since I already have multiple blocks for different spells, so it will multiply those exponentially. But I guess I can just do it for the spells where enemy casters should be a priority.
I'm begging you: please, PLEASE include some action in your targeting blocks. NoAction() or Continue() or whatever. There's no evidence that an actionless block is even a valid BCS block; it's something that should have stopped years ago.
Well, blame SimDing0 for that... I pretty much lifted the example from his scripting guide. He also says to put the targetting block at the end of the script, rather than the beginning, which seems rather counterintuitive to me, but I guess I shouldn't expect these things to make sense.

 

@Rabain - thanks for the link. One thing I noticed about that guide is it still used MAGE_ALL, CLERIC_ALL etc. in BG1, which are present in the BG2 class.ids but not the BG1 version. Will they still work?

Link to comment
Yeah, I was trying to avoid that since I already have multiple blocks for different spells, so it will multiply those exponentially. But I guess I can just do it for the spells where enemy casters should be a priority.
It doesn't really make much difference. I'm not a fan of sensible targeting for BG and TotSC anyway; ruins the spirit.

 

Well, blame SimDing0 for that... I pretty much lifted the example from his scripting guide. He also says to put the targetting block at the end of the script, rather than the beginning, which seems rather counterintuitive to me, but I guess I shouldn't expect these things to make sense.
They should make sense. If they don't, you're going to make a lot of mistakes. What you say he said doesn't make sense, but I haven't read the tutorial in years.

 

One thing I noticed about that guide is it still used MAGE_ALL, CLERIC_ALL etc. in BG1, which are present in the BG2 class.ids but not the BG1 version. Will they still work?
No.
Link to comment
What you say he said doesn't make sense, but I haven't read the tutorial in years.
Well it makes an odd sort of sense if you take his statement:
It is usually best to have the targetting section at the end of the script, as it is usually the lowest priority section present, and this makes it easier to avoid disrupting LastSeenBy().
In conjunction with the description of how scripts work in Vlasák's guide:
The script is parsed from the top. When the triggers of one block are evaluated as true, the actions of the block are performed and the parsing restarts from the top (unless there is the Continue() action in actions of the block - in this case, the parsing continues to the next block).

When the trigger of one block is evaluated as false, the parsing skips to the next block.

When it reaches the bottom of script (last block), it starts from the top again.

Of course, this is irrelevant for BG1 where you need to incorporate the targetting in multiple blocks. Which makes it pretty ridiculous if I have to do separate blocks for MAGE, F_M, F_M_T etc. I'm not trying to do SCS for BG1 or something, but I'm not going to give someone Miscast Magic if it's going to be pointless. Might be easier just exclude the non-casters.
IF
 See([ENEMY])
 !Class(LastSeenBy(Myself),FIGHTER)
 !Class(LastSeenBy(Myself),THIEF)
 !Class(LastSeenBy(Myself),FIGHTER_THIEF)
THEN
 RESPONSE #100
 Continue()
END

Or would this just cause an endless loop in the script if it sees Fs or Ts?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...