Jump to content


GeN1e's Content

There have been 127 items by GeN1e (Search limited from 18-May 23)


By content type

See this member's


Sort by                Order  

#595030 Heh heh heh heh

Posted by GeN1e on 16 May 2017 - 09:18 PM in IE Help

 I haven't been able to find a caster level for cures, unless you put it inside the SPL

Temples cast spells at minimal level, so it's pretty useless if you want to re-purpose standard spells without making fixed-level copies for temples.

 

So Raise Dead (and Resurrection in BG2) are the only cures available to a dead character - everything else, as you all know, is grayed out. The engine discriminates in just those two cases.

IIRC Remove Curse also has hardcoded checks to be available only when there's cursed item/status on the character.

 

but another hard-coded feature turned out to be that that only BAM icons for existing spells - the stones that you click in the bar to cast - are valid as custom icons for cures.

Try to end the BAM's name with a "b", it may do the trick.




#595095 Do we need weapon paperdoll shadows and why there's still none?

Posted by GeN1e on 21 May 2017 - 09:59 AM in IE Mod Ideas

It took me over ten years and this thread to realize there're paperdoll shadows in BG :)




#595193 On SPRITE_IS_DEAD variables

Posted by GeN1e on 30 May 2017 - 12:52 PM in IE Help

SPRITE_IS_DEADscriptname global is automatically set whenever the creature enters a dead state. It's done on engine level and is not affected by scripting.

Dead("scriptname") is essentially a shorthand for !Global("SPRITE_IS_DEADscriptname","global",0). You can tweak and adjust the death counter manually via SetGlobal() like any other variable, if you so wish, just be careful to understand what you're doing and why, as far as various plot conditions go.

Die() has nothing to do with either, it just marks that the active creature (read - myself) has died in the last round. It can be used to set custom counters as well, in addition to SPRITE_IS_DEAD, even reducing SPRITE_IS_DEADscriptname by 1 to mitigate the effect of hardcoded function. SoD relies quite heavily on Die()-based custom death counters to control the reinforcement spawns in siege battles - while I'm slightly reluctant (or just prejudiced?) to trust it for plot-critical events, I don't recall seeing any cases of Die() not triggering properly during many dozens of hours of testing.

 

"Note that SPRITE_IS_DEAD variables are not set if the creature is killed by a neutral creature."

Incorrect, it sets fine. Or possibly it refers to earlier/other versions of engine (vanilla PST?).




#595217 Jerky AI due to multiple commands

Posted by GeN1e on 31 May 2017 - 09:34 AM in IE Help

You need to set a variable so that it doesn't repeatedly keep finding the conditions true and starting the action block fresh every time:
I'm in doubt, tbh. First, you can kill the script this way, even with NoInterrupt (not likely, but still). Second, this bit from SoD's bdshout.bcs works absolutely fine
 
IF
  Global("bd_retreat","locals",1) // in retreat mode
  Global("bd_combat","locals",0) // not in combat mode
  OR(2)
    !See(NearestEnemyOf(Myself))
    !Global("bd_no_combat","locals",0) // no script override
  !NearSavedLocation(Myself,"LOCALSbd_default_loc",5)
  !GlobalTimerNotExpired("bd_search_timer","locals") // i'm not looking for enemies
  !GlobalTimerNotExpired("bd_respond_timer","locals") // i'm not rushing to my allies' side
  Switch("bd_no_retreat","locals") // script override
THEN
  RESPONSE #0
    MoveToSavedLocation("bd_default_loc","LOCALS")
  RESPONSE #1
    SetGlobal("bd_retreat","locals",0) // deactivate retreat mode
END
 

IF
  Global("bd_retreat","locals",1) // in retreat mode
  Global("bd_combat","locals",0) // not in combat mode
  NearSavedLocation(Myself,"LOCALSbd_default_loc",5)
  Global("bd_no_retreat","locals",0) // no script override
  Switch("bd_retreat_escape","locals") // script override
THEN
  RESPONSE #0
    SetGlobal("bd_retreat","locals",0) // deactivate retreat mode
    SetGlobalTimer("bd_rest_timer","locals",1800) // rest after 6 hours
    MoveToSavedLocation("bd_default_loc","LOCALS") // try to reach the exact location one last time, if i was stopped two steps away from it
  RESPONSE #1
    DestroySelf()
END

PS I'll bet my money on ClearAllActions(). It's global, i.e. affects everyone in the area. If you've got two actors clearing each other every second, that might easily produce the observed behavior. Either use ClearActions() which is local, or just skip it entirely,, whatever actor has been doing will be overwritten by moving anyway.



#595246 Flag flag flag flagging flag

Posted by GeN1e on 02 June 2017 - 03:02 PM in IE Help

