Page 1 of 1

SetScriptController() Detach() Attach()

Posted: Sat Apr 14, 2007 1:45 am
by zandor70
I ma very hard, I know, but I have a question.

SetScriptController(): What does esactly this command?

It is similar to Attach()

And Detach()?

Someone can explain all these 3 commands (and other related or similar)?

Posted: Sat Apr 14, 2007 2:33 am
by CWO
SetScriptController is used for the reputation system. The mobile you set as the controller will be held accountable for all helpful/harmful actions caused in that script.

Attach attaches a script to the character. There can never be more than 1 script attached to a character. Checking if a script can attach or not can be useful in making it so a player can't do more than one thing at a time.

Detach will take an attached script off of the character.

Posted: Sat Apr 14, 2007 3:17 pm
by zandor70
In past I used Detach() (but not using Attach() first) thinking that so if player logout script continue to run. I am wrong?

What happen to script if player logout?
- After an Attach() ?
- After a Detach() ?
- If I do not use Attach() or Detach() ?

There is a command to use to force script stop when player logout or to force script continue if player logout?

Posted: Fri Apr 20, 2007 3:05 am
by zandor70
mmm none know reply?

Posted: Fri Apr 20, 2007 5:01 am
by mr bubbles
Just did some testing and came up with this.

-After attach and log off, the script stops running

-If not attached in first place and log off, the script continues running

-If attached and then detached BEFORE player logs off, then the script continues running.

Posted: Fri Apr 20, 2007 8:33 am
by zandor70
Perfect... the last question.... there is some case in which pore itself Attach() script at startup?

Posted: Fri Apr 20, 2007 11:05 pm
by mr bubbles
Cant think of any script that attaches by default at log on. I mean theres logon and oncreate but they are different in that they run to completion before the player can log off anyway.

Posted: Sat Apr 21, 2007 9:15 am
by zandor70
Thx :-)