Author Topic: ScriptLink usage  (Read 4837 times)

Ilmion

  • Posts: 6
  • Maggot Crusher.
    • View Profile
ScriptLink usage
« on: March 27, 2015, 04:29:14 PM »
I'm interested to know the usage of the ScriptLink.
I have joint image of usage I have found in the HammerWatch campaign.

Example 1 :
I understand that the usage here is that the random script will do one of the three outcome and the ScriptLink regroup multiple script for on outcome.
But, could we bypass the use of the ScriptLink by simply chaining the other script ?

Example 2 :
This one I do not understand. Do the ScriptLink add something that simply linking the CheckGlobalFlag to the ChangeDoodadState would not do ?

I have also seen numerous example where one script, let say GlobalEvent (LevelStart), fire multiple script around the map. And le ScriptLink regroup script in one particular section of the map.

I'm in the impression that the ScriptLink usage is to regroup script together, not much ?

Example Demo :
What is the best practice A, B or C ?

rpc190

  • Posts: 44
  • Map Maker
    • View Profile
Re: ScriptLink usage
« Reply #1 on: March 27, 2015, 07:00:47 PM »
You are correct that ScriptLink's only purpose is to group/run multiple scripts together, but I assure you it is very useful. It's kind of hard to explain, but here are some prime uses:

- You can use it for organization purposes which I think is important for more complex sections.
- You can use it for scripts that multiple events will be targeting so that you don't have to worry about linking each event to individual scripts in the group.
- It is very useful for controlling the timing of other scripts which you can't do directly with scripts such as CheckGlobalFlag CheckVariable or PlayerCount.

With respect to your example there isn't really a wrong way to do it, it's a matter of preference. Personally I would choose option B (the middle on) unless the PlaySound / ChangeDoodadState scripts were going to be run by multiple events or run multiple times.