Day/Night Tower

Darkrainzodd

New Member
Reaction score
1
I have tried looking with search and i couldn't find anything that helped me. I thought this was going to be a simple thing but i can't seem to get it done. All i want is a trigger that when it becomes day time it turns every Sun Stone on the map into an Enchanted Sun Stone, then right once it turns night it turns then back and then turns every Moon Stone into an Enchanted Moon Stone. And well that's just about it. I thought it would be simple but i guess i was wrong. Any help would be great, thanks.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
would you mind telling us what exactly a "sun stone" is? is it an item? a unit? a structure? a destructible object? your pet?
please try to give us all neccessary information about your problem we are not jesus we are just geeks playing old computer games...
 

jig8c

New Member
Reaction score
1
Trigger:
  • day trigger
    • events
      • every x game-time seconds
    • conditions
    • actions
      • set daygroup = all units in playable map area matching (matching unit equal to sun stone equal to true)
      • pick every unit in daygroup and do this
        • loop
          • set point = position of picked unit
          • remove picked unit from game
          • create 1 enchanted sun stone at point facing....
          • custom script: call removelocation (udg_point)
      • custom script call destroygroup (udg_daygroup)

same thing for night!!
x in the event being how long it the night is
x in the event for night trigger is how long the days are!
 

kingkwong92

Well-Known Member
Reaction score
25
Time of day equals to xxxx

Set moon/sun_group = All units equal to sun/moon/enchanted stone
Pick every unit in moon/sun/enchanted_group and do
loop
Replace picked unit with moon/sun/enchanted stone
Custom script: call DestroyGroup(udg_moon/sun_group)


Make two triggers like this and change the time
Adjust for moon stones, sun stones, enchanted moon stones and enchanted sun stones.
 

jig7c

Stop reading me...-statement
Reaction score
123
Time of day equals to xxxx

Set moon/sun_group = All units equal to sun/moon/enchanted stone
Pick every unit in moon/sun/enchanted_group and do
loop
Replace picked unit with moon/sun/enchanted stone
Custom script: call DestroyGroup(udg_moon/sun_group)


Make two triggers like this and change the time
Adjust for moon stones, sun stones, enchanted moon stones and enchanted sun stones.

this is what i meant to tell him!! thanks for doing this
 

kingkwong92

Well-Known Member
Reaction score
25
I'm not sure if replacing a unit will bug up other variables.
Like if you had saved a sun stone in a unit variable and then you replaced it. If it does then edit the chaos ability and add it to the unit.
 

Darkrainzodd

New Member
Reaction score
1
Okay, well that worked kingkwong92, but can you please explain. I'm not a noob when it comes to triggers but i just don't see why this worked and what i was doing wasn't. I'm not used to custom scripts so i don't really get those.
 

kingkwong92

Well-Known Member
Reaction score
25
Okay, well that worked kingkwong92, but can you please explain. I'm not a noob when it comes to triggers but i just don't see why this worked and what i was doing wasn't. I'm not used to custom scripts so i don't really get those.

Well the trigger activates when the game time goes to what ever the time you set. Lets use 6.00 (day) as an example.

When the time = 6.00
///that means that it's day\\\
Set sun_group = units matching (unit type of matching unit equal to sun stone)
/// This just puts all sun stones into a group\\\
Set moon_group = Units matching (unit type of matching unit equal to enchanted moon stone)
///This puts all enchanted moon stones into a group\\\
Pick every unit in sun group and
loop
give chaos(sun) / Replace with enchanted sun stone
///This gets every sun stone and changes it to a enchanted sun stone\\\
Pick every unit in moon_group and
loop
remove chaos(moon) / Replace with moon stone
/// this get every enchanted moon stone and changes it to a moon stone\\\

Custom Script: call DestroyGroup(udg_sun_group)
Custom Script: call DestroyGroup(udg_moon_group)
///This destroys the groups so that they don't leak, another common leak are points use Custom Script: RemoveLocation(udg_<your variable>).

Hope this helped
 

Darkrainzodd

New Member
Reaction score
1
Okay i have a problem now, here are my four triggers i made off what you said. The first two are just to set them up since they are both turned off at first. And the third one works just fine, during day any Enchanted Moon Stones turn to Moon Stones and any Sun Stones turn into Enchanted ones, it will do this every 10 seconds like it should. But the forth trigger doesn't work. It will make any Enchanted Sun stones normal ones and it makes any normal Moon Stones enchanted. But it only works once as i have it set to every 10 seconds and it only does it once. Did i do something wrong?



Trigger:
  • Stone Setup 1
    • Events
      • Game - The in-game time of day becomes Equal to 6.00
    • Conditions
    • Actions
      • Trigger - Turn on Stone Enchant &lt;gen&gt;
      • Trigger - Turn off Stone Unenchant &lt;gen&gt;


