• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with a few things...

Status
Not open for further replies.
Level 3
Joined
Jun 11, 2021
Messages
12
Hey, I'm building a LOAP spinoff that is combined with The Elder Scrolls III: Morrowind and need help implementing a few things!

Btw, I'm quite shit with JASS or any programing so please keep it simple.

1. How do I flash game text to the owner of a player who's unit is triggering something?
(As it stands I can only make it show to everyone, I haven't found an option and my eyes burn from staring at this gigantic white screen lol)

2. How to flash a game text to the player who controls the unit using the ability?

3. How to make hostile units respawn unless there is a player controlled building next to them?

4. How to make a loot drop system that gives a base chance to drop certain items depending on what unit is killed?

5. How to build a tip giver (periodically picks a random tip from a table or list and flashes it to all players)?

6. How to have an ability cost gold instead of mana?

7. How to spawn "a wave" of troops from one area that attack move to another area?


I'm having so much fun creating and expanding upon this map.

I would be very grateful to anyone who can help me implement these!

Thank you for taking the time to read.

I appreciate you.

P.S. Here's the map if you want to check it out or add some of these for me.
 

Attachments

  • Life Of An Nwah Beta v.2.w3m
    2.5 MB · Views: 11
Last edited:
Level 22
Joined
Feb 26, 2008
Messages
891
The trigger action you're looking for is likely "Game - Text Message"
The tricky part about this action is that it is looking for a player group, not just a single player. The workaround for this is to use the Matching Player conditional to filter down to the player you want. It's just a little bit of a hassle to setup, but it should look something like this:

  • My Cool Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)).) the text: Some Cool Text
What this does is go through each player in the game one at a time and does the comparison. It will then execute the action when the player it's checking (referred to as the "Matching player") is the same as the player who owned the Triggering unit.

This method should work similarly for each of your requests on showing text to specific players. You would just change the "Owner of (Triggering unit)" part to be "Owner of (Casting unit)" or whatever you need.

hostile units respawn

This one's a popular question. There are some threads out there with ideas that might help you get started. For your case you'll want to add a condition somewhere before the respawn action that checks if there are any buildings nearby.


loot drop system that gives a base chance to drop certain items depending on what unit is killed?

If you have units that are already placed on the map (rather than being created in-game) then you can use the built-in item tables (Advanced -> Item Tables). Otherwise, you'll need to use triggers to create that logic yourself based on when a unit dies and what kind of unit it was.

How to build a tip giver

The most basic implementation would be a trigger that uses the Time - Periodic Event option to run repeatedly during the game. Then you can create a string array variable with all your tips and just have it pick a random one each time to show using the Game - Text Message action.

How to have an ability cost gold instead of mana?

Tricky to do in such a way that it will behave properly and look nice. I'd start with one of the few abilities that have a gold cost already built-in and then use triggers to add the effects you want the ability to have. The other option is to take a normal mana-based ability and then have a trigger try to subtract gold after the fact, but there's not a great way to prevent the casting if you don't have enough gold. Here are a few threads discussing it:


How to spawn "a wave" of troops from one area that attack move to another area?

This is a bit vague because there are tons of options here. The start would be the Unit - Create units triggers. You'd probably want to create a region on the map somewhere so you have a location to reference. (Center of (<Region>)) being the easiest. Then you can use Unit - Issue Order Targeting a Point to get the unit to attack move somewhere (maybe another region or some other landmark).
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
To add onto Ghan's first comment, you can also display a message to a specific player like so:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Game - Display to (Player group((Owner of (Triggering unit)))) for 30.00 seconds the text: hello
It's called Convert Player to Player Group.

Note that both of these methods leak a Player Group.
That being said, memory leaks may be a topic better left alone for now.
 
Level 3
Joined
Jun 11, 2021
Messages
12
The trigger action you're looking for is likely "Game - Text Message"
The tricky part about this action is that it is looking for a player group, not just a single player. The workaround for this is to use the Matching Player conditional to filter down to the player you want. It's just a little bit of a hassle to setup, but it should look something like this:

  • My Cool Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)).) the text: Some Cool Text
What this does is go through each player in the game one at a time and does the comparison. It will then execute the action when the player it's checking (referred to as the "Matching player") is the same as the player who owned the Triggering unit.

This method should work similarly for each of your requests on showing text to specific players. You would just change the "Owner of (Triggering unit)" part to be "Owner of (Casting unit)" or whatever you need.



This one's a popular question. There are some threads out there with ideas that might help you get started. For your case you'll want to add a condition somewhere before the respawn action that checks if there are any buildings nearby.




If you have units that are already placed on the map (rather than being created in-game) then you can use the built-in item tables (Advanced -> Item Tables). Otherwise, you'll need to use triggers to create that logic yourself based on when a unit dies and what kind of unit it was.



The most basic implementation would be a trigger that uses the Time - Periodic Event option to run repeatedly during the game. Then you can create a string array variable with all your tips and just have it pick a random one each time to show using the Game - Text Message action.



Tricky to do in such a way that it will behave properly and look nice. I'd start with one of the few abilities that have a gold cost already built-in and then use triggers to add the effects you want the ability to have. The other option is to take a normal mana-based ability and then have a trigger try to subtract gold after the fact, but there's not a great way to prevent the casting if you don't have enough gold. Here are a few threads discussing it:




This is a bit vague because there are tons of options here. The start would be the Unit - Create units triggers. You'd probably want to create a region on the map somewhere so you have a location to reference. (Center of (<Region>)) being the easiest. Then you can use Unit - Issue Order Targeting a Point to get the unit to attack move somewhere (maybe another region or some other landmark).
Wow! This is all super helpful! Thank you so much for taking the time to respond.
 
Status
Not open for further replies.
Top