I just coded some text commands with loops and targets in them, and I found out that while you have the loop and target still active you can use another text command at the same time.
That's why I'm suggesting a new character member as character.Command or character.textcmd or similar which return a boolean true/false if the character has a text command script active.
For now im fixing this problem with using an ObjProperty check in every single textcmd, but it should be alot more simple by having a member, because then you shouldn't have to Erase that property together with every return in the command.
I know this should be possible to do with a speech hook and checking if the first ASCII letter is 46 or the first letter is . but this is a suggestion.
new character member
Moderator: POL Developer
Re: new character member
Code: Select all
// This I check right after the program block.
if (!CanUseCommand(who))
return;
endif
// ....
Code: Select all
function CanUseCommand( who )
if (GetProcess(who.GetProp("#UsingCommand")))
return 0;
endif
who.SetProp("#UsingCommand", GetPid());
return 1;
endfunction
- You can specify which command(s) are restricted (use the function only in those), you couldn't do that with .textcmd member.
- Once you have implemented this to your text commands, you can easily do other nasty stuff later on.
- You don't have to wait till tomorrow to begin using this, unlike you would have to if you wait for POL devs to implement this.
Re: new character member
thank you for the tip, I wasn't thinking that I could do that with the Process ID's of the scripts
Re: new character member
Let's not forget setting the script controller etc. Can't remember offhand the full effects, aside from it linking so that any ill effects (spells for example) let's the core know who to flag as aggressor and such
Re: new character member
who.cursor Boolean True if the client has an active target cursor r/o