Jump to content


Photo

Some questions about scripts and effects


  • Please log in to reply
20 replies to this topic

#1 Turambar

Turambar
  • Modder
  • 935 posts

Posted 30 October 2010 - 05:31 AM

The situation is: i want to delete a huge block from a bcs from another mod, and replace it with a better script (in particular, as the Drow item disintegration script from bg2 tweaks doesn't work as it should and no-one has answered on that forum, I'll try to fix it in my tweakpack; that old script could conflict with the new one).
From the weidu documentation, there are many ways I can do it:
- DECOMPILE - REPLACE_TEXTUALLY - COMPILE (but I have to copy the whole block after the command, or to store it into a variable; there can be problems with number of spaces and so on)
- REPLACE_BCS_BLOCK
- APPLY_BCS_PATCH

After removing the old blocks, which could or could not exists, I could extend_bottom it with my new script.

Which of those commands works best and why? Is there a workaround to avoid putting all .baf into my tp2?

Edited by Turambar, 03 November 2010 - 03:35 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#2 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 30 October 2010 - 05:49 AM

The situation is: i want to delete a huge block from a bcs from another mod, and replace it with a better script (in particular, as the Drow item disintegration script from bg2 tweaks doesn't work as it should and no-one has answered on that forum, I'll try to fix it in my tweakpack; that old script could conflict with the new one).
From the weidu documentation, there are many ways I can do it:
- DECOMPILE - REPLACE_TEXTUALLY - COMPILE (but I have to copy the whole block after the command, or to store it into a variable; there can be problems with number of spaces and so on)
- REPLACE_BCS_BLOCK
- APPLY_BCS_PATCH

In this case it'd probably be easiest to copy the .baf file from the other mod and use that together with REPLACE_BCS_BLOCK. Just be sure you compile the .baf file before you REPLACE_BCS_BLOCK, so it really matches the in-game script (e.g. get rid of issues stemming from amount and type of white space and nonsense like that)

(but I have to copy the whole block after the command, or to store it into a variable; there can be problems with number of spaces and so on)

Number of spaces can be gotten around with simple regexps. And WeiDU always decompiles with spaces (never tabs) and LNL for newlines. It's just a boatload of work if you want to replace a lot of text.

After removing the old blocks, which could or could not exists, I could extend_bottom it with my new script; BTW, it says that extend_bottom does not use auto_tra: can I still use @-strings refering to setup.tra?

EXTEND_BOTTOM takes AUTO_TRA. At least I think it does. REPLACE_BCS_BLOCK doesn't. But there are various work-arounds for that. E.g. you can compile the .baf, thus getting it AUTO_TRAed, and then use the resulting .bcs.

Edited by Wisp, 30 October 2010 - 05:53 AM.


#3 Turambar

Turambar
  • Modder
  • 935 posts

Posted 30 October 2010 - 06:06 AM


The situation is: i want to delete a huge block from a bcs from another mod, and replace it with a better script (in particular, as the Drow item disintegration script from bg2 tweaks doesn't work as it should and no-one has answered on that forum, I'll try to fix it in my tweakpack; that old script could conflict with the new one).
From the weidu documentation, there are many ways I can do it:
- DECOMPILE - REPLACE_TEXTUALLY - COMPILE (but I have to copy the whole block after the command, or to store it into a variable; there can be problems with number of spaces and so on)
- REPLACE_BCS_BLOCK
- APPLY_BCS_PATCH

In this case it'd probably be easiest to copy the .baf file from the other mod and use that together with REPLACE_BCS_BLOCK. Just be sure you compile the .baf file before you REPLACE_BCS_BLOCK, so it really matches the in-game script (e.g. get rid of issues stemming from amount and type of white space and nonsense like that)

I thought that REPLACE_BCS_BLOCK compiled BAFs before replacing; can there be problems with spaces anyway?

Another question... does REPLACE_BCS_BLOCK perform variable substitution? Or do I have to use an EVALUATE_BUFFER first, on that BAF?
Anyway, I've noticed that the block contains a string reference which does not belong to the original dialog.tlk

WeiDU always decompiles with spaces (never tabs) and LNL for newlines.

I'm sorry for my ignorance. Does LNL mean Linux New Line ? or what? so, if i copy-paste the code in a linux text editor, should it work?

Edited by Turambar, 30 October 2010 - 06:11 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#4 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 30 October 2010 - 06:33 AM

I thought that REPLACE_BCS_BLOCK compiled BAFs before replacing; can there be problems with spaces anyway?

