• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Many answers I need. Help please!

Status
Not open for further replies.
Level 4
Joined
Apr 4, 2009
Messages
65
Hello! I am sorry if I ask for something that has been said earlier but I need help to make my map way better. If you can help me that would be heavily appreciated! I am fairly bad at triggers and I would appreciate it very much if you can help me with most of the code by either explaining it or screenshotting it how to make it.



What will you get:
-You will be put under credits of the map for helping me with:
"Triggers/scripts"
-My eternal appreciation!



Thing 1

I want to set a victory condition. Okay, this is easy if the unit / building that needs to get destroyed already exists. Now my problem is that it doesnt exist in the map.

For example, I want to make a menu where you pick your unit from and it spawns ( many different units you can pick ) and if this unit dies, you lose.


Thing 2

I want to set a victory condition. Same story as thing 1 except I want to make it that once you pick a game mode, a special unit will be randomly assigned to player 1-5 ( so only 1 random player gets this unit ).

If this unit dies, the whole team loses ( player 1-5 ).



Thing 3

This is something I really need to know:

I wish to make every unit invunerable ( also new ones that join ) for 2 minutes so you can't kill someone on the beginning.


Thing 4

So, this unit spawns ( this unit cannot be made only get chosen on the beginning ) how do I put stuff in their inventory once selected?


Thing 5

I have seen in newer maps, buttons that open a new menu. How do you make this?

So lets say a button thats called: Spells
If the person opens this button you can see the spells of the unit and the unit is able to use them.





If anyone can help me with this I will be eternally appreciated!
 
1)
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hash = (Last created hashtable)
  • Trugger
  • Events
    • Add the event where the player picks this unit
  • Conditions
  • Actions
    • Add the creation of unit actions
    • Hashtable - Save (Last created unit) as (Key(unit)) of (Key(Triggering Player)) in Hash
  • Trugga
  • Events
    • Unit - A unit dies
  • Conditions
    • And - Conditions
      • (Unit-type of (Triggering unit)) Equal to X
      • ((Triggering unit) is stored as a Handle of (Key(Owner of (Triggering unit))) in Hash) Equal to True
  • Actions
    • Game - Defeat (Owner of (Triggering unit))
2)
  • Trigger2
  • Events
    • Add the event here to create the unit
  • Conditions
  • Actions
    • Add the creation of unit actions here
    • Hashtable - Save (Last created unit) as (Key(specialunit)) of (Key(the player who gets it)) in Hash
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • Player Group - Add (Player(IntegerA)) in Player_Group
  • Trugga
  • Events
    • Unit - A unit dies
  • Conditions
    • And - Conditions
      • ((Triggering unit) is stored as a Handle of (Key(Owner of (Triggering unit))) in Hash) Equal to True
      • (Unit-type of (Triggering unit)) Equal to Special Unit
  • Actions
    • Player Group - Pick every player in (Player_Group) and do (Actions)
      • Loop - Actions
        • Game - Defeat (Picked Player)
3)
  • Trig
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable Map Area)) and do (Actions)
      • Loop - Actions
        • Unit - Make (Picked unit) invulnerable
4) Hero - Create Item and give it to (Last created unit)
5) It's called full screen inventory system, search it in the Spells section.
 
Level 4
Joined
Apr 4, 2009
Messages
65
Since I cannot implement them yet ( I want to make other stuff first before implementing something with victory conditions for testing purposes ), I need help with another thing:



Well I have been searching for a timer to give you gold for every *unit* the matching player has every 15 seconds...

But I have also noticed that if you look at village builder, it has a massive memory leak that develops into something serious over time...

If anyone can help me with making a leakless and lagless trigger to give you an X amount of gold for every matching unit the matching player has every 15 seconds, that would be really appreciated!

I have tried to make one but failed horribly...


(I forgot there was a 2 day rule inbetween posts, sorry)
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Just click "Edit", copy the text from your most recent post to your 2nd most recent, and then delete it.

I can help you with your problem... but... I use vJass. I could do one in GUI for you but you're going to have to give me a map or something to do it in.
 
  • Pick up
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add (Number of living Sorceress units owned by (Picked player)) to (Picked player) Current gold
That simple. Replace "Sorceress" to the unit you want. It doesn't leak, since it uses an Integer.
 
Level 4
Joined
Apr 4, 2009
Messages
65
... Somehow you make a slightly different trigger than I had in mind but by doing that you give me a better idea of making the income system, which is going to make the gameplay even better.

Thank you a lot!



@Berbanog:

If you still are going to make a GUI trigger thing, you can do so, it would be appreciated a lot. I would be able to use different income systems for different races!

Thanks again!
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I was actually just trying to get an answer out of whether you needed a response in vJass/JASS or GUI. It sounds like you've got it solved so we'll leave it at that.

I deleted your map from my computer.
 
Level 5
Joined
Dec 13, 2008
Messages
141
I would be able to use different income systems for different races!

Thanks again!

Thats not that hard.
All you need to do is create an Array Integer Variable, and set each array to a race's income, and if its for a player that chose it, it needs to be this:
  • Set RaceIncome[(Player Number of(Triggering Player))] = (Player Gold/Integer/Whatever the fuck you gonna put here, as long as it keeps adding to it)
Atleast something like that, well for only one independant player, or the player that is using the same race without choosing (Like you pre-set the races, but different players get to be them, and shown in set-forces)
And if its for more than ONE player, that can choose ANY Race, it has to be fixed. The easier way to do this, is make a Dialog that has the races, then when the button gets clicked, set their initial income by using the trigger above. That can make things a tad better.
 
Level 4
Joined
Apr 4, 2009
Messages
65
Hehe,

I just noticed that:

Unit - Create 1 Human Warrior King for (Triggering player) at (Random point in (Playable map area)) facing (Position of (Triggering unit))

