spawn hero once when a building is built

Druzzl

You can change this now in User CP.
Reaction score
1
how do i get say a loki to spawn once when i build a fusion core, but only on the first fusion core i build?
 

Phubar

Ultra Cool Member
Reaction score
30
Hi, you have to make it via trigger.

Code:
EVENTS
Fusion core is built
CONDITIONS
ACTIONS
Create a Loki
Disable this trigger

This trigger runs only the first time you create a core becouse the "Disable trigger" prevents it to run unless it is re-abled again. In your case you dont have any other trigger that make this able again so it will run only once.
 

Druzzl

You can change this now in User CP.
Reaction score
1
ok, so how do i set the event to target the fusion core, that's the part i'm now stumped on
 

X-maul

AKA: Demtrod
Reaction score
201
Code:
Untitled Trigger 001
    Events
        Unit - Any Unit training progress is Completed
    Local Variables
    Conditions
        (Unit type of (Triggering progress unit)) == Fusion Core
    Actions
        Unit - Create 1 Loki for player 1 at (Position of (Triggering progress unit)) using default facing (No Options)
        Trigger - Turn (Current trigger) Off
This would be your trigger
 

Druzzl

You can change this now in User CP.
Reaction score
1
THANK YOU!!! i can finally start creating my map for my buddy and myself!!
 

X-maul

AKA: Demtrod
Reaction score
201
You're welcome, but please try to understand how this works, so you can do it yourself at another time ;)
 

Druzzl

You can change this now in User CP.
Reaction score
1
lol, actually when i went in to set it up how you said, i figured out alot, i just couldn't figure out how to target a building that hadn't been built yet :)
 

Druzzl

You can change this now in User CP.
Reaction score
1
ok, here's what i changed it to (Captain Bladehero is the Loki)

Spawn Captain Bladehero
Events
Unit - Any Unit construction progress is Completed
Local Variables
Conditions
Or
Conditions
(Owner of (Triggering progress unit)) == 1
(Owner of (Triggering progress unit)) == 2
And
Conditions
(Unit type of (Triggering progress unit)) == Fusion Core
Actions
Unit - Create 1 Captain Bladerunner for player 2 at Hero Rally using default facing (No Options)
Trigger - Turn (Current trigger) Off


when testing it returns a negative 1 when it try's to spawn the unit
 

Druzzl

You can change this now in User CP.
Reaction score
1
could it be because i have them classified as a hero and i'm trying to create them as a unit?
 

Phubar

Ultra Cool Member
Reaction score
30
Cant use edior now. try changing from Cpt Bladerunner to marine and see what happens. If still give error try delete the OR an set only 2 conditions ( owner is player 1 and type is fusion core, just to try to find out wats wrong.
 

Dave312

Censored for your safe viewing
Reaction score
269
Once the trigger runs, it will turn itself off. This means if player 1 builds a fusion core and player 2 has already built a fusion core, the trigger has been turned off so it won't run when player 1 builds the fusion core, thus player 1 won't get the hero. I recommend you create two separate triggers, one for player 1 and another for player 2 which will solve this issue.
 

Druzzl

You can change this now in User CP.
Reaction score
1
so, the way it's set up, is i have 6 of them, 2 for protoss, 2 for terran, and 2 for zerg, and since my friend and i never play the two same races, i was trying to set it up for us to get the heroes but not the computers. but now the computer gets the hero, and only the terran hero's will spawn (all 6 triggers are set up the same way, just different names for the units and different spawning buildings)
 

Druzzl

You can change this now in User CP.
Reaction score
1
alright so, Augria is a specilized dark templar, and i can get this script to run, but he doesn't ever spawn... i get the message saying Hero Creating, but from my other debug trigger i don't get the message saying hero created...

Code:
Spawn Auriga
    Events
        Unit - Any Unit construction progress is Completed
    Local Variables
    Conditions
        And
            Conditions
                Or
                    Conditions
                        (Owner of (Triggering progress unit)) == 1
                        (Owner of (Triggering progress unit)) == 2
                (Unit type of (Triggering progress unit)) == Gateway
    Actions
        UI - Display "Hero Creating" for (All players) to Subtitle area
        Unit - Create 1 Auriga for player (Triggering player) at (Position of (Created unit)) using default facing (No Options)
        Unit - Enable Any experience gain for (Last created unit)
        Unit - Order (Last created unit) to ( Move targeting Hero Rally) (Replace Existing Orders)
        Trigger - Turn (Current trigger) Off

Debug trigger is as such

Code:
Debug
    Events
        Unit - Any Unit Enters (Entire map)
    Local Variables
    Conditions
        Or
            Conditions
                (Unit type of (Triggering unit)) == Lieutenant Bladehero
                (Unit type of (Triggering unit)) == Captain Bladerunner
                (Unit type of (Triggering unit)) == Auriga
                (Unit type of (Triggering unit)) == Shelak (Carrier Hero)
                (Unit type of (Triggering unit)) == Brute A Lisk
                (Unit type of (Triggering unit)) == Levi A Than
    Actions
        UI - Display "Hero Created" for (All players) to Subtitle area

here are the error's i get when it try's to create Auriga

'gt_SpawnAuriga_Func': Event response function 'EventUnitCreatedUnit' has no matching event? Near line 143 in gt_SpawnAuriga_Func[] in MapScript.galaxy

'gt_SpawnAuriga_Func': Parameter out of bounds in 'sUnitCreate' (value:-1, min 0, max 15)? Near line 4613 in libNtve_gf_CreateUnitsWithDefaultFacing[] in TriggerLibs/NativeLib.galaxy
 

Phubar

Ultra Cool Member
Reaction score
30
You have to change
Code:
Unit - Create 1 Auriga for player (Triggering player) at (Position of (Created unit)) using default facing (No Options)
to
Code:
Unit - Create 1 Auriga for player (Triggering player) at (Position of (Triggering progress unit)) using default facing (No Options)

The "Created unit" refers only to units created by trigger with "Create unit" action :)
 

Phubar

Ultra Cool Member
Reaction score
30
Found another issue :)
Change "triggering player" with "Owner of (triggering progress unit)"
 

Druzzl

You can change this now in User CP.
Reaction score
1
I'll have to try that when I get home and see if that changes anything
 

Phubar

Ultra Cool Member
Reaction score
30
It would change becouse "triggering player" doesnt mean anything in that trigger (the event involves a unit that is built not a player), so you have to refer to the player that "owns" that unit :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top