Maybe it does. I guess it would make sense for it to do that. You can always test it.

Another question... does REPLACE_BCS_BLOCK perform variable substitution? Or do I have to use an EVALUATE_BUFFER first, on that BAF?
Anyway, I've noticed that the block contains a string reference which does not belong to the original dialog.tlk

I would guess it doesn't. Most of this old stuff requires EVAL or a *_EVALUATE counterpart before it evaluates variables.

WeiDU always decompiles with spaces (never tabs) and LNL for newlines.

I'm sorry for my ignorance. Does LNL mean Linux New Line ? or what? so, if i copy-paste the code in a linux text editor, should it work?

Oh, yes. LNL is linux new line (\n). Sorry. Newest WeiDU defines the LNL variable on its own, e.g. allowing you to do REPLACE_TEXTUALLY with
IF[ %LNL%]+triggertext etc

But I guess copy-pasting something that already uses \n would work as well.

Edited by Wisp, 30 October 2010 - 06:36 AM.


#5 Turambar

Turambar
  • Modder
  • 935 posts

Posted 30 October 2010 - 06:58 AM

Oh, yes. LNL is linux new line (\n). Sorry. Newest WeiDU defines the LNL variable on its own, e.g. allowing you to do REPLACE_TEXTUALLY with

IF[ %LNL%]+triggertext etc
But I guess copy-pasting something that already uses \n would work as well.

Ok, using %LNL% worked. Thank you very much!

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#6 Turambar

Turambar
  • Modder
  • 935 posts

Posted 31 October 2010 - 01:48 AM

I have a new question... do scripts run while you rest as well?
for example: you have a script that does a check every hour; you go to sleep while that script is active: will it perform 8 checks?
Another example: a block should perform a check every hour, but only from 12 o'clock to 4 o'clock: what happens if I go to sleep at 11 o'clock?

Another question: are there any conflicts between area flags?
I mean... I need to flag Ust'Natha either as Dungeon or as EXTENDED_NIGHT (it is only CITY, now).
Can there be any problems if I just add any of those flags? Does any of them change anything a part from how scripts see them?
In order to understand if an area can get sunlight, do you think this trigger could work?
!AreaType(DUNGEON)
	OR(2)
		!AreaType(OUTDOOR)
		AreaType(DAYNIGHT)
So, if it is a dungeon, there's no sun. If it's outdoor without D/N, it is in darkness. Otherwise, check the time.

edit:
ok, I've written my script and I'm testing it.
The problem is, I can't get this block working:
IF
	Global("TUDrowItems","Global",1)
	GlobalTimerExpired("TUDrowTimer","Global")
THEN
	RESPONSE #100
		SetGlobal("TUDrowChecking","Global",1)
		Continue()
END

IF
	Global("TUDrowChecking","Global",1) //just set->this is true
	TimeGT(DAWN_START) //15>7.30 true
	TimeLT(DUSK_END)   //15<19.30 true
	!AreaType(DUNGEON) //not dungeon area ->true
	OR(2)
		!AreaType(OUTDOOR) //outdoor->this is false
		AreaType(DAYNIGHT) //true->OR(2) is true
THEN
	RESPONSE #100
		SetGlobal("TUDrowChecking","Global",2)
		Continue()
END
I tried it in an outdoor, DAY/NIGHT, not dungeon area, at 3 pm. The variable was set to 1, but not to 2 (as I expected). Could you please help me understanding why? It might be stupid, but I can't understand it. If you need to know it, the next block sets the variable back to 0 and resets the timer.

Edited by Turambar, 31 October 2010 - 08:29 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#7 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 02 November 2010 - 10:07 PM

Honestly, I don't know. Obviously something wacky is going on. You might want to post your full script here and/or gibberlings3.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#8 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 November 2010 - 12:55 AM

Honestly, I don't know. Obviously something wacky is going on. You might want to post your full script here and/or gibberlings3.

I think I might have understood what the problem was, when I managed to get the folowing script working. There were many Continue()d blocks, and the same variable was set twice in the same script round. Now, the script restarts between the two blocks which SetGlobal("TUDrowItemChecking",...) Could that have caused problems?

The new script, which appears to be working (but it's not really easy to test that script; it triggers every hour and the probability that something gets destroyed every time is quite low), is (I've cut the central part, which is extremely long and all the same):
(I'm sorry for the comments being in Italian; I copied it from NI, as the original .bafs are full of variables which are set in the .tp2, so they're not easy to follow)
IF
	GlobalLT("DROWITEMCHECKDONE","GLOBAL",2)
