![]() |
Problem with renaming - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Problem with renaming (/Thread-Problem-with-renaming) |
Problem with renaming - Leonidas - 11-05-2016 10:39 AM Double click the rune, rename it to what you want. But it's not working. Code: ON=@DCLICK Code: [FUNCTION f_change_rune_marker_name] Only thing I cannot figure out is the "TARG.NAME=<ARGS>" part. What do I need to put there so it will rename the rune? I know targ.name isn't correct, I'm just not sure on what to put there. RE: Problem with renaming - pointhz - 11-05-2016 10:53 AM The problem is most likely in the PROMPTCONSOLE function. I never used it, so: - Is <ARGS> the player response after the PROMPTCONSOLE? - Is <TARG> the Item being DCLICK'ed? Doesn't seem like it. Try this instead: [FUNCTION rune_rename] IF (<ISEMPTY <ARGS>>) SRC.SYSMESSAGE Please type the new name you want to give the rune. ELSE SRC.SYSMESSAGE Please target the rune you want to rename to <ARGS> SRC.TARGETF f_rune_rename <ARGS> ENDIF RETURN 1 [FUNCTION f_rune_rename] IF (<ARGO.ISPLAYER>) || (!(<ARGO.ISPLAYER>) && !(<ARGO.BASEID>==i_rune_marker)) SRC.SYSMESSAGE You must target a Rune with this function. RETURN 1 ENDIF IF !(<ARGO.MOREP>) SRC.SYSMESSAGE You cant rename blank runes. RETURN 1 ENDIF ARGO.NAME=<ARGS> SRC.SYSMESSAGE The rune's name has been changed to "<ARGS>". RETURN 1 RE: Problem with renaming - Leonidas - 11-05-2016 05:02 PM Yeah I was thinking of doing it by having a target, but is there anyway to do it like sphere has it set default? The default rune, when double clicked, allows you to type into chat right after you dblclick the rune, without having to target anything. I'd leave the default way, but it sets the rune to "a recall runevesper". Doesn't really look nice. RE: Problem with renaming - Coruja - 11-05-2016 05:08 PM although ACT/TARG/ARGO works with PROMPTCONSOLE, this is not a secure way to store the rune UID since ACT/TARG/ARGO can change if you start another action while PROMPTCONSOLE callback is not sent/aborted yet to make a fully working and secure PROMPTCONSOLE you must store the ref UID in some way that it won't change, like using TAG or CTAG: Code: ON=@DClick RE: Problem with renaming - Leonidas - 11-05-2016 05:12 PM Thanks man, that worked perfectly. One last thing, how would I go about setting the durability of the rune? I noticed while tampering with the MORE1 of a rune in-game, it decreases as I recall with the rune, once it hits 0 the rune is faded. How would I go about increasing that number? I have tried increasing the MORE1 in the script but it just doesn't seem to work. Code: ON=@SPELLEFFECT RE: Problem with renaming - Coruja - 11-06-2016 02:55 PM I can't remember exactly, but I think this rune charge value comes from EFFECT on Mark spell (sphere_spells.scp) |