Does not place the Human Warrior King at a random point... Well I am going to set an region later so everyone begins on the same distance of every place in the map



But there is something I wonder:

Is there a way to stick a weapon to a villager with triggers / object editor?
 
For the random point, go to File -> Preferences and untick "Use fixed random seed".

For the weapon, either get the "Sphere" ability, edit the model you want and delete the missile art model, edit the first attachment point ("sprite", "first") and add "hand", "left" (or "right", depending on which hand you want) and delete the rest two attachment points.
Add the ability to your unit or simple trigger it:
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trigger2
  • Events
    • (The event you want)
  • Conditions
  • Actions
    • Set Unit = (your unit) // this variable is of type "Handle"
    • Special Effect - Create a special effect at hand,left of (your unit) using (the model you want.mdx)
    • Hashtable - Save (Last created special effect) as (Key(sfx)) of (Key(Unit)) in (Hashtable)
 
Level 5
Joined
Dec 13, 2008
Messages
141
For the weapon, either get the "Sphere" ability, edit the model you want and delete the missile art model, edit the first attachment point ("sprite", "first") and add "hand", "left" (or "right", depending on which hand you want) and delete the rest two attachment points.

If its for a Konstrukt Marine model, then use "weapon" as the first attachment point. Why? Because when its in the hand, it doesn't look right. In the weapon, they hold it just like they do with the regular models.
 
Level 4
Joined
Apr 4, 2009
Messages
65
I see


What I have created so far hehe...

It took me some time to figure out how to change the archer animations but I succeeded!

I haven't gotten much time thinking of things I need but can't make so no question in this post!

Perhaps later I will edit it

Thanks for all the help!

Only thing I am still trying to figure out is the hashtables stuff in Pharaoh_'s first post
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well what "Key( label )" is doing is converting the string "label" to an integer (which will always be the same integer). Also, each handle created has a unique ID, so by referencing that ID you will be able to cross-reference (with the hashtable functions) using the static value (the string key) to obtain a value.

Its more or less a 2-dimensional array. You have [ handleID ][ someInteger ] = Value.

By referencing [ handleID ] with an event response GetExpiredTimer() you would be able to reference the "Value" with the index [ timerID ][ someInteger ]. Since you're using the key of a string for "someInteger" you could use the key of the same string to reference the same integer value.
 
Level 4
Joined
Apr 4, 2009
Messages
65
Thank you for explaining what it exactly does

It basically creates an ID for units or other stuff that werent in the game when it started ( which you can't refer to because it's not known )

But my problem is something different. My problem is that I cant remake the trigger(s):

((Unit-type of (Triggering unit)) Equal to Footman) and (((Key (Triggering unit)) is stored as a Handle of (Key (Owner of (Triggering unit))) in Hash) Equal to True)


The first "key" word needs to be gone but somehow I can't find the right thing to do so...




Well I have some new idea's and I think I can make them on my own now but I'll post them here anyway:

1. I wish to give an building the option to garrison units. When a unit enters the building, damage done by the building AND an attack gets enabled.

So if you put 1 person in this building the building will get the option to attack enemy units and will have lets say 25 basic damage. each unit that enters will add +25 damage.

Actually... I still have problems of how to do this but I think it needs to have the damage done equal to the units found ( similar to how a tax system works ) multiplied by 25



2. At 4 points of the map, units will spawn. Neutral enemy units that will do their best to destroy everything they see. But after every 5 minutes or so, different units will spawn for 5 minutes.

Solution:
Create 4 regions where they can spawn.
Create a trigger that activates a trigger after 5 minutes that spawns 1 unit at every region every 5 seconds.
Create a trigger that will activate after 10 minutes and turns off the past triggers. This trigger spawns other units at every region every 5 seconds.

Make the units attack everything on the whole map. (How?)
 
The first "key" word needs to be gone but somehow I can't find the right thing to do so...
When it asks you for a Key, go to Hashtable - Get String ID, because you currently use Get Handle ID.
So if you put 1 person in this building the building will get the option to attack enemy units and will have lets say 25 basic damage. each unit that enters will add +25 damage.
This is what I did in one of my buildings in the Race Building Contest. Here: http://www.hiveworkshop.com/forums/...g-contest-3-a-145995/index57.html#post1370580
Look for the "Tower of Insolence" building. When it kills a unit, it gains extra damage on the attacks, with a cap of 5 units maximum. It uses a load ability, just like the way yours is supposed to work. A word of caution: Before you test it, go to the peon-type unit in the Object Editor and find the structures built. Replace "BirthAnimaRotation" with Mausoleum. It was the editor which replaced those units. :/
If you still don't get it, I will explain.
Make the units attack everything on the whole map. (How?)
Set their Acquistion Range to 999999.00 (from Object Editor)
 
Level 4
Joined
Apr 4, 2009
Messages
65
Set their Acquistion Range to 999999.00 (from Object Editor)

Okay, highest is 20000.00 but I used a unit enter region trigger to make it that high.

One problem though, the enemy does see my units and wants to attack them but returns to their spawn point after 5 seconds ( therefore never reaching my base )

What do I have to change to turn that off?



Without adding regions preferably as I want them to auto engage enemies

Edit: Nevermind I think I already know

Edit2: I can't seem to fix it.

Level 1 unit move
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
Unit - Set Rally-Point for (Triggering unit) to (Center of (Playable map area))
Unit - Set (Triggering unit) acquisition range to 999999.00


That doesnt seem to work at all!
I actually need a condition in it that looks if the unit is from a player.

But it still wont work even without that! I thought if I put a rally point ( attack point ? ) they will start attacking without returning


edit3: Okay fixed it
 
Last edited:
Status
Not open for further replies.
Top