• 0

    posted a message on Connecting Units

    @SBeier: Go

    It was too... Sorry, late night post and clearly my brain wasn't processing what has already been covered :p

    I must be missing something in the editor... I can't seem to find any math function for the difference between two given points for the Dot Function and the Subtract Point Function.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    @SBeier: Go

    lol your code is like the proverbial rabbit hole... That code links to another Function; Point In Triangle. :D

        Options: Function
        Return Type: Boolean
        Parameters
             = No Point <Point>
             = No Point <Point>
             = No Point <Point>
             = No Point <Point>
        Grammar Text: (, , , )
        Hint Text: (None)
        Custom Script Code
        Local Variables
             = 0 <Integer>
             = 0 <Integer>
             = No Point <Point[2]>
             = 0.0 <Real[1][2]>
             = 0.0 <Real>
             = 0.0 <Real>
             = 0.0 <Real>
        Actions
            Variable - Set (No Value)[0] = ((, ))
            Variable - Set (No Value)[1] = ((, ))
            Variable - Set (No Value)[2] = ((, ))
            General - For each integer (No Value) from 0 to 1 with increment 1, do (Actions)
                Actions
                    General - For each integer (No Value) from 0 to 2 with increment 1, do (Actions)
                        Actions
                            Variable - Set (No Value)[(No Value)][(No Value)] = ((, ))
            Variable - Set (No Value) = (((No Value)[0][0] * (No Value)[1][1]) - ((No Value)[0][1] * (No Value)[0][1]))
            Variable - Set (No Value) = (lv_dot[1][1] * lv_dot[0][2] - lv_dot[0][1] * lv_dot[1][2]) / lv_d
            Variable - Set (No Value) = (lv_dot[0][0] * lv_dot[1][2] - lv_dot[0][1] * lv_dot[0][2]) / lv_d
            General - Return (lv_x >= 0) && (lv_y >= 0) && (lv_x + lv_y <= 1)
    

    Would it be that one?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    Ok, so I have almost everything in and I am guessing the part that I have missing is the part that prevents it from applying damage.

    Which comes back to Point In Square... Which I assume is also a Function that you call, the only thing close that I can find in your map is;

        Options: Function
        Return Type: Boolean
        Parameters
             = No Point <Point>
             = No Point <Point>
             = No Point <Point>
             = No Point <Point>
             = No Point <Point>
        Grammar Text:  (, , , , )
        Hint Text: (None)
        Custom Script Code
        Local Variables
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Or
                        Conditions
                            ((, , , )) == true
                            ((, , , )) == true
                            ((, , , )) == true
                Then
                    General - Return true
                Else
                    General - Return false
    

    Is that it?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    @SBeier: Go

    Awesome :) Sorry I hadn't got back on sooner, have been sick the past couple days :(

    (Point In Square((Position of (Picked unit)), ((Position of (Triggering unit)) offset by 1.0 towards ((Facing of (Triggering unit)) + 90.0) degrees), ((Position of (Triggering unit)) offset by 1.0 towards ((Facing of (Triggering unit)) - 90.0) degrees), ( == true
                                Then
                                    DamageUnit((Picked unit), (Triggering unit), damage)
    

    This part of the code doesn't make sense to me and since your Trigger properties are all messed up on my side, would you be able to recopy and paste please?

    Also, your Function DamageUnit, I can't seem to find it either.

    Is there a way I can make these regions visible so I can tell if the code is triggering or not?

    .: EDIT :.

    Oh I just noticed in your custom script you also have a Function called "AvgPoints", this eludes me also.

    I have no idea why all your code is broken on my side :S

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units
    If
    //And if the point is in the square as illustrated by the picture, damage it
                                    (Point In Square((Position of (Picked unit)), ((Position of (Triggering unit)) offset by 1.0 towards ((Facing of (Triggering unit)) + 90.0) degrees), ((Position of (Triggering unit)) offset by 1.0 towards ((Facing of (Triggering unit)) - 90.0) degrees), ( == true
                                Then
                                    DamageUnit((Picked unit), (Triggering unit), damage)
    

    I'm not understanding this part of the code... Also, the editor keeps erroring on your custom script too.

    .: EDIT :.

    I have noticed in your Triggers that you have a Function that looks to be for the way to create a rectangle region between the turrets. However it looks messed up on my side for some reason...

        Options: Function
        Return Type: Region
        Parameters
             = No Point <Point>
             = 0.0 <Real>
             = 0.0 <Real>
        Grammar Text: (, , )
        Hint Text: (None)
        Custom Script Code
        Local Variables
             = ((No Value) / 2.0) <Real>
             = ((No Value) / 2.0) <Real>
        Actions
            General - Return (Region(((X of (No Value)) - (No Value)), ((Y of (No Value)) - (No Value)), ((X of (No Value)) + (No Value)), ((Y of (No Value)) + (No Value))))
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    Thanks, I will have a look.

    Your code is very hard to read btw :p I can't understand how you have chucked so many if statements together under a single IF.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    Cheers for the map... I will look over it.

    In the meantime tho, I had figured out why my beam wasn't triggering... It was because the Unit Arc was set 0. Simple change to 360 fixed that issue.

    So all I need to look at your map for, is how you handle the damage zone.

    BTW, do you know how to offset the Beam (effect) so that it would appear say 2m above the Unit instead of from its center?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    Grrr... I have duplicated that effect verbatim and recreated the Beam ability from your map.

    It will not work for me... The beam ability doesn't trigger from what I can tell. I gave the ability to a structure and I am targeting a structure. I thought maybe it was because it needed to target a Unit, so I changed those parameters to structures and nothing :(

    Also, I can't choose the Beam ability in the script... Maybe because it doesn't have a sub command???

    .: EDIT :. Then DamageUnit((Picked unit), (Triggering unit), damage) Else

    Where did you get that from?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    @SBeier: Go

    Yeah that wouldn't work for a TD map tho :(

    Could I however make the Tower fire arc of 360deg, then when a unit comes in its range, it then does the trigger to see if the unit is crossing its beam?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    @SBeier: Go

    Awesome stuff! Cheers for the reply... I will definitely have to have a play with that and see what I can come up with. My only concern is that you mention a region trigger... This really wouldn't work if the tower placement wasn't fixed. IE if the player places a tower, how would there be a region trigger? Or can you add those with tower placement?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Connecting Units

    Hey guys,

    I've had a search around the forums and haven't quite found what I am after.

    I am creating a TD map and there is an ability that I want to make but for the life of me, can't figure it out. Basically I want a Tower to emit a beam to another Tower, then any mob that passes through that beam, gets dealt X damage. Kind of like a laser fence, but spans between the chosen towers.

    I had found some threads in regards to linking a slave unit to a master which would be good to determine host Tower to receiving tower. But I don't know how to make this variable beam deal damage to anything that crosses it.

    .: EDIT :. Just had a thought about connecting the towers. Is there a way to make a Tower auto connect and beam to another Tower of the same type WITHIN its range. So if you had 3 in the range of each other, all would have beams shooting to them?

    Posted in: Miscellaneous Development
  • To post a comment, please or register a new account.