SphereCommunity
[Solved] Help with "Effect x, item, x, x, x, x" - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: [Solved] Help with "Effect x, item, x, x, x, x" (/Thread-Solved-Help-with-Effect-x-item-x-x-x-x)



[Solved] Help with "Effect x, item, x, x, x, x" - Chris_T - 11-26-2012 10:40 AM

Hi, i'm very new and just started playing around with Sphere out of curiosity. (New to any kind of scriptingBlush)

I have been reading the Wiki and came across "EFFECT type, item_id, speed, loop, explode, colour(hue), rendermode"
http://wiki.sphere.torfo.org/index.php/EFFECT

My question is can an effect like this be added to an item?
(I have only had success with it on NPCs and players.)
For example, an item a player steps on creates a new item (I_fire). When this new i_fire is created I would of liked it to play a fire column effect.

ON=@CREATE
EFFECT type, item_id, speed, loop, explode, colour(hue), rendermode


I'm aware I could just add 2 items, one being the i_fire_column. But I was wishing to get that "rendermode" setting.

So, am I just gonna have to use to create a new item?
Can that "render" be added to an item I create?
Or can the EFFECT be added and displayed on items I create on the floor?


-Thanks for reading


RE: Help with "Effect x, item, x, x, x, x" - darksun84 - 11-26-2012 09:56 PM

You don't see the effect because @create is triggered before the item is placed in the world Veryhappy


RE: Help with "Effect x, item, x, x, x, x" - Chris_T - 11-27-2012 03:06 PM

How emberrassing, after like 30min of trying to get it to work, I just assumed it was player/npc only lol.
But thank you Darksun84. That was some helpful information.


RE: Solved: Help with "Effect x, item, x, x, x, x" - Chris_T - 12-06-2012 11:59 PM

Hi =P
Need more help with effects so ill just use/bump this post.

I'm having trouble getting NPCs to fire effect type 0 (projectile)
example: EFFECT 0,i_fx_fireball,10,16,0,044,4

I spent some time looking around in NPC scripts and found these in the community pack.

Code:
ON=@GetHit
   //Thrown Weapon Attack (unholy bones)
   IF (<DISTANCE> > 2) && (RAND(5)==0)
      SRC.TARG.EFFECT 0,i_bone_unholy,2,1
      IF (RAND(5)==0)
         SRC.DAMAGE <R15,25> <DEF.dam_physical> <UID>
      ENDIF
   ENDIF
^Champion.scp, under Dark Father (I changed "I_bone_unholy" to "i_fx_fireball" since sphere says I don't have unholy bones)
And
Code:
[EVENTS e_solen_spit]
//Acidic Spit Defense
ON=@GetHit
   REF12=<SRC>
   IF (<MANA> > 15) && (<DISTANCE> > 2)
      MANA -= 15
      TRYSRC <UID> REF12.EFFECT 0,i_fx_fireball,10,16,0,044,4
      SRC.DAMAGE <R15,25> <DEF.dam_acidic> <UID>
      SRC.SYSMESSAGELOC color_text,1071966//"The solen's damaged acid sac squirts acid!"
      SRC.SOUND snd_spell_poison
      SERV.NEWITEM i_pool_acid
      NEW.P=<SRC.P>
      NEW.ATTR=attr_decay|attr_move_never
      NEW.TIMER={4 8}
   ENDIF
   REF12=
^Todo.scp

But everything works minus the animation. When I type .xEFFECT 0,i_fx_fireball,10,16,0,044,4 in game and target something I see it. Just don't see it when its added to my test NPC.

So here I am again Blush
Could use some help on getting NPCs to fire off effects.


RE: Help with "Effect x, item, x, x, x, x" - Shaklaban - 12-07-2012 12:47 AM

PHP Code:
on=@gethit
src
.throw_unholy_bone

[function throw_unholy_bone]
ref1=<argn1>
trysrc <ref1effect 0,01b11,7,0,1,33,0
serv
.newitem i_bone_unholy
new.timer=2
new.p=<p>

[
itemdef i_bone_unholy]
id=i_bone
name
unholy bone

on
=@create
attr
=attr_move_never
timer
=6
color
=33

on
=@timer
serv
.newnpc {c_skeleton 1 c_skeleton_w_sword 1 c_skeleton_w_axe 1 c_patchwork_skeleton 1 c_liche 1 c_m_skeletonarcher 1 c_m_mummy 1 c_spectre 1 c_m_wraith 1}
new.
go = <p>
new.
timerf 200,remove
attr 
attr_decay
remove 



RE: Help with "Effect x, item, x, x, x, x" - Chris_T - 12-07-2012 01:37 AM

Thanks for the quick reply, but I still get this error.
ERROR:(Test.scp,23)Can't trysrc effect 0,01b11,7,0,1,33,0 object QWE (01fe6): invalid src uid 00
Line 23=trysrc <ref1> effect 0,01b11,7,0,1,33,0


RE: Help with "Effect x, item, x, x, x, x" - Shaklaban - 12-07-2012 01:42 AM

replace this line:

src.throw_unholy_bone

with:

src.throw_unholy_bone <uid>


RE: Help with "Effect x, item, x, x, x, x" - Chris_T - 12-07-2012 02:26 AM

Thank you very much, that works.
Sorry for the trouble.

Also wanted to ask:
I was playing around in game few hours ago, using .effect #,#... Testing the render mode and animation speeds.
Then I discovered, completely by accident "effect 4,0" (4,0-4,4). It was making my screen fade to black or white. Thought it was neat and was just wondering if any more effects exist. Wiki only shows 0-3


RE: Help with "Effect x, item, x, x, x, x" - RanXerox - 12-07-2012 11:25 AM

The EFFECT function always runs from SRC.... What that essentially means is, if you put *anything* in front of EFFECT (for example: SRC.TARG.EFFECT REF1.EFFECT OBJ.EFFECT ) that reference is removed and replaced by SRC.EFFECT