I am working on adding a custom condition to my map because I couldn't find any condition that satisfies my need. I did it using custom script.
This condition checks for 6 different units one grid block to the left.
I keep getting a syntax error. Any help would be greatly appreciated. I am very new to the editor. And sorry for the large block of code. It is just defining a region to the left of a unit and counting each of the types of units I am looking for.
You know if its i GUI you can select all and Copy as text then paste here between double <> , <code> </code> tags, even if its in galaxy it would somehow help because there is no way some one will read this. Btw tell us what you trying to achieve because this clearly looks like overdone
<WallWest
Options: Condition, Custom Script
Return Type: Boolean
Parameters
unit = No Unit <Unit>
Grammar Text: WallWest(unit)
Hint Text: looks if there are any walls to west
Custom Script Code:
big block above>
What I am trying to achieve is to take a unit as the parameter and check one grid space to the left of it for another wall type to basically make a length of wall look proper when a user makes it. The user places a single wall that is facing one direction that wall is loaded into the data table and then another process runs through all the currently built walls and checks if a replacement needs to be done with a proper model. basically places models that face one direction or another or corners as needed with the right facing. That is where this current condition comes in. The wall of code is all in custom script and basically the whole condition. I have a possible workaround for the syntax error I would just use the gui to select the triggers and set it up that way. It just takes soooo long to do it that route.
I am working on adding a custom condition to my map because I couldn't find any condition that satisfies my need. I did it using custom script. This condition checks for 6 different units one grid block to the left.
if(UnitGroupCount(UnitGroup("wall", UnitGetOwner(lv_unit), RegionRect((PointGetX(UnitGetPosition(lv_unit) - 1.5), PointGetY(UnitGetPosition(lv_unit)), (PointGetX(UnitGetPosition(lv_unit)), PointGetY(UnitGetPosition(lv_unit))), UnitFilter(0, 0, (1 << c_targetFilterSelf) | (1 << c_targetFilterMissile), (1 << (c_targetFilterUnderConstruction - 32)) | (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive) > 0 || UnitGroupCount(UnitGroup("wall2", UnitGetOwner(lv_unit), RegionRect((PointGetX(UnitGetPosition(lv_unit) - 1.5), PointGetY(UnitGetPosition(lv_unit)), (PointGetX(UnitGetPosition(lv_unit)), PointGetY(UnitGetPosition(lv_unit))), UnitFilter(0, 0, (1 << c_targetFilterSelf) | (1 << c_targetFilterMissile), (1 << (c_targetFilterUnderConstruction - 32)) | (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive) > 0 || UnitGroupCount(UnitGroup("wall3", UnitGetOwner(lv_unit), RegionRect((PointGetX(UnitGetPosition(lv_unit) - 1.5), PointGetY(UnitGetPosition(lv_unit)), (PointGetX(UnitGetPosition(lv_unit)), PointGetY(UnitGetPosition(lv_unit))), UnitFilter(0, 0, (1 << c_targetFilterSelf) | (1 << c_targetFilterMissile), (1 << (c_targetFilterUnderConstruction - 32)) | (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive) > 0 || UnitGroupCount(UnitGroup("wall32", UnitGetOwner(lv_unit), RegionRect((PointGetX(UnitGetPosition(lv_unit) - 1.5), PointGetY(UnitGetPosition(lv_unit)), (PointGetX(UnitGetPosition(lv_unit)), PointGetY(UnitGetPosition(lv_unit))), UnitFilter(0, 0, (1 << c_targetFilterSelf) | (1 << c_targetFilterMissile), (1 << (c_targetFilterUnderConstruction - 32)) | (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive) > 0 || UnitGroupCount(UnitGroup("wall33", UnitGetOwner(lv_unit), RegionRect((PointGetX(UnitGetPosition(lv_unit) - 1.5), PointGetY(UnitGetPosition(lv_unit)), (PointGetX(UnitGetPosition(lv_unit)), PointGetY(UnitGetPosition(lv_unit))), UnitFilter(0, 0, (1 << c_targetFilterSelf) | (1 << c_targetFilterMissile), (1 << (c_targetFilterUnderConstruction - 32)) | (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive) > 0 || UnitGroupCount(UnitGroup("wall34", UnitGetOwner(lv_unit), RegionRect((PointGetX(UnitGetPosition(lv_unit) - 1.5), PointGetY(UnitGetPosition(lv_unit)), (PointGetX(UnitGetPosition(lv_unit)), PointGetYY(UnitGetPosition(lv_unit))), UnitFilter(0, 0, (1 << c_targetFilterSelf) | (1 << c_targetFilterMissile), (1 << (c_targetFilterUnderConstruction - 32)) | (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive) > 0){ return true; } else{ return false; }
I keep getting a syntax error. Any help would be greatly appreciated. I am very new to the editor. And sorry for the large block of code. It is just defining a region to the left of a unit and counting each of the types of units I am looking for.
You know if its i GUI you can select all and Copy as text then paste here between double <> , <code> </code> tags, even if its in galaxy it would somehow help because there is no way some one will read this.
Btw tell us what you trying to achieve because this clearly looks like overdone
<WallWest Options: Condition, Custom Script Return Type: Boolean Parameters unit = No Unit <Unit> Grammar Text: WallWest(unit) Hint Text: looks if there are any walls to west Custom Script Code:
big block above>
What I am trying to achieve is to take a unit as the parameter and check one grid space to the left of it for another wall type to basically make a length of wall look proper when a user makes it. The user places a single wall that is facing one direction that wall is loaded into the data table and then another process runs through all the currently built walls and checks if a replacement needs to be done with a proper model. basically places models that face one direction or another or corners as needed with the right facing. That is where this current condition comes in. The wall of code is all in custom script and basically the whole condition. I have a possible workaround for the syntax error I would just use the gui to select the triggers and set it up that way. It just takes soooo long to do it that route.