SphereServer BugTracker - SphereServer
View Issue Details
0002175SphereServerscript packpublic20-07-13 15:0805-08-13 20:54
xwerswoodx 
Ben 
normaltweakalways
resolvedfixed 
16-06-2013, 0.56b Prerelease 
0.56c Nightly 
Automated (specify build number)
None
None
0002175: Create Food Spell
Could you please save food uid to LOCAL.CREATEOBJECT1 when we use create food speel.
No tags attached.
Issue History
20-07-13 15:08xwerswoodxNew Issue
20-07-13 16:52xwerswoodxNote Added: 0001572
20-07-13 17:21BenNote Added: 0001573
20-07-13 17:34xwerswoodxNote Added: 0001574
20-07-13 17:39xwerswoodxNote Edited: 0001574bug_revision_view_page.php?bugnote_id=0001574#r504
20-07-13 17:42xwerswoodxNote Edited: 0001574bug_revision_view_page.php?bugnote_id=0001574#r505
20-07-13 19:59CorujaNote Added: 0001576
21-07-13 07:09xwerswoodxNote Added: 0001582
21-07-13 08:32CorujaNote Added: 0001583
21-07-13 09:41xwerswoodxNote Added: 0001584
21-07-13 17:06BenNote Added: 0001586
21-07-13 17:26xwerswoodxNote Added: 0001588
05-08-13 20:54BenNote Added: 0001624
05-08-13 20:54BenStatusnew => resolved
05-08-13 20:54BenFixed in Version => 0.56c Nightly
05-08-13 20:54BenResolutionopen => fixed
05-08-13 20:54BenAssigned To => Ben

Notes
(0001572)
xwerswoodx   
20-07-13 16:52   
Sorry I wrote uid, BASEID I want to say for example if I write LOCAL.CREATEOBJECT1=i_fruit_melon

And if you have a chance can you pls add ARGN3 for uid :)
(0001573)
Ben   
20-07-13 17:21   
Ok, here is the deal.
I can make it so that LOCAL.CREATEOBJECT1=i_fruit_melon will create this food instead of the default.
BUT I can't do UID in ARGN3 since the item is created after any triggers are fired.
(0001574)
xwerswoodx   
20-07-13 17:34   
(edited on: 20-07-13 17:42)
Okay thanks very much :) And maybe @effect works about second one but I am not sure :)
Edit: But effect doesn't work on Create food.

(0001576)
Coruja   
20-07-13 19:59   
[Spell 2]
DEFNAME=s_create_food
NAME=Create Food
SOUND=snd_SPELL_CREATE_FOOD
RUNES=IMY
CAST_TIME=1.5
RESOURCES=i_reag_garlic,i_reag_ginseng,i_reag_mandrake_root
RUNE_ITEM=i_rune_CREATE_FOOD
SCROLL_ITEM=i_scroll_CREATE_FOOD
FLAGS=SPELLFLAG_PLAYERONLY
EFFECT_ID=0
EFFECT=0
DURATION=0.0
MANAUSE=4
SKILLREQ=MAGERY 1.0
INTERRUPT=0.0,0.0

ON=@Success
SERV.NEWITEM {i_createfood_fruit_grapes 1 i_createfood_ham 1 i_etc 1}
NEW.CONT=<SRC.FINDLAYER.layer_pack>
SRC.SYSMESSAGE You magically create food in your backpack: <NEW.NAME> //Cliloc 1042695
SRC.SOUND 01e2


I'm using it here and it works fine. LOCAL.CREATEOBJECT would be a much better solution but maybe it will just be 100% usefull if theres a way to get the item UID (to allow choose where the item will be placed)

btw sphere default create food is a target-based spell and creates the item (food) on target location. This is not the default action for this spell, the default action (OSI) doesnt use target and create the food directly on the caster backpack (thats why I'm using this code)
(0001582)
xwerswoodx   
21-07-13 07:09   
The problem is if you type RETURN 1 it fizzle but if you don't type RETURN 1 it create cake or other foods and in the and you have 2 food in same time.
(0001583)
Coruja   
21-07-13 08:32   
I really cant remember how I solved this for now, but my script is 100% working fine. I doesnt use any return on @Success and it doesnt create 2 items, just the correct item on backpack. Maybe theres something internally on s_create_food spell that -always- create a food when you cast it on a target. Or maybe there must be a def on sphere_defs.scp to set all itemdefs that create food spell uses. I cant remember but its something like this
(0001584)
xwerswoodx   
21-07-13 09:41   
maybe spellflag_xyz created object because of this, maybe it can't be success.
(0001586)
Ben   
21-07-13 17:06   
07-07-04, kuch
- Added DEFFOOD value to sphere_defs.scp - this is a template of items you want
  to get by casting the create food spell; Yes it does not give you a great deal
  of control over what you get (ie skillbased for example), but its better than
  nothing
(0001588)
xwerswoodx   
21-07-13 17:26   
Yes you are true, I didn't see that feature, thanks.
(0001624)
Ben   
05-08-13 20:54   
Will be adding local.CreateObject1 <itemdef> to create food spell. If set, it will produce this item when the spell if done.