Attach(character) question.
Moderator: POL Developer
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Attach(character) question.
Under what circumstances and what type of script(s) might I want to use this function?
Re: Attach(character) question.
For characters i believe actions that the character performs should be attached to that character.
For example if they are using a skill or casting a spell it should be attached.
As a player can only have 1 script attached at a time it stops them from being able to do multiple things at once.
I figured timed scripts like poison controls could also be attached to a player, however looking through a few script bases i can't see many that take advantage of it so i can't help but feel it might have been a legacy function.
For example if they are using a skill or casting a spell it should be attached.
As a player can only have 1 script attached at a time it stops them from being able to do multiple things at once.
I figured timed scripts like poison controls could also be attached to a player, however looking through a few script bases i can't see many that take advantage of it so i can't help but feel it might have been a legacy function.
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Re: Attach(character) question.
I've never seen a skill script actually call the Attach() function though.
Re: Attach(character) question.
Skill scripts are automatically attached by the core along with item use scripts.
Re: Attach(character) question.
I wouldn't call it a legacy function. The usecases are limited sure, but since we have the possibility to detach a script we should also have the possibility to attach one. So the purpose is symmetry
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Re: Attach(character) question.
Ah.
I like symmetry.
I just can't think of a use case off the top of my head. Time to do a ZTree search of the 45+ shards I have on file to see if anyone has Attach'ed a script to a player character.
I like symmetry.
I just can't think of a use case off the top of my head. Time to do a ZTree search of the 45+ shards I have on file to see if anyone has Attach'ed a script to a player character.
Re: Attach(character) question.
I've used it when debugging stuff or creating new stuff to replace existing. Like some item use scripts that I would start off as developer level commands and such. If it fits your scripting style and situation, it can be useful.