Page 1 of 1

Question about repsys hooklist

Posted: Thu Sep 21, 2006 3:33 am
by VeNdOr
The new hooks (OnAttack,OnHelp) are useful, but they could be very very useful if we can prevent that a player become gray by double click or a target harmful/helpful (by returning different values).

Can you add in the next core?

Posted: Thu Sep 21, 2006 6:35 am
by Austin
This functionality already exists with these hooks...
Look at the 097 distro for an example. It uses the highlight color hook.

http://svn.sourceforge.net/viewvc/pol-d ... es/repSys/

You would control it when OnHelp, OnAttack or OnDamage get triggered, then when the client pulls up the HighLightColor you would read the info set by one of those.. the above link shows a fully scripted reputation system that matches how the core's works.

Posted: Thu Sep 21, 2006 7:29 am
by VeNdOr
Austin wrote:This functionality already exists with these hooks...
Look at the 097 distro for an example. It uses the highlight color hook.

http://svn.sourceforge.net/viewvc/pol-d ... es/repSys/

You would control it when OnHelp, OnAttack or OnDamage get triggered, then when the client pulls up the HighLightColor you would read the info set by one of those.. the above link shows a fully scripted reputation system that matches how the core's works.
ok the example was helpful, because i didn't read on changelog that onattack and onhelp hooks will check on a return value.

thx for the info :)

Posted: Fri Sep 22, 2006 4:50 pm
by Shinigami

Code: Select all

exported function NameColor(mobile, seen_by)
	var color := 0;

	if ( mobile.master )
		return NameColor(mobile.master, seen_by);
...if someone creates a chain of master and slaves it could become critical ;oP

I'm sure, there are Shards having this problem in future

Shinigami, loving Pizza

Posted: Sat Sep 23, 2006 10:27 am
by Austin
The hook example script matches (mostly) how it worked in the core..
So if someone chained them, it woulda become critical in the old way and new way.

I noticed that when I worked on the hook and was like "Welp, if someone DOES do it, he will learn pretty quick not-to."

Posted: Sat Sep 23, 2006 11:29 am
by CWO
well I knew from spellcasting to avoid using a hook... I had to set most of it critical just to stop lag before the casting actually began. My spellcasting script does about 1000 instructions/cast too so it should have been quick but it apparently wasnt.

Posted: Sat Sep 23, 2006 11:39 am
by Austin
and if two npcs were set so they were each other's masters, you got a freeze :-P