Notes |
|
(0002795)
|
XuN
|
09-05-15 09:50
|
|
I'll add some code related to this:
Added: Field spells will fire @Create for their itemdefs/events, also @ItemCreate for characters with a 'tag.BadLoc' which will be true if they are going to be placed above any character.
If tag keeps at 1 after the @Create trigger the field will be removed like it's been doing recently.
Since fields will not be placed until they are allowed to (to avoid 'ghost' walls dissapearing), items will have a 'tag.pos' with the placement position.
You can test it in tomorrow's nightly or downloading from my dropbox here: https://www.dropbox.com/s/k1aqepw37wytzn9/SphereSvr.exe?dl=0 [^] |
|
|
(0002802)
|
Rizz
|
19-05-15 21:29
|
|
it works but only with tag.BadLoc i cannot check which char i am going to hit with the wall.
I tried this script
IF (<type>==t_spell) && (<tag0.BadLoc> == 1)
LOCAL.murati=0
FORCLIENTS 0
LOCAL.murati +=1
ENDFOR
IF (<LOCAL.murati> > 0)
src.criminal
ENDIF
ENDIF
But i get
(sphere_item_building_walls.scp,545)Point(-1,-1): trying to get a sector for point on map #0 out of bounds for this map(7168,4096). Defaulting to sector 0 of the map. |
|
|
(0002803)
|
XuN
|
19-05-15 22:40
|
|
Since fields will not be placed until they are allowed to (to avoid 'ghost' walls dissapearing), items will have a 'tag.pos' with the placement position.
That means that you cannot use it to do nothing related to position, because its not placed in the world yet. |
|
|
(0002804)
|
Rizz
|
20-05-15 12:47
(edited on: 20-05-15 12:48) |
|
Then i suggest you to add another tag such as tag.charuid that contains the uid of the char you are going to cast the wall of stone on to.
So i can set up something like:
IF (<type>==t_spell) && (<tag0.BadLoc> == 1)
IF (<serv.uid.<tag.charuid>.isplayer>) && is blue && blablabla)
src.criminal
ENDIF
ENDIF
|
|
|
(0002806)
|
XuN
|
20-05-15 13:33
|
|
field flags, by default, has spellflag_targ_xyz .. which means targetted on the ground, if you want to enable it to be targeted at players you should retrieve any character in this location.
serv.newitem=i_gold
new.attr=08090
new.p=<tag.pos>
local.chars=<new.findchars 0>
new.remove
if (<local.chars>)
src.criminal
endif
[function findchars]
forchars <dargn>// search in the given distsance
return 1//if any character is found, return true
endfor |
|