View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001693SphereServerexecutable - genericpublic21-12-09 12:2213-03-11 03:34
Reporternolok 
Assigned ToMrSugarCube 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionsuspended 
PlatformOSOS Version
Product Version20-09-2009, 0.56b Prerelease 
Target VersionFixed in Version0.56c Nightly 
Summary0001693: Problem with CanSeeLOSFlag
DescriptionHi all :)
Every time i use canseelosflag, with any flag, with advancedlos in sphere.ini set to 0,01,02 or 03, or these experimental flags (walkcheck,diagonalwalkcheck,newpositionchecks) all or some activated, so in ALL cases, it returns 0.

Waiting a response/new build :)
TagsNo tags attached.
Nightly Version20-09-2009
Experimental FlagsWalkCheck
Option FlagsNone
Internal Build Number
Attached Filesjpg file icon cansee.JPG (Attachment missing)

- Relationships

-  Notes
(0000341)
nolok (reporter)
22-12-09 10:51
edited on: 22-12-09 12:01

Now it works, but only if i use this:
<SRC.CANSEELOSFLAG 020|040|080,<UID>>
If i use: <CANSEELOSFLAG 020|040|080,<SRC.UID>>, it doesn't work. I think it's strange, because in the sphere.ini the AdvancedLos flag is set to 03 :P

// Uses the new LoS algorithm
// ADVANCEDLOS_DISABLED 0x00 // Disabled, use the old method
// ADVANCEDLOS_PLAYER 0x01 // Enabled only for players
// ADVANCEDLOS_NPC 0x02 // Enabled only for NPCs
AdvancedLos=03

EDIT: It works even if AdvancedLos setted to 0, it's a bug or it's wanted? I remember nazghul wrote that should not work without this flag, because canseelosflag uses new algorithms and so on :P

