Quote: "Light1 is a sript to turn something on (Ie make it appear), specificaly it turns on Light1"
Dude,
I know that light1 is a script, but that doesn't explain how naming the character will run that script.
Quote: "So naming the character light1, will make the character "appear" when Light1 is run"
How does naming the character light1 make it do anything?
That has nothing to do with the script that is assigned to the character.
The light1 script works when use as an AIMAIN for a light, because it uses the
lighton and
lightoff actions.
;Artificial Intelligence Script
;Header
desc = Light Toggle (On By Default)
;Triggers
:state=0:state=1
:state=1,activated=0:state=2,lighton
:state=2,activated=1:state=1,lightoff
;End of Script
As you can see from light1.fpi's code those are the only two actions it uses.
The light1 script is used by the light itself.
The light would then be named in the IFUSED of an entity (or character in the FPE)
Ususally the entity is a switch.
The switches script then calls the activateifused=1 or activateifused=0 action to make the light1 script take its action.
I mean no offense HandK, but your answer did not explain how changing the charatcers name would control a light.
Changing the name of a character does not change the script its using, and only the script can make anything happen.
EDIT
Nevermind,
after giving it more thought, the answer is obvious.
The
lighton and
lightoff actions evidently call the default name of
light1 internally in the program.
So, the lighton/lightoff actions themselves activate anything named light1.
Ok Merranvo, I guess you can teach an old dog new tricks...er hacks.
Use his method Blaze, its better than mine.
Its actually a very clever way of killing both birds with one stone.
Second Edit
NOPE... The default name for a light is Light, so I retract my agreement.
I tried the naming the character light1 thing, and got nowhere.
I am going back to my first idea, but I might use ambience to simplify it.
Blaze,
Tell me which character and script you are using, and I will try to get it working.