THEN
	RESPONSE #100
		SetGlobal("DROWITEMCHECKDONE","GLOBAL",2)
		Continue()
END

IF
	Global("TUDrowTimReset","Global",2)
THEN
	RESPONSE #100
		SetGlobalTimer("TUDrowTimer","Global",ONE_HOUR)
		Continue()
END

IF
	GlobalGT("TUDrowTimReset","Global",0)
THEN
	RESPONSE #100
		SetGlobal("TUDrowTimReset","Global",0)
		SetGlobal("TUDrowChecking","Global",0)
		Continue()
END

IF
	Global("TUDrowItems","Global",0)
	OR(32)
		PartyHasItem("DWCHAN01") // Cotta di Maglia Elfica Drow +3
		PartyHasItem("DWCHAN02") // Cotta di Maglia di Adamantite Drow +3
		PartyHasItem("DWSW1H01") // Scimitarra Drow +3
		PartyHasItem("DWSW1H02") // Spada Lunga Drow +3
		PartyHasItem("DWBLUN01") // Mazzafrusto Drow +3
		PartyHasItem("DWHALB01") // Alabarda Drow +3
		PartyHasItem("DWSPER01") // Lancia da Cavaliere Drow +3
		PartyHasItem("DWXBOW01") // Balestra della Velocità Drow +3
		PartyHasItem("DWSHLD01") // Scudo Drow +3
		PartyHasItem("DWCLCK01") // Mantello Piwafwi Drow
		PartyHasItem("DWBOLT01") // Dardo del Sonno Drow
		PartyHasItem("DWBOLT02") // Dardo Stordente Drow
		PartyHasItem("DWBOLT03") // Dardo Drow +1
		PartyHasItem("DWPLAT01") // Corazza di Piastre Completa Drow +5
		PartyHasItem("MISC9W") // Mantello Piwafwi Drow
		PartyHasItem("DSDAGG03") // Pugnale +3 di Adamantite Drow
		PartyHasItem("DSROBE05") // Abito del Mago Drow
		PartyHasItem("sahbolt") // Quadrello Paralizzante
		PartyHasItem("dw#dwkat")
		PartyHasItem("chandrw")
		PartyHasItem("sw1drw")
		PartyHasItem("xbowdrw")
		PartyHasItem("aaitm107")
		PartyHasItem("drowchn1")
		PartyHasItem("drowchn2")
		PartyHasItem("drowchn3")
		PartyHasItem("drowplt1")
		PartyHasItem("drowplt2")
		PartyHasItem("drowplt3")
		PartyHasItem("drowshd1")
		PartyHasItem("drowshd2")
		PartyHasItem("drowshd3")
THEN
	RESPONSE #100
		SetGlobal("TUDrowItems","Global",1)
		SetGlobalTimer("TUDrowTimer","Global",ONE_SECOND)
		Continue()
END

IF
	Global("TUDrowItems","Global",1)
	Global("TUDrowChecking","Global",0)
	GlobalTimerExpired("TUDrowTimer","Global")
THEN
	RESPONSE #100
		SetGlobal("TUDrowChecking","Global",1)
END

IF
	Global("TUDrowChecking","Global",1)
	TimeGT(DAWN_START)
	TimeLT(DUSK_END)
	!AreaType(DUNGEON)
	OR(2)
		!AreaType(OUTDOOR)
		AreaType(DAYNIGHT)
THEN
	RESPONSE #100
		SetGlobal("TUDrowChecking","Global",2)
		Continue()
END
Here there are many blocks like this one, but with different items and Players:
IF
	Global("TUDrowChecking","Global",2)
	HasItem("drowshd3",Player6)
	!HasItemEquiped("CBDRWRNG",Player6) // Anello del Drow
