- Joined
- Jul 27, 2015
- Messages
- 35
Hi folks,
I feel like I'm going in circles and I'm trying to get to the bottom of this. So any pre-placed unit, region, destructable etc. gets assigned to a gg_something variable when the map is created, right - this also is true for a LUA map as far as I understand.
This variable name can be used to refer to specific, pre-placed objects in your script. In my example, the gate blocking the entrance to an area. I want to open it with this line of script
I've derived this name by converting a JASS trigger to custom script, though I am scripting in LUA to be clear. See attached image of the object placed in editor, to sense check I got the name right!
Anyway, this script is simply not working - my debugger is telling me I'm trying to refer to a nil global, which suggests to me I have the variable name wrong!
So my questions are as follows:
1. Have I used the correct global variable name in this instance?
2. Is there a way to view in the editor what global variable name will be allocated to a given object?
3. Has someone (i couldn't find it) compiled the logic for the naming of these variables somewhere?
Bonus. Is this the wrong approach? Could I be generating these gates at runtime? If so, how would I best determine the coordinates to use... experiment and hard code them?
Many thanks for your attention. I'm quite frustrated and feeling stuck.
I feel like I'm going in circles and I'm trying to get to the bottom of this. So any pre-placed unit, region, destructable etc. gets assigned to a gg_something variable when the map is created, right - this also is true for a LUA map as far as I understand.
This variable name can be used to refer to specific, pre-placed objects in your script. In my example, the gate blocking the entrance to an area. I want to open it with this line of script
Code:
ModifyGateBJ(bj_GATEOPERATION_OPEN, gg_dest_DTg7_0001)
I've derived this name by converting a JASS trigger to custom script, though I am scripting in LUA to be clear. See attached image of the object placed in editor, to sense check I got the name right!
Anyway, this script is simply not working - my debugger is telling me I'm trying to refer to a nil global, which suggests to me I have the variable name wrong!
So my questions are as follows:
1. Have I used the correct global variable name in this instance?
2. Is there a way to view in the editor what global variable name will be allocated to a given object?
3. Has someone (i couldn't find it) compiled the logic for the naming of these variables somewhere?
Bonus. Is this the wrong approach? Could I be generating these gates at runtime? If so, how would I best determine the coordinates to use... experiment and hard code them?
Many thanks for your attention. I'm quite frustrated and feeling stuck.
