SC2Mapster Forums

Development > Triggers

Error message please help

  • 9 posts
    #1 Jan 31, 2013 at 17:24 UTC - 0 likes

    So I test these triggers in a small version of the map and I had no problem getting my heros to spawn after dying. I then copied the triggers into the big version and low and behold I get error messages. Can someone tell me what the heck this message means.

    Scri: Trigger error in 'gt_herodies_func':Could not get 'unit from parameter in "UnitSetPosition' [value:223#1]
    Near line 85 in gt_herodies_Func[] in MapScriptgalaxy

    Scri:Trigger error in gt_herodies_Func: Paramter out of bounds in GameAttributePlayersForTeam' [Value: -1. min: 1 max: 16]
    near line 87 in gt_herodies_Func[] in MapScriptGalaxy

    Scri:Trigger error in gt_herodies_Func:Could not get 'to' from parameter in 'UIDisplayMessage' [value :0]
    near line 87 in gt_herodies_Func [] in MapScriptGalaxy

    Here is my trigger Text

    hero dies
    Events
    Unit - Any Unit dies
    Local Variables
    killed unit = (Triggering unit) <Unit>
    temp group = (Empty unit group) <Unit Group>
    Conditions
    ((Unit type of (Triggering unit)) is Hero) == True
    Actions
    Variable - Set killed unit = (Triggering unit)
    UI - Display "Your Mothership was destroyed! Resp..." for (Players on team (Triggering player)) to Subtitle area
    Unit Group - Pick each unit in (Any units in (Region((Position of killed unit), 0.1)) owned by player Any Player matching Required: Item; Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
    Actions
    Unit Group - Add (Picked unit) to temp group
    General - Wait 5.0 Game Time seconds
    Unit - Revive killed unit
    Unit - Move killed unit instantly to (Start location of player (Player (Triggering player) from (Allies of player (Triggering player)))) (No Blend)
    Unit - Set (Triggering unit) Life to 400.0
    UI - Display "Your Mothership has respawned!" for (Players on team (Triggering player)) to Subtitle area

    This trigger worked perfectly on a small version of the map. I have 8 computer players and 2 human players. I am in the process of working out a dota style map with automated computers.... Perhaps too many computers? I know at some point I need to just have 2 computer AIs. but for now I thought this simple test would work.

    Last edited Jan 31, 2013 by TheAlmaity: changed markup to BBCode so that the post would be less messy
    #2 Jan 31, 2013 at 17:46 UTC - 0 likes
    Quote from onlyleviathan: Go

    Scri: Trigger error in 'gt_herodies_func':Could not get 'unit from parameter in "UnitSetPosition' [value:223#1] Near line 85 in gt_herodies_Func[] in MapScriptgalaxy

    Scri:Trigger error in gt_herodies_Func: Paramter out of bounds in GameAttributePlayersForTeam' [Value: -1. min: 1 max: 16] near line 87 in gt_herodies_Func[] in MapScriptGalaxy

    Scri:Trigger error in gt_herodies_Func:Could not get 'to' from parameter in 'UIDisplayMessage' [value :0] near line 87 in gt_herodies_Func [] in MapScriptGalaxy

    The first error means that one of the parameters doesn't match with the input. As the error says "Could not get 'unit from parameter", the specified unit is actually not a unit, thus it can't use that value and it give an error. The second one means it's out of bound. Like the error indicates, the value is -1, while it should be between 1 and 16. And the third one is just like the first one. The input doesn't match a parameter.

    Also, please put the triggers between these <<code>><</code>> so they are actually readable.

    Last edited Jan 31, 2013 by Exaken

    So basically, generally and obviously... add more rocks.
    Hope is just deferred disapointment.
    Dropbox is an easy way to share maps between project members.

    #3 Jan 31, 2013 at 17:47 UTC - 0 likes

    Well for one your using triggering player for the teams. Please look at some starter tutorials if you don't understand how the reference "triggering" is used. You also have too many useless things like a killed unit variable which isn't needed

    Last edited Jan 31, 2013 by hobbidude

    When I want your opinion...I'll give it to you!

    http://www.sc2pod.com/achievement.php?id=13361

    #4 Jan 31, 2013 at 19:14 UTC - 0 likes

    @hobbidude: Go

    Why would it not be classified as a unit? I did some modifications to the unit in the data editor but I didn't change any of it's core qualities that classify it as a unit. That is very strange, I even played the map without the respawn and it works fine. I can train the unit like any other normal unit on the map as well.

    Here is the code redone. This code is basically taken from a tutorial on how to respawn heros. I think that other variable was added for item inventories. I have put that code back in here.

    hero dies Events

    Unit - Any Unit dies
    

    Local Variables

    killed unit = (Triggering unit) <Unit>
    

    temp group = (Empty unit group) <Unit Group>
    

    Conditions

    ((Unit type of (Triggering unit)) is Hero) == True
    

    Actions

    Variable - Set killed unit = (Triggering unit)
    

    UI - Display "Your Mothership was destroyed! Resp..." for (Players on team (Triggering player)) to Subtitle area
    

    Unit Group - Pick each unit in (Any units in (Region((Position of killed unit), 0.1)) owned by player Any Player matching Required: Item; Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
    

    Actions

    Unit Group - Add (Picked unit) to temp group
    

    General - Wait 5.0 Game Time seconds
    

    Unit - Revive killed unit
    

    Unit - Move killed unit instantly to (Start location of player (Triggering player)) (No Blend)
    

    Unit - Set (Triggering unit) Life to 400.0
    

    Unit Group - Pick each unit in temp group and do (Actions)
    

    Actions

    Unit - Create one (Unit type of (Picked unit)) item in the inventory of killed unit
    

    Unit - Remove (Picked unit) from the game
    

    UI - Display "Your Mothership has respawned!" for (Players on team (Triggering player)) to Subtitle area
    

    Any help in understanding why these errors are occurring. I'm just not sure how its not registering the unit as a non-unit. I was able to get this to work in a small version of the map, but when I transferred over to my map with the modifications it started giving me the error messages.

    Last edited Jan 31, 2013 by onlyleviathan
    #5 Jan 31, 2013 at 19:40 UTC - 0 likes

    @onlyleviathan: Go

    either upload your map file or screen shot all your triggers and functions.

    Skype
    KageNinpo = SN

    My Libraries
    DialogLeaderboard & TeamSort

    My Projects
    SPACEWAR Tribute
    Infinite TD

    #6 Jan 31, 2013 at 19:49 UTC - 0 likes

    @onlyleviathan: Go

    I believe its because you're setting of life of a unit that is already dead. Also you do not need anything from your trigger that is related to "killed unit" including the variable, set variable action, pick loop, etc (ie these should be deleted entirely)

    #7 Jan 31, 2013 at 20:23 UTC - 0 likes

    @hobbidude: Go

    I had the life set to 400 because the unit was starting with 1 hp. I think there's probably something in the data editor to fix that but I haven't found it yet. However, that was on the map in which the trigger was working just fine and respawning the hero.

    #8 Jan 31, 2013 at 20:32 UTC - 0 likes

    @onlyleviathan: Go

    I basically copied the triggers from this tutorial....

    http://www.sc2mapster.com/forums/resources/tutorials/17011-complete-noobs-guide-to-dota-style-maps-part-4/

    If you think there is a simplier way to create respawns, I am all ears....

    #9 Jan 31, 2013 at 20:57 UTC - 0 likes

    @onlyleviathan: Go

    Here is a simplier version of the code, AND I still get the exact same error message that is above.

    hero dies Events

    Unit - Any Unit dies
    

    Local Variables Conditions

    ((Unit type of (Triggering unit)) is Hero) == True
    

    Actions

    General - Wait 5.0 Game Time seconds
    

    Unit - Revive (Triggering unit)
    

    Unit - Move (Triggering unit) instantly to (Start location of player (Triggering player)) (No Blend)
    

    So I realize that some other problem is going on in the map. Here is the attachment.

    Last edited Jan 31, 2013 by onlyleviathan
    Name Size MD5
    testing_mothership_defender.SC2Map 1.5 MiB ad9cc2d0190c...
  • 9 posts

You must login to post a comment. Don't have an account? Register to get one!