THEN
	RESPONSE #10
		TakeItemReplace("DWDUST","drowshd3",Player6)
		DisplayStringHead(Player6,138482) // Il tuo oggetto drow si è disintegrato
		Continue()
	RESPONSE #4
		TakeItemReplace("DWDUST","drowshd3",Player6)
		TakeItemReplace("DWDUST","drowshd3",Player6)
		DisplayStringHead(Player6,138482) // Il tuo oggetto drow si è disintegrato
		Continue()
	RESPONSE #2
		TakeItemReplace("DWDUST","drowshd3",Player6)
		TakeItemReplace("DWDUST","drowshd3",Player6)
		ActionOverride(Player6,DestroyItem("drowshd3"))
		DisplayStringHead(Player6,138482) // Il tuo oggetto drow si è disintegrato
		Continue()
	RESPONSE #1
		TakeItemReplace("DWDUST","drowshd3",Player6)
		TakeItemReplace("DWDUST","drowshd3",Player6)
		ActionOverride(Player6,DestroyItem("drowshd3"))
		ActionOverride(Player6,DestroyItem("drowshd3"))
		ActionOverride(Player6,DestroyItem("drowshd3"))
		DisplayStringHead(Player6,138482) // Il tuo oggetto drow si è disintegrato
		Continue()
	RESPONSE #400
		Continue()
END
And finally, there's this block:
IF
	Global("TUDrowItems","Global",1)
	!PartyHasItem("DWCHAN01") // Cotta di Maglia Elfica Drow +3
	!PartyHasItem("DWCHAN02") // Cotta di Maglia di Adamantite Drow +3
	!PartyHasItem("DWSW1H01") // Scimitarra Drow +3
	!PartyHasItem("DWSW1H02") // Spada Lunga Drow +3
	!PartyHasItem("DWBLUN01") // Mazzafrusto Drow +3
	!PartyHasItem("DWHALB01") // Alabarda Drow +3
	!PartyHasItem("DWSPER01") // Lancia da Cavaliere Drow +3
	!PartyHasItem("DWXBOW01") // Balestra della Velocità Drow +3
	!PartyHasItem("DWSHLD01") // Scudo Drow +3
	!PartyHasItem("DWCLCK01") // Mantello Piwafwi Drow
	!PartyHasItem("DWBOLT01") // Dardo del Sonno Drow
	!PartyHasItem("DWBOLT02") // Dardo Stordente Drow
	!PartyHasItem("DWBOLT03") // Dardo Drow +1
	!PartyHasItem("DWPLAT01") // Corazza di Piastre Completa Drow +5
	!PartyHasItem("MISC9W") // Mantello Piwafwi Drow
	!PartyHasItem("DSDAGG03") // Pugnale +3 di Adamantite Drow
	!PartyHasItem("DSROBE05") // Abito del Mago Drow
	!PartyHasItem("sahbolt") // Quadrello Paralizzante
	!PartyHasItem("dw#dwkat")
	!PartyHasItem("chandrw")
	!PartyHasItem("sw1drw")
	!PartyHasItem("xbowdrw")
	!PartyHasItem("aaitm107")
	!PartyHasItem("drowchn1")
	!PartyHasItem("drowchn2")
	!PartyHasItem("drowchn3")
	!PartyHasItem("drowplt1")
	!PartyHasItem("drowplt2")
	!PartyHasItem("drowplt3")
	!PartyHasItem("drowshd1")
	!PartyHasItem("drowshd2")
	!PartyHasItem("drowshd3")
THEN
	RESPONSE #100
		SetGlobal("TUDrowItems","Global",0)
		SetGlobal("TUDrowTimReset","Global",1)
END

IF
	GlobalGT("TUDrowChecking","Global",0)
	Global("TUDrowItems","Global",1)
THEN
	RESPONSE #100
		SetGlobal("TUDrowTimReset","Global",2)
END

Edited by Turambar, 03 November 2010 - 12:57 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#9 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 November 2010 - 03:42 AM

I'll re-write the questions I have, as some have been already solved/answered, and they were quite messy:
1 - Are there any problems if the same variable is modified twice in the same script round (eg, due to a Continue() action)?

2 - What trigger can I use, which can be described like this? "A certain target is hit by a certain spell; even if the spell did nothing to him, the trigger should be true, but if he was outside the area of the spell, it should be false" The "did nothing to him" condition is the less important. I was thinking of adding to the effect a change stat effect, but are there any unused stats, I can use for that?

3 - a weapon casts a particular spell when it hits, but that spell should only work if there is sun (same conditions as script in former post). Every weapon should cast the spell onto its own wielder. Same happens for the armor, whenever it's hit. I've seen that spell effects can have timing mode 10:trigger, but how does that work?

TIA for any help

Edited by Turambar, 03 November 2010 - 03:49 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#10 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 03 November 2010 - 04:05 AM

I'll re-write the questions I have, as some have been already solved/answered, and they were quite messy:
1 - Are there any problems if the same variable is modified twice in the same script round (eg, due to a Continue() action)?

