SphereCommunity
i_memory: where you store the mem_flags - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: i_memory: where you store the mem_flags (/Thread-i-memory-where-you-store-the-mem-flags)

Pages: 1 2


RE: i_memory: where you store the mem_flags - Rizz - 05-22-2015 09:01 PM

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?


RE: i_memory: where you store the mem_flags - XuN - 05-22-2015 10:01 PM

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


RE: i_memory: where you store the mem_flags - ForesteR - 06-19-2015 05:16 AM

(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?


RE: i_memory: where you store the mem_flags - XuN - 06-19-2015 05:55 AM

Which custom functions? I don't get what do you mean with 'custom'.


RE: i_memory: where you store the mem_flags - ForesteR - 06-19-2015 06:37 AM

findmemories_with_one_of_these_flags, isinsamepartyof, isalliedwith, isatwarwith