WRITE_xxxx offset THIS | BITyy // to set
WRITE_xxxx offset THIS & `BITyy // to unset



#595253 Flag flag flag flagging flag

Posted by GeN1e on 03 June 2017 - 11:59 AM in IE Help

(facepalm)
WRITE_LONG 0x17f8 THIS | BIT7

"THIS" is the value read at this offset, hence the name.



#595279 On SPRITE_IS_DEAD variables

Posted by GeN1e on 05 June 2017 - 02:09 PM in IE Help

Nothing then. Which is why it's advisable to always have a script name. At most you can set/overwrite it to use the actor entry's name in .are (bit3 flag) as a script one, but only if you pre-locate them instead of spawning.




#595283 It's ALIVE!!! I learned to resurrect them - and other

Posted by GeN1e on 05 June 2017 - 10:15 PM in IE Help

1) Creatures do not switch to the General type DEAD when they die.

Are you sure? It's possible to make e.g. a damage spell to produce additional effect when it kills its target, with 177 aimed at dead type.

 

Dead creatures are ignored by See() or Detect(), at least with any combination of other death triggers I have tried, like HPLT(LastSeenBy(),1) or a custom spell state persisting into death. But perhaps there is another way to latch on to them. Is it possible to refer to them by their blank script name?

[0.DEAD] might pick it up. If it doesn't, I suspect you're out of luck, because generic/missing script name is, well, generic to begin with. Being able to action override a bunch of them in succession is an unexpectedly nice bonus, not something to be taken for granted...

 

Anyway, aside from this it seems that it's possible to make corpses wear armor and possibly other equipment

If it's flagged as undroppable.




#595391 How to extend all scripts of a category?

Posted by GeN1e on 13 June 2017 - 10:58 AM in IE Help

I didn't want my zombies readily open to exploits - kill a giant, raise a giant, kill it again for the same XP - so I decided to block XP rewards for my zombies. To that end I topped a creature's script with a Die() block with ApplySpellRES("NOXP6_#",Player1), which is my party-wide 1-second immunity to XP Bonus. (I also have a single-target spell, "NOXP1_#".) But it turned out that putting custom spells in Die() blocks on top may prevent the rest of the script from triggering.

 

Try ChangeStat(Myself,XP,0,SET) // or whatever the kill XP stat is actually called in ids.




#595398 How to extend all scripts of a category?

Posted by GeN1e on 13 June 2017 - 02:31 PM in IE Help

Not to my knowledge. I'd expect it to work on the LastSummoner/LastAttacker chain though, which I think you're still using to hook dead critters?




#595399 About fighting animations

Posted by GeN1e on 13 June 2017 - 02:40 PM in IE Help

1) Okay, how can I stop my zmombies... zbomies... zombies from stretching, yawning, turning their heads and all those other things undead don't do? I wand them dumb as stones. Remove/block select animations somehow?

Theoretically, you can clone zombie animation into another slot with different .ini settings. That said I'm quite unfamiliar with animation part of the engine myself, and I don't think there's any comprehensive info available anywhere.

 

Alternatively, you can stun them with pause opcode (165) that allows the creature to keep running its scripts, but obviously it'll only work if you need zombies as part of scenery.




#595418 Help me out with a script, will you?

Posted by GeN1e on 14 June 2017 - 05:03 PM in IE Help

What am I doing wrong here?

 


1) You don't seem to read the 0x272 beforehand

2) There's no OR between 149 and 176

3) You're using | (which is BOR aka bitwise or) instead of || (which is simply OR). I once stepped onto this myself, heh.

4) As Jarno says, there's an extra END after the 1st LPF and no closing one after the second

COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ override
 READ_BYTE 0x272 race
 PATCH_IF (race = 144) || (race = 145) || (race = 149) || (race = 176) || (race = 173) || (race = 180) THEN BEGIN
   LPF ~ADD_CRE_EFFECT~ INT_VAR opcode = 146 target = 1 power = 1 casting_level = 0 parameter2 = 1 probability_1 = 100 timing = 1 duration = 0 resist_dispel = 0 STR_VAR resource = ~ANIMA2_#~ END
   LPF ~ADD_CRE_EFFECT~ INT_VAR opcode = 206 target = 1 power = 1 casting_level = 0 parameter2 = 1 probability_1 = 100 timing = 1 duration = 0 resist_dispel = 0 STR_VAR resource = ~ANIMA6_#~ END
BUT_ONLY



#595437 Help me out with a script, will you?

Posted by GeN1e on 16 June 2017 - 12:17 AM in IE Help

It's true, I didn't read 0x272 first. There is no need for that, if I know what 0x0272 refers to.

 

Maybe you do. WeiDU doesn't, however, and unless you read it somehow, it will compare the 0x272 value itself against the race list, not what's written at this offset.




#595438 Revamping party AI

Posted by GeN1e on 16 June 2017 - 12:23 AM in IE Help

I believe that no NPC comes with anything in the override slot.

 

I think you might wanna check again...




#595447 Revamping party AI

Posted by GeN1e on 16 June 2017 - 02:20 PM in IE Help

There is nothing to check. If they had a script there, it would execute continuously even with the AI button off. And that would not be hard to notice, would it?

 

I'm not sure what exactly you mean by continuously, which shouldn't normally happen unless you put in there something like IF True() THEN RESPONSE #100 DisplayStringHead(Myself,123) END, but joinable NPCs in BG games has their own override script that they keep in and out of party. Tutorial and multiplayer character are probably an exception.

If you observe different behavior, then either there're some BG1 characters without one as well (I'm judging by BG2 and SoD, where every single NPC has a script assigned), or it's something happening on you end.




#595448 Help me out with a script, will you?

Posted by GeN1e on 16 June 2017 - 02:36 PM in IE Help

I've done this sort of thing a dozen times...

 
You mean WeiDU actually recognizes (0x272 = 144) as (BYTE_AT 0x272 = 144)? That's news to me.
 

 

How about code for "If this flag is not set, then set another flag"?

 

WRITE_BYTE offset (THIS & BIT1) ? (THIS | BIT2) : THIS // if BIT1 is set, then set BIT2, else don't change
WRITE_BYTE offset !(THIS & BIT1) ? (THIS & `BIT2) : THIS // if BIT1 isn't set, then unset BIT2, else don't change