If you use Continue() when changing something, the changes typically do not take effect until the script has restarted, or thereabouts. You can't use e.g.
IF 
  G("somevar",0)
THEN
  RESPONSE #100
    SetGlobal("somevar","GLOBAL",1)
    Continue()
END 

IF 
  G("somevar",1)
THEN
  RESPONSE #100
    //some actions
END
and expect to have the second block run in the same script round as the first block. It's got something to do with actions being queued up and Continue() making the script engine look for more true trigger sets instead of processing the queue, or something like that. (My knowledge of the exact workings is hazy.)

#11 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 November 2010 - 04:13 AM

If you use Continue() when changing something, the changes typically do not take effect until the script has restarted, or thereabouts. You can't use e.g.

IF 
  G("somevar",0)
THEN
  RESPONSE #100
    SetGlobal("somevar","GLOBAL",1)
    Continue()
END 

IF 
  G("somevar",1)
THEN
  RESPONSE #100
    //some actions
END
and expect to have the second block run in the same script round as the first block. It's got something to do with actions being queued up and Continue() making the script engine look for more true trigger sets instead of processing the queue, or something like that. (My knowledge of the exact workings is hazy.)

I did suspect that; it did work sometimes, but not always. I'll check all my scripts then. Thanks!

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#12 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 November 2010 - 08:43 AM

I might have found a solution for the second question (could you please tell me if you believe it could work), but I still don't have a clue on how to have a weapon which only casts a spell at night or in dungeons and whenever it hits.

Isn't there any trigger which changes the active creature of the script (something similar to what action_override allows for actions)?

Edited by Turambar, 03 November 2010 - 08:56 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#13 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 03 November 2010 - 07:51 PM

2 - What trigger can I use, which can be described like this? "A certain target is hit by a certain spell; even if the spell did nothing to him, the trigger should be true, but if he was outside the area of the spell, it should be false" The "did nothing to him" condition is the less important. I was thinking of adding to the effect a change stat effect, but are there any unused stats, I can use for that?

