• 0

    posted a message on Change color of battleship projectiles?

    I assume you mean the battlecruiser's missiles.

    Lets just do anti air missiles.
    If you look at the battlecruiser unit, you will see the effect Battlecruiser - ATA Laser Battery (Launch Missile).
    If you follow that effect, you can find the unit it is using as ammo (the Unit - Ammo Unit field). Get the actor of that unit (Battlecruiser Air Attack Missile)
    Under events, add an event
    Actor Creation
        Set Tint Color

    That should change the color of the battlecruiser's anti air missiles.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Dynamic struct arrays

    Here

    Posted in: Galaxy Scripting
  • 0

    posted a message on Dynamic struct arrays

    In one of my projects, I had a need for dynamic arrays, so I decided to implement it using the data table. I suppose this might be something other people could use, so I put the code into a seperate map, and uploaded it here.

    Many of my methods have two functions. One that returns an error code, and one that returns nothing. The one that returns nothing just calls the other one. Also, if an error occurs the method will print an error message as a debugging text message. You can disable that by setting the silent mode variable to true.

    I only implemented support for integer, boolean and unit variables as this was the only ones I needed in my project. It's not hard to make support for other types, so if someone is interested, you can either do it yourself, or poke me. I just don't want to do it if no one is interested.

    It seems to work when I used it, but I can't guarantee that it is bug free. Also, it is probally not as efficient as a normal array - it depends on how blizzard implemented the data table. The functions could be made with fewer lookups in the data table - my primary focus was getting it done with few errors.

    Ill add the map in a reply to this post since it seems I can't add attachments here.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Issue with Dynamic Region.

    The reason it doesn't work is that events are added to the trigger when the map is loaded. This means that only the region based on the initial BlueX and BlueY values is added.

    You could add a new event each time you change the region, if this doesnt happen too often. However, I dont know if it's possible to unregister events, so you will need to double check that the unit is inside the correct current region.

    Look in custom script to see how events are added. For example, if I make a new trigger called My Test Trigger and add the event that any unit enters region 001, it will look like this in custom script
    TriggerAddEventUnitRegion(gt_MyTestTrigger, null, RegionFromId(1), true);

    If you change the region often, it might be better to make a trigger check each second or so to see if new units have entered the region.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger] Trigger error cut off, can't see error?

    If you go into file->preferences->Test Document, you can set the editor to test in windowed mode and show trigger debugging window.. You should be able to read the info there.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Help with region triggers

    You add a comparison condition. Thats what you have got now. Then, if you look at the buttom of the screen, there is a text (Owner of (Triggering unit)) == 1 where some of the words are marked. Press the first ( to select the left side of the comparison, and find the Unit Type Of Unit field. That should make the left side. For the right side, you can click the red Value 2 in the buttom of the screen, and find MULE.

    Posted in: Miscellaneous Development
  • 0

    posted a message on How to: alliances

    You could always make your own dialog and use the trigger
    Player - Make player 1 treat player 2 as Ally With Shared Vision

    Posted in: Miscellaneous Development
  • 0

    posted a message on Help with region triggers

    You seem to be pretty new to triggers, so I decided to write what the above guy said as a trigger :)

    SetOwner
        Events
            Unit - Any Unit Enters Region 001
        Local Variables
        Conditions
            (Unit type of (Triggering unit)) == MULE
            (Controller of player (Owner of (Triggering unit))) == User
        Actions
            Unit Group - Pick each unit in (Any units in Region 002 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
                Actions
                    Unit - Change ownership of (Picked unit) to player (Owner of (Triggering unit)) and Change Color
            Unit - Kill (Triggering unit)

    I assume you want to kill the mule (this is the last line in the trigger)

    Posted in: Miscellaneous Development
  • 0

    posted a message on set beam position

    I have a unit which have an ability to shoot a beam to other units of the same type. I want this beam to go from and to a point on the units where there are no attachment points though.

    Since it's only one unit type, it would work if there is some way to specify an offset from an attachment point, or perhaps an absolute position from the unit's origin. (The position of both ends of the beam)

    Anyone got any good ideas?
    (The actor I assume i need to modify is my GenericAttackBase actor)

    Posted in: Miscellaneous Development
  • 0

    posted a message on Problem adding dependencies

    I have a map where I want to use stuff from the campaign, but adding the depencies seems to fuck up the editor. After I saved and loaded the map, no campaign rescources show up in the data editor. Also, campaign units I had placed in the terrain editor just doesn't show up (I can still delete them if I select them by dragging).

    What I did was: Create a new map, add Liberty (Campaign) and Liberty Story (Campaign) to the dependencies, place a couple of medics, save the map, close the map, and then finally load the map.

    Is anyone experiencing the same problem? Perhaps someone has a solution?

    Edit: I found out that if I remove the depencies Liberty Multi (Mod) and Liberty Story (Campaign), it works fine.

    Posted in: Miscellaneous Development
  • 0

    posted a message on autoattack an ally

    Hmm. I dont know if it is possible to make a weapon autocast on allies. But you could make an ability (effect - target) autocast on ally units. You can also add attack animations for that ability in the events of the actor for your unit..

    Posted in: Miscellaneous Development
  • 0

    posted a message on Creating a visual blink effect

    Hmm. yea, I'm not sure why they behave like that. but you can make the nuke explode animation happen by applying the nuke (damage) effect on your targeted unit. This will do aoe damage to people around him though, so another way is to create a dummy damage effect which deals 0 damage, and then add an event for that effect in the actor for the nuke explosion. When you want the explosion to occur, you then apply the dummy damage effect to the targeted unit.

    I already made the map to test it, so in case it helps, I uploaded it.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Incrimentable property in the data editor?

    I assume this transfer thing is some sort of channeled ability.
    To prevent two units targeting the same unit, you could make the ability put a buff on the targeted unit for the duration, and not allow the ability to target units who have this buff.

    About detecting cycles.. If you only have one chain of transfers, you could check it by applying a buff to the caster when he starts channeling, and not allow channels to units who have this buff.

    If there are multiple chains it gets more complicated though. I emagine you would have to check if starting the transfer would leed to a cycle, so you need to be able to follow the chain of transfers from your target. A way to associate a caster with his target is to have an array of units. when you then start a transfer to a unit, you put the targeted unit into an unused slot in the array, and save the index in the caster's custom value.
    Since you say you dont have a fixed max of units who can be targeted, this calls for a dynamic array - you can implement that using the data table (I'm not sure how nice that is performance wise if you need access many times pr second)
    With theese custom values pointing to the next link in the chain you can follow it and see if you end up with your original caster. If you do, you wont allow the transfer because it leeds to a cycle. Alternatively, you reach a unit who is not transfering to anyone, in which case your original caster is allowed to start a new transfer.
    Ofcourse this solusion is done in the trigger editor

    Hope that helps

    Posted in: Miscellaneous Development
  • 0

    posted a message on Creating a visual blink effect

    I didn't test this so I could be wrong, but my guess would be that actors created from triggers are considered orphan from the start.
    The actors you mentioned have an event that fire when the actor becomes orphan. It plays the death animation and destroys the actor.
    The two blink models you use only have a stand animation, so no death animation is played and you dont see any effect.
    The emp model however only has a death animation, so this is played and the actor is then destroyed.
    You could try the "create model at point" function instead.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Water Walking

    Regarding maintaining a constant flying height, you could tick "Ignore Terrain Height" in the unit flags. Then you dont need to constantly ajust it.

    In my experience, restricting where flying units can go is really anoying. If you place no fly zones, the pathing algorithm will still try to fly through them when you tell the ship to move to the other side of the island. Maby it would be possible to make the ships behave as ground units, and make an unpathable area at the edges of your island. Unloading could be a targeted ability with a range of about 2-3 yards. Then you could have a trigger check if the targeted point is on an island, and if it is, unload whatever units were in the ship.

    About the camera - you could use the zoom action in the triggers to bring it closer.. if the player uses the scroll wheel it returns to the normal view though

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