Luke Posted October 27, 2018 Posted October 27, 2018 1) I'd like to make a certain summoned CRE act as if it were a "Familiar". This is my script: IF OnCreation() THEN RESPONSE #100 ChangeEnemyAlly(Myself,FAMILIAR) MakeGlobalOverride() AddFamiliar() END My question is: is action ChangeEnemyAlly() useless since there is AddFamiliar()? 2) When patching existing game scripts (e.g., baldur.bcs), is it better to use EXTEND_TOP or EXTEND_BOTTOM? Quote
jastey Posted October 28, 2018 Posted October 28, 2018 (edited) 1. I use both to make a familiar out of my "normally spawned" NPC. (Private project) 2. It is better to use EXTEND_BOTTOM. If for some reason you need it to be EXTEND_TOP, always (like, ALWAYS) add a "Continue()" to the end of your script. In your script above you use "OnCreation()" which only gives true if the area is newly loaded. You might want consider using a unique checkvariable instead. Edited October 28, 2018 by jastey Quote
Luke Posted October 28, 2018 Author Posted October 28, 2018 1. I use both to make a familiar out of my "normally spawned" NPC. (Private project) 2. It is better to use EXTEND_BOTTOM. If for some reason you need it to be EXTEND_TOP, always (like, ALWAYS) add a "Continue()" to the end of your script. In your script above you use "OnCreation()" which only gives true if the area is newly loaded. You might want consider using a unique checkvariable instead. Thanks for answering. The previous script is attached to a CRE and it is the first script block (it must give true only when the CRE is summoned......) As far as EXTEND_TOP/BOTTOM is concerned, I guess I'll stick with EXTEND_BOTTOM if it's better (the script block that I'd like to add to baldur.bcs doesn't make use of OnCreation()......) Separately, I noticed that if the class (offset 0x0273) of the previous CRE is, say, THIEF, then that CRE is not a Thief when it's summoned (the action bar lacks the Stealth button, the Find Traps button and the like....) ---> it becomes a Thief only after entering a building (or changing area). Why? Quote
jastey Posted October 28, 2018 Posted October 28, 2018 Oh, I wasn't even aware OnCreation() can be used for a newly created cre. Heh. To the cre question: I can only speculate. Maybe the class with according attributes is not properly assigned to the cre and therefore the buttons only show after the game reassigned the cre in some way after moving it to another area - but I don't know. Quote
Luke Posted October 28, 2018 Author Posted October 28, 2018 (edited) To the cre question: I can only speculate. Maybe the class with according attributes is not properly assigned to the cre and therefore the buttons only show after the game reassigned the cre in some way after moving it to another area - but I don't know. What do you mean by properly assigned? This is my assignment: WRITE_BYTE 0x0273 4. Moreover, I noticed the same happens if I write: IF OnCreation() THEN RESPONSE #100 ChangeClass(Myself,THIEF) END However, if I open the CRE file in NearInfinity, everything seems to be correct, so I really can't understand...... Edited October 28, 2018 by Luke Quote
jastey Posted October 28, 2018 Posted October 28, 2018 (edited) I was referring to a hand-made cre file of some sort. In your case, maybe assigning the class is not "enough" to make it a real thief with all the buttons etc., and as soon as the engine reassembles the cre file it is corrected. (Same for kicking out of teh group and rejoining etc.) But I don't know enough to really help you. The only thing I could think of is a workaround: spawn your cre in another area and let it EscapeAreaMove to where you want it.... But that's a very unprofessional hack and only makes sense if the NPC isn't in teh party already, of course. Edited October 28, 2018 by jastey Quote
DavidW Posted October 28, 2018 Posted October 28, 2018 I *think* buttons are connected to the animation. Quote
Luke Posted October 28, 2018 Author Posted October 28, 2018 (edited) I *think* buttons are connected to the animation.I don't think so..... I tried changing the class of the ghast summoned by Tiax to Thief and when he summons it, all the buttons are there..... So there is probably something wrong with my script (1st post), but it's really odd (anyway, the animation of my CRE is GREATCAT_LEOPARD....) Edited October 28, 2018 by Luke Quote
DavidW Posted October 28, 2018 Posted October 28, 2018 Well, try changing the animation of *your* creature to ghast and see if it makes a difference. Quote
Luke Posted October 29, 2018 Author Posted October 29, 2018 Well, try changing the animation of *your* creature to ghast and see if it makes a difference. It makes no difference ...... Quote
Luke Posted October 29, 2018 Author Posted October 29, 2018 Well, try changing the animation of *your* creature to ghast and see if it makes a difference. The problem seems to be related to my script (1st post): if I don't assign it to my CRE and change its allegiance to 5 (controlled), then all the buttons are there...... But what is wrong with my script!? Quote
Luke Posted October 30, 2018 Author Posted October 30, 2018 So, the problem is due to the action AddFamiliar() ----> this action temporarily sets all of a creatures non-EA values to 0 (GENERAL, CLASS, RACE, GENDER, ALIGNMENT, SPECIFICS). Anything that forces that character's action-bar to update itself will revert the creature to it's normal values (and action-bar). For example: Casting a spell from a quick-spell slot (needs to update the quantity) Changing the spell in a quick-spell slot Using a quick-item with quantity/charges Then re-select the character. (courtesy of @kjeron) Quote
Luke Posted October 30, 2018 Author Posted October 30, 2018 (edited) What's the difference between EscapeArea() and DestroySelf() (apart from the fact that the latter makes a CRE disappear instantly)? Edited October 30, 2018 by Luke Quote
Luke Posted November 1, 2018 Author Posted November 1, 2018 (edited) 2. It is better to use EXTEND_BOTTOM. If for some reason you need it to be EXTEND_TOP, always (like, ALWAYS) add a "Continue()" to the end of your script.The following script IF Global("gt_dead","global",1) Kit(Player1,GTBSMS) AreaType(16) PartyRested() THEN RESPONSE #100 ActionOverride(Player1,AddSpecialAbility("GTALLY") SetGlobal("gt_dead","global",0) ENDdoesn't work if I use EXTEND_BOTTOM (i.e., when it's added at the bottom of baldur.bcs....). Instead, if I use EXTEND_TOP (plus the action continue()), then it works fine..... Why? Edited November 1, 2018 by Luke Quote
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.