Trigger:
  • Stone Setup 2
    • Events
      • Game - The in-game time of day becomes Equal to 18.00
    • Conditions
    • Actions
      • Trigger - Turn on Stone Unenchant &lt;gen&gt;
      • Trigger - Turn off Stone Enchant &lt;gen&gt;


Trigger:
  • Stone Enchant
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set sun_group = (Units of type Sun Stone)
      • Set moon_group_e = (Units of type Enchanted Moon Stone)
      • Unit Group - Pick every unit in sun_group and do (Actions)
        • Loop - Actions
          • Unit - Replace (Picked unit) with a Enchanted Sun Stone using The new unit&#039;s max life and mana
          • Custom script: call DestroyGroup(udg_sun_group)
          • Unit Group - Pick every unit in moon_group_e and do (Actions)
            • Loop - Actions
              • Unit - Replace (Picked unit) with a Moon Stone using The new unit&#039;s max life and mana
              • Custom script: call DestroyGroup(udg_moon_group_e)


Trigger:
  • Stone Unenchant
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set sun_group_e = (Units of type Enchanted Sun Stone)
      • Set moon_group = (Units of type Moon Stone)
      • Unit Group - Pick every unit in sun_group_e and do (Actions)
        • Loop - Actions
          • Unit - Replace (Picked unit) with a Sun Stone using The new unit&#039;s max life and mana
          • Custom script: call DestroyGroup(udg_sun_group_e)
          • Unit Group - Pick every unit in moon_group and do (Actions)
            • Loop - Actions
              • Unit - Replace (Picked unit) with a Enchanted Moon Stone using The new unit&#039;s max life and mana
              • Custom script: call DestroyGroup(udg_moon_group)
 

sLsIDK

New Member
Reaction score
13
All the of custom scripts you have need to be outside of the unit group loops. If you don't know how to do this just drag them directly above where it says Loop - Actions and it will move it below the group loops.
Also, you need to do the same to the second unit group loop.

Also (heh heh, sorry) I suggest using a completely different method to do this. Create a new ability and base it off of the ability Chaos. Give it four levels, level one being regular sun, level two being enchanted sun. Level three moon, level four enchanted moon. Then, directly after the map starts, add the ability to the units and if the unit is the moon stone, set the level of the ability to level 3.

Then, instead of replacing the units in your triggers, set the levels of the sun and moon stones' chaos to 2 and 4 respectively, and then back to 1 and 3 when you want them to be regular. The Chaos spell is a great spell when your units are constantly changing into other units via triggers, and it won't proc a death trigger, like replace will (I think, someone confirm this).
 

Darkrainzodd

New Member
Reaction score
1
Alright, i will do those changes and thanks for the info and help. I have never used a Chaos spell so i wasn't sure what it was. I should be able to get it done, if not i will be sure so post again >.<. Thank you again.

Okay so what i am doing is a tower defense kind of game. So people will build a Sun Stone at a random time during the game (if they are that race w/e). How would i set up the trigger and chaos ability to work with time of day such as my other trigger does?
 

kingkwong92

Well-Known Member
Reaction score
25
time equal to 6.00
day = true

time equal to 18.00
day=false

every 10 seconds

if day equal to true then
loop
...................................
If day equal to false then
loop
...................................

This is much cleaner and easier. Day is a boolean variable.
I said that it would be better using chaos but if you don't have any other triggers affecting these towers then it would save a lot of trouble by using replace unit with unit.
 

Darkrainzodd

New Member
Reaction score
1
Thanks, and yeah i have never used a Chaos ability so i didn't know what it was really. I understand that now, but what would i do still for the loop? Just change the level of the ability Chaos to whatever level i want it to be so it changes the tower? Sorry still all new to me and i just want to make sure I'm doing it right.

Okay so i just tried to do this and i am so lost lol, i guess i don't understand it really.
 

sLsIDK

New Member
Reaction score
13
Yeah, I guess you could just create a group of every unit of either type sun stone or moon stone and add one to the level of their chaos, then create a group of every enchanted one and remove a level of their chaos
 

Darkrainzodd

New Member
Reaction score
1
I just tried that and it wouldn't work. I don't know what i am doing wrong i could be doing everything wrong.
 

kingkwong92

Well-Known Member
Reaction score
25
Base it of chaos.Give it to the unit

chaos sun lvl1
Normal unit - Sun stone
Alternate unit - Enchanted sun stone

chaos sun lvl2
Normal unit - Enchanted Sun stone
Alternate unit - Sun stone

Set level of ability chaos sun for picked unit to X
 

Darkrainzodd

New Member
Reaction score
1
Thanks, i will give that a try. Hope it works, and thank you guys for all the help and sorry for all the stupid questions.
 

Darkrainzodd

New Member
Reaction score
1
Damn it all i am still doing something wrong, i am about to give up on this shit because i have no clue what is going wrong >.< this sucks.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • 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 Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top