Linking machines to controls(switch)
Posted: Fri Feb 29, 2008 8:09 pm
Hi,
Here's another tutorial by request, in this tutorial i show you how to link machines to controls, so we can active or disable machines with a control just like for zanzibar gate!
This is pretty easy but i am going to explain in depth so you can see all the possibilities.
Here is an example:
http://youtube.com/watch?v=8v20GctkI6Y
What we need:
#I will be using Entity 1.6UE
#Any mp map, preferable with already mach and ctrl(zanzibar,containement)
#Latest scnr plugin
Before starting, i am not going to explain how to add machines to a map or ctrl, if your map doesn't have mach placement, mach palette, Power Groups, control palette and control placement reflexive on scnr, first inject the tags of the palettes and then copy the reflexives from the map that has it to you map, i highly recomend to take zanzibar ctrl, mach and Power Groups to start as there's a single one and it's pretty easy to add.
Setting up Power Groups
Now you have mach placement, mach palette, Power Groups, control palette and control placement reflexive on scnr
And the tags of course, we are going to link the machine to the control.
Open scnr on the meta editor
Go to Power Groups
If you took zanzibar's power gorup you should have one chunk, a power group is used to link our control and machine, in fact this is going to constatly mezmorize a position, on or off (1 or 0)
The control and the machine are going to be linked to a power group name, which is our chunk here, when the control is turned on it is going to "send the signal" to the power group and set the power group on, the machine will then take the position that the device group has, simple as this.
Of course bungie could have directly linked the mach to a control, but this is much more useful because we can use a control to enable several machines at the same time.
You will also note that a power group chunk has a name, each name must be unique on this reflexive of course, just like script objects.
The name of the power group can be used on scripts, we can use this to know the position of a power group(so a control and a machine) so something happens when the control is turned on(using a continous script type) or we can turn on or turn off the powergroup(and so the control and machine) with a script.
Useful isn't it? you can then imagine a lot of posibilities.
Also control placement chunks and machine can be referenced on scripts object so you can reference the machine and control on scripts too, the name is just the second value on the placement reflexive.
Right, now name your group to wharever you want, don't use spaces or wreid character, just alphabetical and alphanumeric and also the underscore _ instead of spaces.
This is what Power groups reflexive looks on the meta editor:
Piston0 is the name of our power group, which can be changed and is used to reference power groups on scripts.
The intial value which can be 0 or 1 defines if the device group will be 0(off) or 1(on) when the game starts.
If the flag "use only once" is checked our device group will be only usable once, which means that we can only activate the control one time.
In this example i want to make a control linked to my machine so i can enable and disable my machine as many times as i want, so setup the chunk as i show on the image above, you can name whatever you want.
Setting up the machine
Now the machine, go to machine placement reflexive, which is just under power groups...
Select the placement chunk of the machine you want to activate with the control.
We need to link the machine placement chunk(mach spawn) to the power group, which is pretty simple just select the power group chunk on "power group chunk #"
Then you can select the "position group chunk #" which is in fact the position of our machine, 0 turned off and 1 tuned on at start, set it to 0 because we want it to be turned off so we turn it on with the control.
The unique ID, this is some apart, but really important, each placement chunk needs to have a unique ID so the spawn is sycn on system link and it updates the status of the object on system link.
When you clone placement chunks you will need to create a unique ID for each cloned chunk because if there is the same unique id several time on the placement chunks those new cloned chunks won't spawn the object on system link for the players(only for host) so i usualy simply set the unique ID to the chunk number, that way i make sure it will work.
Setting up the control
Now go to control placement(just under machine placement), select the control placement chunk you want to link to your machine.
We need to link the ctrl placement chunk(ctrl spawn) to the power group, which is pretty simple just select the power group chunk on "power group chunk #" which must be the same as you choose for the machine you wanted to control with this switch.
Then you can select the "position group chunk #" which is in fact the position of control (or switch,call it whatever you want), 0 turned off and 1 tuned on at start, set it to 0 because we want it to be turned off so we turn it on and the machine will be enabled.
Same for the Unique ID just like for we did for mach, as you can see placement reflexive have all almost the same structure.
That's it, you have successfully made a machine controled by a switch.
Now if you want to add more just clone the chunks, power ground, machine placement and control placement, you need to make unique ID for each placement chunks so it works on syslink,rename power groups and link the mach and ctrl with power groups just like i explained.
If you have any question feel free to ask ^^
-neodosssss
Moved to main tutorials section.
~DS
Here's another tutorial by request, in this tutorial i show you how to link machines to controls, so we can active or disable machines with a control just like for zanzibar gate!
This is pretty easy but i am going to explain in depth so you can see all the possibilities.
Here is an example:
http://youtube.com/watch?v=8v20GctkI6Y
What we need:
#I will be using Entity 1.6UE
#Any mp map, preferable with already mach and ctrl(zanzibar,containement)
#Latest scnr plugin
Before starting, i am not going to explain how to add machines to a map or ctrl, if your map doesn't have mach placement, mach palette, Power Groups, control palette and control placement reflexive on scnr, first inject the tags of the palettes and then copy the reflexives from the map that has it to you map, i highly recomend to take zanzibar ctrl, mach and Power Groups to start as there's a single one and it's pretty easy to add.
Setting up Power Groups
Now you have mach placement, mach palette, Power Groups, control palette and control placement reflexive on scnr
And the tags of course, we are going to link the machine to the control.
Open scnr on the meta editor
Go to Power Groups
If you took zanzibar's power gorup you should have one chunk, a power group is used to link our control and machine, in fact this is going to constatly mezmorize a position, on or off (1 or 0)
The control and the machine are going to be linked to a power group name, which is our chunk here, when the control is turned on it is going to "send the signal" to the power group and set the power group on, the machine will then take the position that the device group has, simple as this.
Of course bungie could have directly linked the mach to a control, but this is much more useful because we can use a control to enable several machines at the same time.
You will also note that a power group chunk has a name, each name must be unique on this reflexive of course, just like script objects.
The name of the power group can be used on scripts, we can use this to know the position of a power group(so a control and a machine) so something happens when the control is turned on(using a continous script type) or we can turn on or turn off the powergroup(and so the control and machine) with a script.
Useful isn't it? you can then imagine a lot of posibilities.
Also control placement chunks and machine can be referenced on scripts object so you can reference the machine and control on scripts too, the name is just the second value on the placement reflexive.
Right, now name your group to wharever you want, don't use spaces or wreid character, just alphabetical and alphanumeric and also the underscore _ instead of spaces.
This is what Power groups reflexive looks on the meta editor:
Piston0 is the name of our power group, which can be changed and is used to reference power groups on scripts.
The intial value which can be 0 or 1 defines if the device group will be 0(off) or 1(on) when the game starts.
If the flag "use only once" is checked our device group will be only usable once, which means that we can only activate the control one time.
In this example i want to make a control linked to my machine so i can enable and disable my machine as many times as i want, so setup the chunk as i show on the image above, you can name whatever you want.
Setting up the machine
Now the machine, go to machine placement reflexive, which is just under power groups...
Select the placement chunk of the machine you want to activate with the control.
We need to link the machine placement chunk(mach spawn) to the power group, which is pretty simple just select the power group chunk on "power group chunk #"
Then you can select the "position group chunk #" which is in fact the position of our machine, 0 turned off and 1 tuned on at start, set it to 0 because we want it to be turned off so we turn it on with the control.
The unique ID, this is some apart, but really important, each placement chunk needs to have a unique ID so the spawn is sycn on system link and it updates the status of the object on system link.
When you clone placement chunks you will need to create a unique ID for each cloned chunk because if there is the same unique id several time on the placement chunks those new cloned chunks won't spawn the object on system link for the players(only for host) so i usualy simply set the unique ID to the chunk number, that way i make sure it will work.
Setting up the control
Now go to control placement(just under machine placement), select the control placement chunk you want to link to your machine.
We need to link the ctrl placement chunk(ctrl spawn) to the power group, which is pretty simple just select the power group chunk on "power group chunk #" which must be the same as you choose for the machine you wanted to control with this switch.
Then you can select the "position group chunk #" which is in fact the position of control (or switch,call it whatever you want), 0 turned off and 1 tuned on at start, set it to 0 because we want it to be turned off so we turn it on and the machine will be enabled.
Same for the Unique ID just like for we did for mach, as you can see placement reflexive have all almost the same structure.
That's it, you have successfully made a machine controled by a switch.
Now if you want to add more just clone the chunks, power ground, machine placement and control placement, you need to make unique ID for each placement chunks so it works on syslink,rename power groups and link the mach and ctrl with power groups just like i explained.
If you have any question feel free to ask ^^
-neodosssss
Moved to main tutorials section.
~DS