Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i_memory: where you store the mem_flags
Author Message
Rizz
Master
**

Posts: 396
Likes Given: 21
Likes Received: 14 in 9 posts
Joined: Oct 2012
Reputation: 0



Post: #11
RE: i_memory: where you store the mem_flags
Yes I know but the problem is: if i use that trigger to set timer=300, after 300 second the memory will start again with a timer of 18 and never decay.
So maybe I can use that trigger to set a tag and then put some code undert the item i_memory?
05-22-2015 09:01 PM
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: #12
RE: i_memory: where you store the mem_flags
Memories are mean to be updated every time they tick, excepting layer_criminal and a few more ones, the only way to remove them is to get rid of their flags (stored in the color value) and removing them when there's no color.

[function AddMemoryFlags]
//argn1 = Flags
// Adding to SRC's memory on this character ARGN1 flags.
ref1=<MemoryFind <src>>
ref1.color |=<argn1>

[function DelMemoryFlags]
argn = Flags
// Deleting ARGN1 flags to SRC's memory on this character.
// If no flags are left, memory will be removed
ref1 = <MemoryFind <src>>
ref1.color &=~<argn1>
if (<ref1.color> <= 0 )
ref1.remove
endif

These 2 functions may help you in the proccess of adding and removing flags, of course you'll have to use them on certain situations, for example:

ON=@CombatDelete
//src is passed from trigger to the function
DelMemoryFlags MEMORY_HARMEDBY
05-22-2015 10:01 PM
Find all posts by this user Like Post Quote this message in a reply
ForesteR
Apprentice
*

Posts: 45
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2015
Reputation: 0



Post: #13
RE: i_memory: where you store the mem_flags
(05-20-2015 05:32 PM)XuN Wrote:  This is how notoriety is being checked now.
Code:
//Predefined behs
if (<src.flags>&statf_invul)
  return 7//invul
endif
if (<src.criminal>)
  return 4//criminal
endif
if (AllowIncognito && <src.flags>&statf_incognito)//AllowIncognito is set depending on the situation
  return 3//neutral
endif
if (<region.flags>&region_flag_arena) //yes, this does exists, but it was missing in sphere_defs... i added it right now.
  return 3
endif
if (Noto_IsEvil) // i pasted this function in another post
  return 6
endif
if (Noto_IsNeutral)
  return 3
endif
//Checking mems

if (<src>!=<uid>)// no more checks for me passed this point, i'm not going to have memories of me commiting a crime so its ok to return blue.


ref1=<findmemories_with_one_of_these_flags MEMORY_SAWCRIME | MEMORY_AGGREIVED | MEMORY_HARMEDBY>
if (<ref1>)
  return 4//criminal
endif

if (<src.isinparty> && <src.isinsamepartyof <uid>>)
  return 2//green, noto_guild_same
endif
if (<src.guild>)
  if (<guild>)
    if (<src.guild>==<guild>)
       return 2
    elseif (<guild.isalliedwith <src.guild>>)
       return 2
    elseif (<guild.isatwarwith <src.guild>>)
       return 5// brown, noto_guild_War
    endif
  endif
endif
if (<src.town>)
   if (<town>)
    if (<town.isatwarwith <src.town>>)
       return 5
    endif
  endif
endif

endif
return 1

Can u post the custom functions?
06-19-2015 05:16 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: #14
RE: i_memory: where you store the mem_flags
Which custom functions? I don't get what do you mean with 'custom'.
06-19-2015 05:55 AM
Find all posts by this user Like Post Quote this message in a reply
ForesteR
Apprentice
*

Posts: 45
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2015
Reputation: 0



Post: #15
RE: i_memory: where you store the mem_flags
findmemories_with_one_of_these_flags, isinsamepartyof, isalliedwith, isatwarwith
(This post was last modified: 06-19-2015 08:41 AM by ForesteR.)
06-19-2015 06:37 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)