The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Help with "Effect x, item, x, x, x, x"
Author Message
Chris_T
Apprentice
*

Posts: 10
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2012
Reputation: 0



Post: #1
[Solved] Help with "Effect x, item, x, x, x, x"
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
(This post was last modified: 12-07-2012 11:57 PM by Chris_T.)
11-26-2012 10:40 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Help with "Effect x, item, x, x, x, x"
You don't see the effect because @create is triggered before the item is placed in the world Veryhappy
11-26-2012 09:56 PM
Find all posts by this user Like Post Quote this message in a reply
Chris_T
Apprentice
*

Posts: 10
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2012
Reputation: 0



Post: #3
RE: Help with "Effect x, item, x, x, x, x"
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.
11-27-2012 03:06 PM
Find all posts by this user Like Post Quote this message in a reply
Chris_T
Apprentice
*

Posts: 10
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2012
Reputation: 0



Post: #4
RE: Solved: Help with "Effect x, item, x, x, x, x"
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.
12-06-2012 11:59 PM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #5
RE: Help with "Effect x, item, x, x, x, x"
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 
(This post was last modified: 12-07-2012 12:48 AM by Shaklaban.)
12-07-2012 12:47 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Chris_T
Apprentice
*

Posts: 10
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2012
Reputation: 0



Post: #6
RE: Help with "Effect x, item, x, x, x, x"
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
12-07-2012 01:37 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #7
RE: Help with "Effect x, item, x, x, x, x"
replace this line:

src.throw_unholy_bone

with:

src.throw_unholy_bone <uid>
12-07-2012 01:42 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Chris_T
Apprentice
*

Posts: 10
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2012
Reputation: 0



Post: #8
RE: Help with "Effect x, item, x, x, x, x"
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
12-07-2012 02:26 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #9
RE: Help with "Effect x, item, x, x, x, x"
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
12-07-2012 11:25 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)