EDIT 2: If i am in gm mode, canseelosflag returns always 1, and it's correct. But, with any flag (also with 0, and with this flag it should return always 1, because i dont't set any block to the los), without the gm mode, it still returns zero :( (this time advancedlos is set to 03)

(0000345)
MrSugarCube (administrator)
02-01-10 04:30

With AdvancedLos disabled, CANSEELOSFLAG will still 'work' but the flags will be ignored (basically functions the same as CANSEELOS would).

As far as I can tell, without the flags (or flags=0), normal LOS checks will take place, so a wall would cause the function to return 0 unless the appropriate 'no-block' flags have been passed in.
(0000346)
nolok (reporter)
02-01-10 18:58

I tried also with all no-block flags, and i am really near the npc or above it.
This function doesn't work, since i have AdvancedLOS=03 and no walls or any type of obstacles between us.
(0000402)
HOCOK (reporter)
11-03-10 18:48

CanSeeLosFlag works incorrect.

NPC|Rock|Player
-------------------------
Troll|0136d|Player

All flags returning: 1
(0000854)
MrSugarCube (administrator)
22-01-11 02:56

I still can't see anything wrong with the way CANSEELOSFLAG works - is this still an issue on the latest builds?


Here's a function which may help if you can find a location where you believe the flags don't work correctly. When you use this function a number of tiles are created around your character coloured blue or red to indicate the result of CANSEELOSFLAG (blue=can see, red=cannot see).

//
// Usage: F_TestLos <Flags> <Distance=8> <Time=10>
// Flags = flags to pass to CANSEELOSFLAG (default 0)
// Distance = distance to show los (default 8)
// Time = time before items decay (default 10)
//
[FUNCTION f_testlos]
IF (<ISGM>)
    SYSMESSAGE Please switch off GM mode before using this function.
    RETURN
ENDIF

LOCAL.FLAGS = <ARGN1>
LOCAL.DIST = <ARGN2>
LOCAL.TIME = <ARGN3>
IF !(<LOCAL.DIST>)
    LOCAL.DIST = 8
ENDIF
IF (<LOCAL.TIME> < 1)
    LOCAL.TIME = 10
ENDIF

FOR x -<LOCAL.DIST> <LOCAL.DIST>
    FOR y -<LOCAL.DIST> <LOCAL.DIST>
        LOCAL.PX = <EVAL <P.X> + <LOCAL.X>>
        LOCAL.PY = <EVAL <P.Y> + <LOCAL.Y>>

        IF (<CANSEELOSFLAG <LOCAL.FLAGS>, <dLOCAL.PX>,<dLOCAL.PY>,<P.Z>,<P.MAP>>)
            LOCAL.HUE = 02
            LOCAL.CANSEE += 1
        ELSE
            LOCAL.HUE = 022
        ENDIF

        SERV.NEWITEM i_rune_alchem_4
        REF1 = <NEW.UID>
        REF1.COLOR = <LOCAL.HUE>
        REF1.TYPE = t_normal
        REF1.ATTR = attr_decay
        REF1.TIMER = <LOCAL.TIME>
        REF1.P <dLOCAL.PX>,<dLOCAL.PY>,<P.Z>,<P.MAP>

        LOCAL.COUNT += 1
    ENDFOR
ENDFOR
SYSMESSAGE Can see <dLOCAL.CANSEE>/<dLOCAL.COUNT> tiles.
RETURN
(0000855)
MrSugarCube (administrator)
22-01-11 03:07

When AdvancedLos is enabled the height of objects is taken into consideration, therefore I would expect CANSEELOS/CANSEELOSFLAG to return 1 for the Troll-Rock-Player example. In the default script pack the player (height=16) can see over the rock (height=2) to view the troll (height=23).

- Issue History
Date Modified Username Field Change
21-12-09 12:22 nolok New Issue
21-12-09 12:22 nolok Nightly Version => 20-09-2009
21-12-09 12:22 nolok Experimental Flags => WalkCheck
21-12-09 12:22 nolok Option Flags => None
21-12-09 20:30 MrSugarCube Status new => resolved
21-12-09 20:30 MrSugarCube Fixed in Version => 0.56c Nightly
21-12-09 20:30 MrSugarCube Resolution open => fixed
21-12-09 20:30 MrSugarCube Assigned To => MrSugarCube
22-12-09 10:51 nolok Status resolved => feedback
22-12-09 10:51 nolok Resolution fixed => reopened
22-12-09 10:51 nolok Note Added: 0000341
22-12-09 10:58 nolok Note Edited: 0000341
22-12-09 11:17 nolok Note Edited: 0000341
22-12-09 11:18 nolok File Added: cansee.JPG
22-12-09 11:19 nolok Note Edited: 0000341
22-12-09 11:22 nolok Note Edited: 0000341
22-12-09 11:42 nolok Note Edited: 0000341
22-12-09 11:55 nolok Note Edited: 0000341
22-12-09 11:56 nolok Note Edited: 0000341
22-12-09 12:01 nolok Note Edited: 0000341
02-01-10 04:30 MrSugarCube Status feedback => resolved
02-01-10 04:30 MrSugarCube Resolution reopened => fixed
02-01-10 04:30 MrSugarCube Note Added: 0000345
02-01-10 18:58 nolok Status resolved => feedback
02-01-10 18:58 nolok Resolution fixed => reopened
02-01-10 18:58 nolok Note Added: 0000346
11-03-10 18:48 HOCOK Note Added: 0000402
22-01-11 02:56 MrSugarCube Note Added: 0000854
22-01-11 03:07 MrSugarCube Note Added: 0000855
13-03-11 03:33 MrSugarCube Status feedback => closed
13-03-11 03:33 MrSugarCube Assigned To MrSugarCube =>
13-03-11 03:33 MrSugarCube Resolution reopened => suspended
13-03-11 03:33 MrSugarCube Fixed in Version 0.56c Nightly =>
13-03-11 03:34 MrSugarCube Assigned To => MrSugarCube
13-03-11 03:34 MrSugarCube Fixed in Version => 0.56c Nightly


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker