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:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Makemypet
Author Message
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #1
Makemypet
Hi guys,

I wish to help me create a script, since I am with some difficulties.
I have tried to make some changes in the script the necromancer and one of the amendments have been trying to add makemypet command in the system, so when the mob because he does not recognize the player as Owner.

Can you help me?
02-17-2015 12:08 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Van Glan Bloom's post
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Makemypet
02-17-2015 07:39 PM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #3
RE: Makemypet
I have add the makemypet function in the script, but him dont work =/ I hvae this :

Code:
serv.newnpc c_mound_maggots
    new.MakeMyPet
    endif
   new.flags |= statf_conjured
   new.maxhits=(<eval <local.casterability>/50>)
   new.hits=<new.maxhits>
   new.karma=-2500
   new.fame=0
   new.p=<src.p>
   new.color=<color>
   new.events +e_animate_dead
   serv.newitem i_animate_checker
   new.timer=1
   new.update
   new.MakeMyPet
  cont.targ.remove
remove
return 1
endif


[function MakeMyPet]
serv.newitem=i_memory
new.color=memory_ipet
new.link=<src>
new.cont=<uid>


[ITEMDEF i_animate_checker]
ID=i_memory
TYPE=t_eq_script
NAME=Animate Checker

ON=@Timer
finduid.<cont.tag.owner>.sysmessage @07a1 Your revenant succeeded!
else
cont.hits -= 1
cont.maxhits -= 1
  if (<cont.hits> < 0)
    cont.hits=0    
    cont.remove
  endif
timer=120  // 2 minutos
return 1

[events e_animate_dead]
ON=@NPCLookAtChar
IF (<OWNER>)
IF (<MAGERY>) && ((<NPC> == brain_monster) || (<NPC> == brain_dragon) || (<NPC> == brain_human) || (<NPC> == brain_berserk))
  attack
  return 1
endif
endif

On=@Click
Message @0035 [Summon]

ON=@Death
src.remove
02-18-2015 02:06 AM
Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #4
RE: Makemypet
I am having similar problems. None of the old scripts to generate summons manually are working and the revisions log is so jumbled as to make telling exactly what has changed almost impossible.

My versions seem to work somewhat, at least the summoning versions sometimes obey orders... but sometimes not. Also summons tend to fight each other... and if those summons belong to a GM the entire server crashes in some kind of reputation system infinite loop.

Code:
[function summon_pet]
SRC.newnpc=<ARGS>
//SRC.ACT.EVENTS -e_npc_wars
SRC.ACT.TAG.NPCAI.RACE=
SRC.act.brain=0
SRC.act.tag.owner=<src.uid>
VAR.SUID=<ACT.UID>
SRC.act.flags=00c000000
SRC.act.newitem=i_memory
SRC.ACT.ACT.COLOR=02
SRC.act.act.cont=<VAR.SUID>
SRC.act.act.link=<SRC.uid>
SRC.act.act.more2=<SRC.uid>
SRC.act.act.timer=-1
SRC.ACT.NEWITEM=i_rune_summon_creature
//SRC.ACT.ACT.LAYER=41
SRC.ACT.ACT.TYPE=t_spell
SRC.ACT.ACT.MORE2=1
SRC.ACT.ACT.MOREP=40,816
SRC.ACT.ACT.CONT=<VAR.SUID>
SRC.ACT.ACT.LINK=<SRC.UID>
SRC.ACT.ACT.TIMER=-1
SRC.ACT.ACT.ATTR=attr_decay
SRC.act.p=<src.p>
SRC.ACT.FIX
SRC.ACT.action=-1

[function f_MakeMyPet]
serv.newitem i_memory
new.color = memory_ipet
new.more1 = 04
new.more2 = <serv.time>
new.morep = <p>
new.link = <src.uid>
new.cont = <uid>


// <pet uid>.f_MakePetOf <owner uid>
[function f_MakePetOf]
serv.newitem i_memory
new.color = memory_ipet
new.more1 = 04
new.more2 = <serv.time>
new.morep = <p>
new.link = <args>
new.cont = <uid>

Has anyone actually got any working summon scripts for current Sphere?

UPDATE
Got this working as well as any of my AI work... they still fail to attack often enough but I'm tracing that bug still.

Quote:[function summon_pet]
SRC.newnpc=<ARGS>
SRC.act.tag.owner=<src.uid>
SRC.act.p=<p.POS>

//examples of "neutralizing" npc if need be
//SRC.ACT.EVENTS -e_npc_wars
//SRC.ACT.TAG0.NPCAI.RACE=
//src.act.brain=11

VAR.SUID=<ACT.UID>

//make pet
SRC.act.newitem=i_memory
SRC.act.act.color = memory_ipet
SRC.act.act.more1 = 04
SRC.act.act.more2=<serv.time>
SRC.act.act.morep=<p>
SRC.act.act.cont=<VAR.SUID>
SRC.act.act.link=<SRC.uid>
SRC.act.act.timer=-1

//make summoned
SRC.ACT.Flags |StatF_Conjured
SRC.ACT.NEWITEM=i_rune_summon_creature
SRC.ACT.ACT.LAYER=layer_spell_summon
SRC.ACT.ACT.TYPE=t_spell
SRC.ACT.ACT.MORE2=1
SRC.ACT.ACT.MOREP=40,816
SRC.ACT.ACT.CONT=<VAR.SUID>
SRC.ACT.ACT.LINK=<SRC.UID>
SRC.ACT.ACT.TIMER=<eval <src.spiritspeak>/15>+{180 240}
SRC.ACT.ACT.ATTR=attr_decay
src.act.action=-1
SRC.ACT.FIX
RETURN

The "SRC.ACT.Flags |StatF_Conjured" line gives an error but it works, it's needed to make them actually summoned. This probably has odd or unnessicary lines but it makes them act like proper summons and doesn't result in weird reputation loops breaking the world.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
(This post was last modified: 03-18-2016 10:53 AM by Anarch Cassius.)
03-18-2016 06:37 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #5
RE: Makemypet
(02-18-2015 02:06 AM)Van Glan Bloom Wrote:  I have add the makemypet function in the script, but him dont work =/ I hvae this :

Code:
serv.newnpc c_mound_maggots
    new.MakeMyPet
    endif
   new.flags |= statf_conjured
   new.maxhits=(<eval <local.casterability>/50>)
   new.hits=<new.maxhits>
   new.karma=-2500
   new.fame=0
   new.p=<src.p>
   new.color=<color>
   new.events +e_animate_dead
   serv.newitem i_animate_checker
   new.timer=1
   new.update
   new.MakeMyPet // <- MakeMyPet will require SRC to be called, here SRC is the item in which the @timer trigger (I asume this is inside a @timer) is called. Change it to: TRYSRC <cont> new.MakeMyPet
  cont.targ.remove
remove
return 1
endif


[function MakeMyPet]
serv.newitem=i_memory
new.color=memory_ipet
new.link=<src>
new.cont=<uid>


[ITEMDEF i_animate_checker]
ID=i_memory
TYPE=t_eq_script
NAME=Animate Checker

ON=@Timer
finduid.<cont.tag.owner>.sysmessage @07a1 Your revenant succeeded!
else
cont.hits -= 1
cont.maxhits -= 1
  if (<cont.hits> < 0)
    cont.hits=0    
    cont.remove
  endif
timer=120  // 2 minutos
return 1

[events e_animate_dead]
ON=@NPCLookAtChar
IF (<OWNER>)
IF (<MAGERY>) && ((<NPC> == brain_monster) || (<NPC> == brain_dragon) || (<NPC> == brain_human) || (<NPC> == brain_berserk))
  attack
  return 1
endif
endif

On=@Click
Message @0035 [Summon]

ON=@Death
src.remove

EDIT: I added the solution in a comment in the new.MakeMyPet line.
(This post was last modified: 03-18-2016 07:23 PM by XuN.)
03-18-2016 07:23 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #6
RE: Makemypet
(03-18-2016 06:37 AM)Anarch Cassius Wrote:  I am having similar problems. None of the old scripts to generate summons manually are working and the revisions log is so jumbled as to make telling exactly what has changed almost impossible.

My versions seem to work somewhat, at least the summoning versions sometimes obey orders... but sometimes not. Also summons tend to fight each other... and if those summons belong to a GM the entire server crashes in some kind of reputation system infinite loop.

Code:
[function summon_pet]
SRC.newnpc=<ARGS>
//SRC.ACT.EVENTS -e_npc_wars
SRC.ACT.TAG.NPCAI.RACE=
SRC.act.brain=0
SRC.act.tag.owner=<src.uid>
VAR.SUID=<ACT.UID>
SRC.act.flags=00c000000
SRC.act.newitem=i_memory
SRC.ACT.ACT.COLOR=02
SRC.act.act.cont=<VAR.SUID>
SRC.act.act.link=<SRC.uid>
SRC.act.act.more2=<SRC.uid>
SRC.act.act.timer=-1
SRC.ACT.NEWITEM=i_rune_summon_creature
//SRC.ACT.ACT.LAYER=41
SRC.ACT.ACT.TYPE=t_spell
SRC.ACT.ACT.MORE2=1
SRC.ACT.ACT.MOREP=40,816
SRC.ACT.ACT.CONT=<VAR.SUID>
SRC.ACT.ACT.LINK=<SRC.UID>
SRC.ACT.ACT.TIMER=-1
SRC.ACT.ACT.ATTR=attr_decay
SRC.act.p=<src.p>
SRC.ACT.FIX
SRC.ACT.action=-1

[function f_MakeMyPet]
serv.newitem i_memory
new.color = memory_ipet
new.more1 = 04
new.more2 = <serv.time>
new.morep = <p>
new.link = <src.uid>
new.cont = <uid>


// <pet uid>.f_MakePetOf <owner uid>
[function f_MakePetOf]
serv.newitem i_memory
new.color = memory_ipet
new.more1 = 04
new.more2 = <serv.time>
new.morep = <p>
new.link = <args>
new.cont = <uid>

Has anyone actually got any working summon scripts for current Sphere?

UPDATE
Got this working as well as any of my AI work... they still fail to attack often enough but I'm tracing that bug still.

Quote:[function summon_pet]
SRC.newnpc=<ARGS>
SRC.act.tag.owner=<src.uid>
SRC.act.p=<p.POS>

//examples of "neutralizing" npc if need be
//SRC.ACT.EVENTS -e_npc_wars
//SRC.ACT.TAG0.NPCAI.RACE=
//src.act.brain=11

VAR.SUID=<ACT.UID>

//make pet
SRC.act.newitem=i_memory
SRC.act.act.color = memory_ipet
SRC.act.act.more1 = 04
SRC.act.act.more2=<serv.time>
SRC.act.act.morep=<p>
SRC.act.act.cont=<VAR.SUID>
SRC.act.act.link=<SRC.uid>
SRC.act.act.timer=-1

//make summoned
SRC.ACT.Flags |StatF_Conjured
SRC.ACT.NEWITEM=i_rune_summon_creature
SRC.ACT.ACT.LAYER=layer_spell_summon
SRC.ACT.ACT.TYPE=t_spell
SRC.ACT.ACT.MORE2=1
SRC.ACT.ACT.MOREP=40,816
SRC.ACT.ACT.CONT=<VAR.SUID>
SRC.ACT.ACT.LINK=<SRC.UID>
SRC.ACT.ACT.TIMER=<eval <src.spiritspeak>/15>+{180 240}
SRC.ACT.ACT.ATTR=attr_decay
src.act.action=-1
SRC.ACT.FIX
RETURN

The "SRC.ACT.Flags |StatF_Conjured" line gives an error but it works, it's needed to make them actually summoned. This probably has odd or unnessicary lines but it makes them act like proper summons and doesn't result in weird reputation loops breaking the world.

May I ask why you keep using act on the NewNpc?! It doesn't make a lot of sense.

Code:
Serv.NewNPC=<ArgS>
New.EVENTS -e_npc_wars
New.TAG.NPCAI.RACE=
New.brain=0// Player brain?! Why? Use defaults and use your AI over defaults
New.tag.owner=<src.uid>
Local.SUID=<New.UID>
New.Flags=00c000000
Serv.newitem=i_memory
New.COLOR=02
New.cont=<Local.SUID>
New.link=<SRC.uid>
New.more2=<SRC.uid>
New.timer=-1
Serv.NEWITEM=i_rune_summon_creature
//New.LAYER=41
New.TYPE=t_spell
New.MORE2=1
New.MOREP=40,816
New.CONT=<Local.SUID>
New.LINK=<SRC.UID>
New.TIMER=-1
New.ATTR=attr_decay
New.p=<src.p>
New.FIX
New.action=-1

