View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001978SphereServerexecutable - windows buildpublic17-06-11 06:2303-05-14 20:48
Reporterxantier 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionreopened 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001978: @spellselect triggered twice?
DescriptionI'm trying to do some checks on @select -the only way to stop magery without fizzle- but even a "return 1" doesn't prevent it to be called twice..

this is the code :

on=@spellselect
if (<findlayer.1.uid>) || (<findlayer.2.uid>)
if !((<findlayer.2.type>==t_wand) || (<findlayer.1.type>==t_wand) || (<findlayer.1.baseid>==i_spellbook)) || (<findlayer(2).uid>)
src.message @022 Your hands must be free to cast spells.
argn3=2
return 1
endif
endif


and when i try to cast spell with a weapon, it prevents casting successfully but i get "Your hands must be free to cast spells." message twice.. i tried to check it with argn3, but starting and finishing flags are same (03) and both are called even with return 1.
TagsNo tags attached.
Nightly VersionAutomated (specify build number)
Experimental FlagsNone
Option FlagsNone
Internal Build Number
Attached Files

- Relationships

-  Notes
(0001118)
babidi (reporter)
17-06-11 18:42

- Changed: Return values for @SPELLSELECT trigger. Touchup for @SELECT with spells. Different
  server behaviour can be achieved with the following RETURN values in trigger scripts:
  @SELECT
      RETURN 0 - proceed without mana, spellbook, and reagent check as if these checks were
                           successful
        RETURN 1 - Abort processing (so aborting the spell)
      RETURN 2 - proceed as normal
      RETURN 6 - like RETURN 0 (for compatibility with @SPELLSELECT)
  @SPELLSELECT
      RETURN 0 - proceed as normal
        RETURN 1 - abort processing (so aborting the spell)
      RETURN 2 - proceed as normal
      RETURN 6 - proceed without mana, spellbook, and reagent check as if these checks were
                           successful
  @SPELLSELECT will be called after @SELECT -
(0001119)
xantier (reporter)
17-06-11 19:27

RETURN 1 - abort processing (so aborting the spell)

this doesn't abort it completely. it still triggers twice. for starting (argn3=03) and for the completion (argn3=03)..
(0001125)
MrSugarCube (administrator)
18-06-11 18:23

I can't reproduce this on the latest automated build. Using your script I only see the message once, when trying to cast a spell with a sword equipped.


You should also check ARGN3 before showing any messages, to prevent CANCAST from displaying the message:

...
IF (<ARGN3> & 02)
    SRC.MESSAGE @022 Your hands must be free to cast spells.
ENDIF
RETURN 1
...
(0001128)
xantier (reporter)
18-06-11 21:01

i have to reopen this because i forgot to add an option. i have precast opened and this happens at magicf_precast. i have just tried the classic cast and it triggered once but it triggers twice on magicf_precast.
(0001129)
MrSugarCube (administrator)
18-06-11 23:12

Nothing changes here when I switch MAGICF_PRECAST on or off. Are you using the latest automated build?

Does this happen with the default script pack? Which spell(s) are you casting? Are you casting from spellbook, wand, .cast, etc?
(0001130)
xantier (reporter)
19-06-11 00:54
edited on: 19-06-11 01:02

Yes i am using latest build. It happens with all spells. I tried all sources of magic. It happens at both starting and finishing casting. Because argn3 value is 3 for both and i can't decide which one means starting casting..

according to here, argn3 is same for both stages (start-end):
http://wiki.sphere.torfo.org/index.php/@SpellSelect [^]

Actually when you d-click on the spell, it triggers once with argn3 = 3. and when target cursor appears, another one triggers with argn3 = 3 again. but these all happen immediately when you put a return 1 under @spellselect.


all the code i have under @spellselect is :

if (<argn3>==03)
if (<findlayer.1.uid>) || (<findlayer.2.uid>)
if !((<findlayer.2.type>==t_wand) || (<findlayer.1.type>==t_wand) || (<findlayer.1.baseid>==i_spellbook)) || (<findlayer(2).uid>)
src.message @022 Your hands must be free to cast spells.
return 1
endif
endif
endif

(i had tried to change the if check with argn3 and also tried to remove it but still got the same result)

here is a screenshot from game : http://i52.tinypic.com/6fczg8.png [^]

(0001133)
xantier (reporter)
19-06-11 06:59
edited on: 19-06-11 07:03

oh by the way the numbers in the screenshot (3-0-3) don't include 0. it is from another trigger. i think the problem is about same argn3 values for different stages of spell casting. implementing specific argn3 value for each stage must fix that and allow us to control all of the stages i think.

(0001139)
xantier (reporter)
20-06-11 19:43
edited on: 20-06-11 19:48

and there's one more problem about precast. this code is a part of runebook script from community pack :

ACT = <Ref1.Uid>
ACTPRV = <Ref1.UID>
ACTARG1 = 32
ACTION = 25

but it has no effect. it casts recall and target cursor appears, but it doesn't select the rune(ACT) automatically.

maybe adding actarg3 option, works like act but for precast may solve this.

(0002147)
Ben (manager)
03-05-14 20:48

I have looked into this one, and it seems things are not what it seems.
ARGN3 is really only used for 2 flags... 0x1 for testing if a spell can be casted (CANCAST, no reagent consumption) and 0x2 is used to display a fail message if it were to fail.

The 0x3 that is mentioned here as a stage flag is only a combination of the 0x1 and 0x2 flags used for other purposes... so there really isn't a "stage" flag.

I'll have another look into this to see if the whole behavior can be changed to make this work better.

- Issue History
Date Modified Username Field Change
17-06-11 06:23 xantier New Issue
17-06-11 18:42 babidi Note Added: 0001118
17-06-11 19:27 xantier Note Added: 0001119
18-06-11 18:23 MrSugarCube Note Added: 0001125
18-06-11 18:23 MrSugarCube Status new => closed
18-06-11 18:23 MrSugarCube Resolution open => unable to reproduce
18-06-11 21:01 xantier Note Added: 0001128
18-06-11 21:01 xantier Status closed => feedback
18-06-11 21:01 xantier Resolution unable to reproduce => reopened
18-06-11 23:12 MrSugarCube Note Added: 0001129
19-06-11 00:54 xantier Note Added: 0001130
19-06-11 00:54 xantier Status feedback => new
19-06-11 01:01 xantier Note Edited: 0001130 View Revisions
19-06-11 01:02 xantier Note Edited: 0001130 View Revisions
19-06-11 06:59 xantier Note Added: 0001133
19-06-11 07:03 xantier Note Edited: 0001133 View Revisions
20-06-11 19:43 xantier Note Added: 0001139
20-06-11 19:48 xantier Note Edited: 0001139 View Revisions
03-05-14 20:48 Ben Note Added: 0002147


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker