Sikret
Jun 24 2006, 01:34 PM
This tutorial contains a false comment inside one of its codes:
QUOTE
This is a technique used to account for the pause between spellcasting. It cuts off spellcasting actions when they cannot be performed,[...] So, you might have the following block:
IF
!GlobalTimerNotExpired("castnattack","LOCALS")
HaveSpellRES("spwi999",Myself)
THEN
RESPONSE #100
SetGlobalTimer("castnattack","LOCALS",6) // Timer always set to 6, as that is the duration of the pause
SpellRES("spwi999",LastSeenBy(Myself))
END
Well, this is wrong!
As I have mentioned
elsewhere the duration of the pause is NOT 6. I don't know how many modders might have been misled by the fasle comment inside the code which says "as that is the duration of the pause", but it's now perhaps the time to let people know that it is false.
The duration of the pause varies from spell to spell (it's not 6 for every spell). I know the exact duration of the pause for each and every spell, but the easiest way to implement the correct duration of the pause is to use "SpellNoDec" instead of "ForceSpell" as it is implemented in Improved Anvil.
Baronius
Jun 24 2006, 02:23 PM
I'm sure SimDing0 will be happy to correct it, and all other sources (if any) which give incorrect information in this respect will also get updated, hopefully.
Creepin
Jun 24 2006, 05:04 PM
Mmm... I've always thought that 6 (one round) is the pause between starting of casting one spell and another, not between end of first spell and start of second (hence timer action is before casting action in action list). As length of casting time may wary, so gap between spells wary as well, which is irrelevant for purposes of determening when you could cast next spell. May be this is the case?
Sikret
Jun 24 2006, 05:39 PM
Perhaps! (It can be tested.)
Still the claim in the turtorial is explicit:
QUOTE
Timer always set to 6, as that is the duration of the pause
Which is false.
Baronius
Jun 24 2006, 06:00 PM
While Sim's comment in question may look just ambigious, and not explicitly false, it's obvious that its general interpretation will be: pause between the end of casting a spell and the start of casting the next one, which will result in malfunctioning for those who interpret it in this way.
Sikret
Jun 24 2006, 06:20 PM
I performed a test (with spells with long spell casting times) and it seems that Creepin's comment is right. If the timer is set before the spell-casting action, it works fine. Thank you, Creepin!
However, the duration of the pause is not 6 (as claimed in the tutorial), so yes, the comment in the tutorial needs to be edited, because, as it stands, it is false and misleading (though the code works).
Still, using "SpellNoDec" instead of "ForceSpell" has several other advantanges (as I have mentioned in the SpellNoDec thread here) as well as the fact that we will NOT need the timer either.
So, to optimize his tutorial, Sim would need to edit his comment inside the code and would also need to add the possibility of using "SpellNoDec" along with all of its advantages over "ForceSpell".
SimDing0
Jun 26 2006, 05:51 PM
Thanks for the comments.
Yes, the wording is slightly unclear. No, I don't think it's an emergency.
SpellNoDec shouldn't be overencouraged because it doesn't account for Nishruus draining spells, nor the player assuming control of creatures. I have to confess that I tend to get lazy and use it because editing spellbooks is such a pain, though.
I'm not entirely sure why you elected to discuss the tutorial here. I'm surprised I found this thread, actually. I don't browse here very much.
Baronius
Jun 26 2006, 06:52 PM
I believe that the issue he brought up wasn't related to your tutorial only, it was also a matter regarding the pause between spells -- which is something that can be discussed in a technical IE forum. Furthermore, I don't know whether your Scripting Tutorial has a forum (and if yes, where), for example.
Andyr
Jun 26 2006, 10:42 PM
QUOTE(Baronius @ Jun 26 2006, 06:52 PM)
I believe that the issue he brought up wasn't related to your tutorial only, it was also a matter regarding the pause between spells -- which is something that can be discussed in a technical IE forum.
In which case a more explicit topic title ("Pause between spell casting" or somesuch) would have been more useful than "Misleading tutorial".
Good work on finding that one out, though, Sikret.
Sikret
Jun 27 2006, 12:17 AM
Thank you, Andyr!
Since the title of this topic might have caused some confusions, I edited it.
The number of (IE Modding) sites I regularly browse are few. Whenever, I find something interesting or encounter a problem or have a question, I usually send it here to BWL. However, I don't send general topics to my own mods' forums here (hence the analogy of quest pack forum fails).
Sikret
Jun 27 2006, 10:54 AM
QUOTE(SimDing0 @ Jun 26 2006, 09:21 PM)
Yes, the wording is slightly unclear.
I don't think that the wording was unclear. It was clear, but plainly false.
QUOTE
No, I don't think it's an emergency.
It's up to you to decide how urgent is to correct the mistake.
QUOTE
SpellNoDec shouldn't be overencouraged because it doesn't account for Nishruus draining spells,
I think that "ForceSpell" doesn't account for Nishruus draining spells either. Since I was comparing "SpellNoDec" with "ForceSpell", your comment is off-target. My main point was that if you use "SpellNoDec" instead of "Forcespell" you will not need the timer at all.
QUOTE
I'm not entirely sure why you elected to discuss the tutorial here. I'm surprised I found this thread, actually. I don't browse here very much.
My intention was not to report anything to *you*. And you don't seem to be willing to correct your mistakes either.
SimDing0
Jun 27 2006, 12:25 PM
You do make me laugh.
Sikret
Jun 27 2006, 01:17 PM
QUOTE(Baronius)
While Sim's comment in question may look just ambigious, and not explicitly false, it's obvious that its general interpretation will be: pause between the end of casting a spell and the start of casting the next one, which will result in malfunctioning for those who interpret it in this way.
Yes, the natural interpretation of the phrase "pause between spells" is the period of time during which the caster is not casting (i.e. the time between the end of the first spell and the beginning of the second one). Honestly, I don't see how it can be interpreted in a different way, but even if we agree that the phrase is ambiguous (rather than false), such a highly ambiguous and misleading phrase needs to be edited to avoid confusions. However, it's upto Sim to decide whether to correct and optimize his tutorial or not. His attitude shows that I did the right thing by not wasting my time in another site reporting anything directly to him.
Furthermore, my point about using "SpellNoDec" instead of "ForceSpell" makes that particualr part of his tutorial entirely redundant. The code will not need to include any timer.
SimDing0
Jun 27 2006, 01:45 PM
QUOTE(Sikret @ Jun 27 2006, 01:17 PM)
Furthermore, my point about using "SpellNoDec" instead of "ForceSpell" makes that particualr part of his tutorial entirely redundant. The code will not need to include any timer.
Had you posted this anywhere else, I'd explain why this is untrue. But this is BlackWyrm, so nobody will be reading.
jastey
Jun 27 2006, 03:04 PM
QUOTE(SimDing0 @ Jun 27 2006, 03:45 PM)
QUOTE(Sikret @ Jun 27 2006, 01:17 PM)
Furthermore, my point about using "SpellNoDec" instead of "ForceSpell" makes that particualr part of his tutorial entirely redundant. The code will not need to include any timer.
Had you posted this anywhere else, I'd explain why this is untrue. But this is BlackWyrm, so nobody will be reading.
I'd be happy if you'd explain nontheless. (You could open a new thread in the Quest Pack forum, if you do not want to post here.
)
And since I posted in this thread anyway: Sikret (and everyone else), I see it as an act of courtesy to contact the author of a tutorial directly instead of pointing out a mistake publically elsewere (starting with "this tutorial contains an error"). As already stated, this thread did not begin as a pure discussion about pause between spells but as a direct critic on a specific tutorial. I assume you'll jump on me for implying that you acted impolite but that's my opinion.
SimDing0
Jun 27 2006, 04:27 PM
QUOTE(jastey @ Jun 27 2006, 03:04 PM)
QUOTE(SimDing0 @ Jun 27 2006, 03:45 PM)
QUOTE(Sikret @ Jun 27 2006, 01:17 PM)
Furthermore, my point about using "SpellNoDec" instead of "ForceSpell" makes that particualr part of his tutorial entirely redundant. The code will not need to include any timer.
Had you posted this anywhere else, I'd explain why this is untrue. But this is BlackWyrm, so nobody will be reading.
I'd be happy if you'd explain nontheless. (You could open a new thread in the Quest Pack forum, if you do not want to post here.
)
Okay, sure.
The timer's purpose isn't primarily to ensure that there's a delay when you use ForceSpell(), although it does do this. If you use Spell() without a timer, your creature casts a spell, then immediately tries to cast again. It can't legally do so, so it stands around with the action queued until it can. The timer allows you to track the standing around period, and perform other actions (throwing Melf's Minute Meteors is a classic) inbetween casting, just as the player can do. As such, the timer is similarly useful for SpellNoDec().
Avenger_teambg
Jun 27 2006, 05:10 PM
You need the timer, because it is a cast n attack stuff. If i recall correctly SpellCastNoDec has time, if you don't have a delay, the forthcoming attack will break it, no?
Sikret
Jun 27 2006, 05:28 PM
QUOTE(Avenger_teambg @ Jun 27 2006, 08:40 PM)
You need the timer, because it is a cast n attack stuff. If i recall correctly SpellCastNoDec has time, if you don't have a delay, the forthcoming attack will break it, no?
No, it won't! The forthcoming action will not start till the spell is finished.
Furthermore, I didn't start this topic to discuss "cast and attack". It was about the delay between spells and I informed everyone that they can use "SpellNoDec" without any need to a timer if they want to ensure the delay between spells.
The error which I reported from inside the tutorial was also about a false claim about the delay.
PS: Cast and attack can also be performed without the timer, but I'm not going to discuss it here and now, because this thread is about the delay only.
Creepin
Jun 27 2006, 06:40 PM
QUOTE(Baronius)
While your comment in question may look just ambigious, and not explicitly false, it's obvious that its general interpretation will be: pause between the end of casting a spell and the start of casting the next one, which will result in malfunctioning for those who interpret it in this way.
Just for the sake of objectivity: long time ago, when I was studying scripting to create my own PC combat scripts, there was 3 major sources of knowledge: Trigger tutorial by Vasqez, Action tutorial by KensaiRui (both are now integrated in IESDP) and Scripting tutorial by Ding0. I couldn't recollect now exact flow of my study, but one thing is certain: I was never, ever, having any problems with interpretation of cast'n'attack concept or mechanics, including delay between spells.
QUOTE(Sikret)
Furthermore, I didn't start this topic to discuss "cast and attack". It was about the delay between spells and I informed everyone that they can use "SpellNoDec" without any need to a timer if they want to ensure the delay between spells.
There's no any reasonable need to ensure delay between spells - game engine is perfectly doing this job on it's own. What one really need to ensure is not to waste this delay doing nothing - hence C'n'A routine and timer of 6. As the only reason of timer existance is C'n'A, it makes no sense to discuss timer but not to discuss C'n'A.
Baronius
Jun 27 2006, 07:13 PM
QUOTE
I couldn't recollect now exact flow of my study, but one thing is certain: I was never, ever, having any problems with interpretation of cast'n'attack concept or mechanics, including delay between spells.
That wasn't the point. The question (one of the questions, actually) was whether it's unclear or explicitly wrong. In my previous post, I pointed out that in case of technical problems, unclear/ambigious descriptions may result in malfunctioning in the practice.
In this concrete case, there won't be any malfunctioning probably, as most modders just copy & paste the code, and this is not a very severe issue anyway.
However, making
accurate statements/explanations is a must in technical descriptions. It's a principle, regardless the actual effects in practice. It's okay not to make a big problem from such a minor issue, however, defending it i.e. introducing it as something insignificant is not okay.
Sikret
Jun 27 2006, 08:10 PM
QUOTE(Creepin @ Jun 27 2006, 10:10 PM)
There's no any reasonable need to ensure delay between spells - game engine is perfectly doing this job on it's own.
No, if you use "ForceSpell" instead of "SpellNoDec" the game's engine will not ensure the delay. If "ForceSpell" is used the timer is needed to ensure the delay, because without it the caster will cast in improved alacrity.
The point is that people used to think that when the spell is not memorized by the spellcaster, they needed to use "forceSpell" action and consequently, it is natural that they need the timer to ensure the delay.
However, my point was that you can use"SpellNoDec" even when the spell is not memorized and "SpellNoDec" doesn't need the timer to ensure the delay.
The error in the tutorial in question was not about the code itself, but about a false comment inside the code. I don't think that the comment is ambiguous or unclear. It's plainly false.
Sikret
Sep 4 2007, 11:05 AM
QUOTE(Sikret @ Jun 27 2006, 09:58 PM)
QUOTE(Avenger_teambg @ Jun 27 2006, 08:40 PM)
You need the timer, because it is a cast n attack stuff. If i recall correctly SpellCastNoDec has time, if you don't have a delay, the forthcoming attack will break it, no?
No, it won't! The forthcoming action will not start till the spell is finished.
Furthermore, I didn't start this topic to discuss "cast and attack". It was about the delay between spells and I informed everyone that they can use "SpellNoDec" without any need to a timer if they want to ensure the delay between spells.
Since SimDing has recently linked to this post (from another forum), I need to clarify a point:
The timers he refers to exist in IA's scripts
but not for the reason he said and had in mind (i.e. not because the action will be interrupted by the forthcoming atatck and not because ensuring the pause between spells as SpellNoDec does take care of it).
The timer does something quite different. Without the timer the creature running the script will pick his target for the next action prematurely. For example, he will cast his first spell and will immediately pick his target for his second spell even though he can't yet cast it (for the pause). Consequently, if this newly and prematurely picked taregt becomes invisible during the pause, the creature will lose his target for the spell. The timer is there to ensure that the creature will not try to pick his next spell's target before its due time.
SimDing0
Sep 4 2007, 04:47 PM
QUOTE
i.e. not because the action will be interrupted by the forthcoming atatck
Actually, I said it prevents the creature immediately queuing the next action. Subtle difference. The timer's there for the reason I said.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.