#595455 Help me out with a script, will you?

Posted by GeN1e on 17 June 2017 - 06:09 PM in IE Help

You MUST read a value from offset before you can evaluate it, with READ_BYTE, BYTE_AT or THIS (or something else I may have forgotten), whichever is appropriate in context. You CAN NOT just throw in a random number and expect the program to know it was the location of the value and not the value itself.

 

Why not just assign a number to a number?

Only if you did READ_BYTE 0x272 0x272 to assign the value at offset 0x272 to the variable named 0x272 (which is string, not a "number" as you say), which wasn't present in the code snippet you've posted. Although I've no idea if WeiDU would know to compare against the "0x272" variable instead of 0x272 value, won't be surprised if it doesn't...




#595456 Revamping party AI

Posted by GeN1e on 17 June 2017 - 06:22 PM in IE Help

They have scripts that don't start with True()

Even though it's in override slot? If it happens, there's either external interference or some blocker at the top of script. This is not how things normally work.

 

This is what takes control away from the player.

Also this is why I only use default AI script for party members, and none for pure spellcasters.

 

I don't really know why the designers like to stick everything in high script tiers: Override and Class. Race and General are almost always empty. Think about what dowgrading those scripts would accomplish: you could assign an empty script like the one above to override. What it does is guarantee that nothing will happen with the NPC and your own character so long as you are ordering them about. Or maybe the existing Override scripts could just be topped with the above.

I hope you're joking. If something was put into override slot, it was meant to have higher priority than other things.

Race and General are usually empty because there wasn't much scripting going on in vanilla games, especially BG1. If you look at SoD actors, they often have override slot dedicated to individual per-creature plot scripting, Class to the group per-faction general behavior, Race to general AI, and General to class-specific combat AI. Some even use Default.

 

the protagonist has got nothing in the Override slot.

He gets assigned one in SoD. Although it does nothing besides to open QA dialog window.




#595474 Revamping party AI

Posted by GeN1e on 18 June 2017 - 03:48 PM in IE Help

I think you're taking the moddability for granted when it has really happened to be just a nice bonus.

If you need override scripts to handle custom spell effects or new mechanics, then you need to look elsewhere, because BG is not the right place for such things. The fact game's AI is also a script is bad enough already. You just don't use scripts to implement mechanics, you either code them into engine or you pick a better engine.

 

It may be seen as advantage by some - that everything can be scripted, - but BG is not a good example of how you make a moddable game.




#595475 Different kinds of damage

Posted by GeN1e on 18 June 2017 - 04:00 PM in IE Help

177 undead with reverse effect (heal for Cause Wounds, damage for Cure), and follow that with another 177 to 206 the remainder of spell's effects.

 

Of course, I provide zero guarantee it won't create bizarre AI behavior somewhere. Pretty sure Bodhi has been using Heal in some cutscene (or maybe not).




#595491 Help me out with a script, will you?

Posted by GeN1e on 19 June 2017 - 01:58 PM in IE Help

Out of pure curiosity, have you even seen your code actually patch the golems with 206 effect?




#596017 VC and NeJ3 - final releases

Posted by GeN1e on 23 July 2017 - 10:40 PM in Mega Mod Help

It seems I'm done with the BG modding. This year is a 20 anniversary of my BG modding. :huh:  I think it's enough.

We didn't exactly see eye to eye about how modding should be conducted, but regardless of that NEJ featured the best story of all the mods I have seen, it had an actual intrigue going on. Thanks for that, and good luck to you, Vlad.




#596701 Position coordinates

Posted by GeN1e on 20 August 2017 - 08:24 AM in IE Help

IIRC the trap spells use some map marker opcode.




#596707 Position coordinates

Posted by GeN1e on 20 August 2017 - 10:35 AM in IE Help

I think he wants to mark where NPCs have been told to "stay here and wait for me" by the player. That indeed is impossible to predict, as it's defined by the player rather than modder or designer.




#596741 PersonalSpaceDistance()

Posted by GeN1e on 23 August 2017 - 12:47 PM in IE Help

Range() has no distance limitations, it's the Nearest()-like and [] object types that don't exist outside of LoS (which is usually 30').