Not sure what you were trying to do, but this removes all those silly ACT and those yucky global vars
03-20-2016 06:16 AM
Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #7
RE: Makemypet
Quote:May I ask why you keep using act on the NewNpc?! It doesn't make a lot of sense.

I don't have a good reason, but it technically works when done in that way.

The way you used NEW in the current version of your script isn't working...

I'm getting

Quote:13:31:ERROR:(System_Necromancy.scp,47)Undefined keyword 'Flags'

13:31:ERROR:(System_Necromancy.scp,52)Non container uid=0400035fb,id=041b6

The error is in this section.
Code:
New.Flags=00c000000

Local.SUID=<New.UID>
Serv.newitem=i_memory
New.COLOR=02
New.cont=<Local.SUID>

Not sure why... those lines SHOULD work from what I can tell. New Sphere is pickier about syntax but I can't see an error.

I do want to clean this up but Sphere is being really finicky about it in the current version. I also need to look up what those MORE values actually mean if anything Smile

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
03-20-2016 06:35 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #8
RE: Makemypet
you don't need to fill all these unused values on the memory, just create the memory using correct COLOR and LINK values and it will be enough. Also there's some others tricks, like clear previous memory and call ACTION to make the NPC follow the new owner

Code:
[FUNCTION SetOwner]        //Sintax: SetOwner [player UID]
RELEASE
ACTION 067    //Wandering
IF !(<isempty <ARGS>>)
  REF1=<ARGS>
  MEMORYFIND.<REF1>.REMOVE
  ARGS=<NEW>
  SERV.NEWITEM i_memory
  NEW.COLOR <DEF.memory_ipet>
  NEW.LINK=<REF1>
  NEW.ATTR 04
  NEW.EQUIP
  NEW=<ARGS>
  ACT=<REF1>
  ACTION 06c    //Guarding
  RESENDTOOLTIP
ENDIF
03-20-2016 03:26 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #9
RE: Makemypet
First, I copied your code. But Flags should have been parsed with |= or |<flags>. You have done this long enough to know how to fix your syntax. Not trying to sound mean, but we went over this years ago.

As for the UID not setting. Called your Local.SUID Or whatever. I don't try to decyphers other coding anymore when it comes to act.act.whatever. It is a headache when New pretty much removed the need to call so many Acts.

Add in the revision of the basepacks and quite honestly, anything with an underscore or not strict almost seems foreign to me.

Coruja's code is optimal. Everyone has their own systems. My focus is helping where I can, but I eschew any usage of out of date coding practices.
(This post was last modified: 03-25-2016 09:13 AM by Khaos.)
03-25-2016 09:11 AM
Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #10
RE: Makemypet
Quote:You have done this long enough to know how to fix your syntax. Not trying to sound mean, but we went over this years ago.

New Sphere is incredibly picky about syntax to the point I'm not sure what is a bug and what is a feature. If something doesn't work in New Sphere I can't necessarily count on the old rules to be helpful.

For example, I ran some more tests... the trouble is apparently NEW gets cleared very easily. The lines in question work when they immediately follow the NEWNPC command but a call to SRC.ACT in between was somehow making NEW fail. There's no good reason that should be; I didn't make any new items. That sort of thing makes me nervous and I start second guessing every bit of codes and sticking with bizarre syntaxes just because I know they work. I happen to like the versatility and multiple nature of ACT but this does really seem like a place for NEW: I just had no idea why it wasn't working, that isn't a syntax issue I've ever seen before.

Now a lot of the syntax fixes seem logical... I had some QVAL/EVAL nests that started giving a division by zero warning because they started looking more deeply in all cases as they probably should have been all along. Other ones leave me baffled though.

I'm catching up on several years of changes all at once and if I knew how the syntax was broken I wouldn't ask.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
03-25-2016 02:07 PM
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)