I'm pretty sure DS uses all available stats. Changing the target's specifics value would probably work, but keep in mind that each creature can only have a single specifics value at a time, so this might limit compatibility. If your script runs on the target, you can use local variables (see: SR's Glitterdust), which don't suffer from these problems.

3 - a weapon casts a particular spell when it hits, but that spell should only work if there is sun (same conditions as script in former post). Every weapon should cast the spell onto its own wielder. Same happens for the armor, whenever it's hit. I've seen that spell effects can have timing mode 10:trigger, but how does that work?

I think you'd need to involve a script to determine the time of day and whether you were outdoors. One solution would be to add a block to the scripts of all potential targets that would periodically check to see if it was dark. If it was, the target would receive immunity to the .spl your item applies until the time of the next check.

Edited by Mike1072, 03 November 2010 - 07:53 PM.


#14 Turambar

Turambar
  • Modder
  • 935 posts

Posted 04 November 2010 - 09:04 AM

I'm pretty sure DS uses all available stats. Changing the target's specifics value would probably work, but keep in mind that each creature can only have a single specifics value at a time, so this might limit compatibility. If your script runs on the target, you can use local variables (see: SR's Glitterdust), which don't suffer from these problems.

Do you mean Dark Side by DS? My specific.ids was actually quite empty.
The script actually runs in baldur.bcs; otherwise, I'd need to give a brand new script to all creatures, check that they are not changed by other scripts or dialogues; moreover, script slots are only 5. Anyway, BG2Tweaks used that script as well, and I've tried to copy it where it worked.
Concerning the specific, I used an effect with timing mode inst/limited and duration 1, so the modification should not be permanent and should only be seen for one script round (the duration is counted in script rounds, isn't it? Of course, that block will be EXTENDED_TOP). I don't think that would create much problems in just one round, even if BP relies quite a lot on specific

I think you'd need to involve a script to determine the time of day and whether you were outdoors. One solution would be to add a block to the scripts of all potential targets that would periodically check to see if it was dark. If it was, the target would receive immunity to the .spl your item applies until the time of the next check.

I'll try to use this: a spell is cast on every party member, every hour (or half hour, or... I'll see) if it's dark or dungeon, or... and so on; every round, this spell casts a new spell (opcode 232) every round which protects all creatures near the party from items shattering when used.

Edited by Turambar, 04 November 2010 - 09:28 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#15 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 04 November 2010 - 02:55 PM

Do you mean Dark Side by DS? My specific.ids was actually quite empty.

Detectable Spells, which utilizes unused stats.ids' slots.

Specifics.ids is indeed near empty, but values are being used nonetheless - I once ran a search for creatures with unidentified specific and there was a good load of them. Not that I can recall a case of specifics' value actually being checked by effect/script in vanilla game. Of course, were all mods (are they?) filling their own custom specifics into the ids file, it would have been possible to look up free slots as opposed to using hardcoded values.

every round, this spell casts a new spell (opcode 232) every round which protects all creatures near the party from items shattering when used.

Check this thread first, since 232 is somewhat buggy.

Retired from modding.


#16 Turambar

Turambar
  • Modder
  • 935 posts

Posted 05 November 2010 - 10:39 AM

Do you mean Dark Side by DS? My specific.ids was actually quite empty.

Detectable Spells, which utilizes unused stats.ids' slots.

Apparently, it uses stats.ids. Anyway, where can I find it?
edit: I've seen there's such a component in SCS, did you mean that? In that case, there shouldn't be conflicts. Actually, it's BP which uses specifics.ids much more.

Specifics.ids is indeed near empty, but values are being used nonetheless - I once ran a search for creatures with unidentified specific and there was a good load of them. Not that I can recall a case of specifics' value actually being checked by effect/script in vanilla game. Of course, were all mods (are they?) filling their own custom specifics into the ids file, it would have been possible to look up free slots as opposed to using hardcoded values.

As I suggest my mod to be installed quite late, I'll find any slot which has not been touched yet. I think it's less destructive than chosing a value, that everyone else could chose, even in new mods.

every round, this spell casts a new spell (opcode 232) every round which protects all creatures near the party from items shattering when used.

Check this thread first, since 232 is somewhat buggy.

Uh, that looks quite annoying, unless the new .exe patches have done miracles. Thanks for reporting that! I don't know what else I can do, though...

edit: never underestimate Taimon and Ascension: as written in the last posts you linked me and here, Tobex 12 fixes it!

Edited by Turambar, 05 November 2010 - 11:13 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#17 Turambar

Turambar
  • Modder
  • 935 posts

Posted 07 November 2010 - 11:45 AM

Just another question: do you know how probability1 and probability2 work?
I've read somewhere that the effect works if prob2<(d100)<=prob1. Is that true?
So, if I have two effects, one with p2=0 and p1=60, the other p2=60, p1=100, will always one of the two work?

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#18 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 07 November 2010 - 01:32 PM

Just another question: do you know how probability1 and probability2 work?
I've read somewhere that the effect works if prob2<(d100)<=prob1. Is that true?
So, if I have two effects, one with p2=0 and p1=60, the other p2=60, p1=100, will always one of the two work?

According to Nythrun, one, both, or neither could trigger. :(

#19 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 07 November 2010 - 02:22 PM

Just another question: do you know how probability1 and probability2 work? I've read somewhere that the effect works if prob2<(d100)<=prob1. Is that true? So, if I have two effects, one with p2=0 and p1=60, the other p2=60, p1=100, will always one of the two work?

According to Nythrun, one, both, or neither could trigger. :(

Um, I dunno... maybe she was on some kind of medication only talking about embedded EFFs or something, but I've never seen anything like that, and I've tested it pretty extensively with some complex staggered random effect items. You should *always* get a result with that; however, there's a small chance you could trigger both on a roll of 60. So for true staggered effects you don't want overlapping, one should be 0 to 59 and the other 60 to 99. The engine ignores 100, as the "die" rolled goes from 0 to 99. More discussion here.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#20 Turambar

Turambar
  • Modder
  • 935 posts

Posted 14 November 2010 - 02:05 AM

Two more questions:

I've read that the timings are counted in a different way between scripts and spell durations: does it mean, for instance, that a spell with duration 300 has the same duration of a global timer with duration 200? Or does it work differently? And how about opcode 272: is 'once per value seconds' counted in spell duration units (ie, once every 9 seconds = every round?)

A question about opcode 12 (damage). Damage kind is counted in a different way as in extended headers; I've also noticed that they work bitwise: 0b0 is crushing, 0b10 , 0b100 and so on are all different kinds.
Does it mean that you can sum them, to make 'compound damages' such as 'blunt/missile'? (the image in my sig came out in an attempt to get fire/fists damage; the machine didn't know if the target should die... But perhaps with better combinations it works; I don't know, though, how I can actually test it.)

Edited by Turambar, 14 November 2010 - 02:07 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg