• 🏆 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!

A Couple WC3 Questions...

Status
Not open for further replies.
Level 3
Joined
Jan 23, 2010
Messages
53
I need these for my RPG map i'm working on and i cant seem to figure them out :/ help is EXTREMELY appreciated :D

1st Question: how do you make the -name trigger so the players can type in there names?

2nd Question: How do you control how much a sperate item can be sold for?

THANKS HIVE
 
Level 8
Joined
Jun 26, 2010
Messages
530
1st Question: how do you make the -name trigger so the players can type in there names?

I've seen a lot. Experiment something like that

  • Events
    • Player - a player types a chat msg with -name as a substring
  • Conditions
  • Actions
    • Player - change name of triggering player to (substring(enteredchatstring,([lenght of entered chat string) - 6], (lenght of entered chat string)))
Where's 6 is the lenght of the prefix ("-name") plus one (the space between "-name" and the name)

2nd Question: How do you control how much a sperate item can be sold for?

Would be "sperate" separate? I think there's a refund factor in the gameplay constats under "Advanced->Gameplay Constants" that affects all itens. If you need a separate one you will have to use a trigger to give the player the refund factor + the rest of the gold you desire the player to gain. (can be a negative value if the value is smaller)
 
Level 3
Joined
Jan 23, 2010
Messages
53
I've seen a lot. Experiment something like that

  • Events
    • Player - a player types a chat msg with -name as a substring
  • Conditions
  • Actions
    • Player - change name of triggering player to (substring(enteredchatstring,([lenght of entered chat string) - 6], (lenght of entered chat string)))
Where's 6 is the lenght of the prefix ("-name") plus one (the space between "-name" and the name)



Would be "sperate" separate? I think there's a refund factor in the gameplay constats under "Advanced->Gameplay Constants" that affects all itens. If you need a separate one you will have to use a trigger to give the player the refund factor + the rest of the gold you desire the player to gain. (can be a negative value if the value is smaller)

Damn, ill just think of a new way to do the Gold system... but thanks for the name trigger!!! :D
Im only having one problem. When i test it and type -name [what i want] it only uses the last letter...

4 example: i type -name Toast
my name is now "t"
idk what 2 do :/
 
Level 8
Joined
Jun 26, 2010
Messages
530
4 example: i type -name Toast
my name is now "t"
idk what 2 do :/

Sorry, i posted on the hurry, i made a mistake ;p.

World Editor Official Example ;D
(Substring(Grunt Stinks, 2, 4) = "run"

In your trigger where there is a 2, it must be 7, because 7 will ALWAYS be the first letter of the name. (cause the space after the "-name" is equal 6).
Then on the place of the 4 you just point "stringlenght(enteredchatstring)" cause this will be always the last letter of the name. That way if i type "-name ihascatz" the 7 would be "i", "stringlenght(enteredchatstring)" would be 14 and 14 would be "z".

Sorry for the mistake, hopes that helps.
 
Level 8
Joined
Jun 26, 2010
Messages
530
Like this?

[trigger=]Name
Events
Player - (Player) types a chat message containing -name as A substring
Conditions
Actions
Player - Set name of (Triggering player) to (Substring((Entered chat string), 7, 57)
[/trigger]

Yes! ;D
Just change 57 for "stringlenght(enteredchatstring)" and you are ready to go.
 
Level 3
Joined
Jan 23, 2010
Messages
53
In some games (especially loap) you can type -ally [color of player] and it will ally you with that player. For example. Red and Blue are UNALLIED... red types -ally blue... red is allied with blue. Blue wants to ally back -ally red... Blue is now allied with Red; get it?
 
Level 8
Joined
Jun 26, 2010
Messages
530
And what about the -ally [color of player] trigger? Any help with that one?

"-ally [playerindex]" would be a bit easier. I will make and map and attach here, just one second

Edit: Here are the maps. The first one have an color changing command, so the ally and treat (bonus ;D) commands works with player index, because the players would be changing colors. If you don't want a color changing command, i made the second map (the one with v2 on the end) were there's no "-color" command an the ally and treat comands works with player colors.
Now, if you wanna mix them both, so you can change color and players would use ally and treat by your color, that would be a lot more complicated (and not worth, imo).

I really likes the first one with the color change command :)

Also, i put and lumbermill and and archmage so you can see the color changes, and an Player 2-owned scout tower, so you can test the alliance change commands. BUT if the arch mage is already attacking the tower, you must stop him or he will continue attacking (even when the alliance change happened).
 

Attachments

  • Substrings.w3x
    10.1 KB · Views: 53
  • Substrings-v2.w3x
    9.8 KB · Views: 69
Last edited:
Level 3
Joined
Jan 23, 2010
Messages
53
"-ally [playerindex]" would be a bit easier. I will make and map and attach here, just one second

Edit: Here are the maps. The first one have an color changing command, so the ally and treat (bonus ;D) commands works with player index, because the players would be changing colors. If you don't want a color changing command, i made the second map (the one with v2 on the end) were there's no "-color" command an the ally and treat comands works with player colors.
Now, if you wanna mix them both, so you can change color and players would use ally and treat by your color, that would be a lot more complicated (and not worth, imo).

I really likes the first one with the color change command :)

Also, i put and lumbermill and and archmage so you can see the color changes, and an Player 2-owned scout tower, so you can test the alliance change commands. BUT if the arch mage is already attacking the tower, you must stop him or he will continue attacking (even when the alliance change happened).

Wow you put alotta kindness into this XD... ill give you rep again once it allows me too. :D thanks sooooo much soulburn. Your definetly gonna get credits in my map

Edit: While your on a role here, do you know how to get rid of the minimap house icons for merchant shops and mercenary shops (which are displayed on the minimap)?
 
Last edited:
Level 8
Joined
Jun 26, 2010
Messages
530
Wow you put alotta kindness into this XD... ill give you rep again once it allows me too. :D thanks sooooo much soulburn. Your definetly gonna get credits in my map

Edit: While your on a role here, do you know how to get rid of the minimap house icons for merchant shops and mercenary shops (which are displayed on the minimap)?

Thank's, man! I'm so glad i could help, and i hope we can see your map done and good :)

Again, i'm at work (again ;x) so i can't be sure, but i think there's on the Objet Editor a field where you can disable minimap display on the units. I think it's "Stats - hide minimap display"
 
Level 3
Joined
Jan 23, 2010
Messages
53
Thank's, man! I'm so glad i could help, and i hope we can see your map done and good :)

Again, i'm at work (again ;x) so i can't be sure, but i think there's on the Objet Editor a field where you can disable minimap display on the units. I think it's "Stats - hide minimap display"

You were right! LOL your a genius at Worldeditor
 
Level 8
Joined
Jun 26, 2010
Messages
530
You were right! LOL your a genius at Worldeditor

Nah, i`m just familiar with it, but thanks anyway :)
And you will be familiar soon, trust me. With time and experience you will start solvin most of the problems quickly and finding alternative ways of doing things ;D
 
Level 3
Joined
Jan 23, 2010
Messages
53
Well -SoulBurn i ran into another trigger issue...
  • Events
    • Unit - AgilityTrainer0105 receives damage
  • Conditions
  • Actions
    • Hero - Modify Agility of (attacking unit): add 1
Im trying to make this trigger so that when the AgilityTrainer gets attacked, the attack will recieve +1 Agility... but the Attacking Hero is not gaining any... what am i doing wrong this time? >_<
 
Level 8
Joined
Jun 26, 2010
Messages
530
Well -SoulBurn i ran into another trigger issue...
  • Events
    • Unit - AgilityTrainer0105 receives damage
  • Conditions
  • Actions
    • Hero - Modify Agility of (attacking unit): add 1
Im trying to make this trigger so that when the AgilityTrainer gets attacked, the attack will recieve +1 Agility... but the Attacking Hero is not gaining any... what am i doing wrong this time? >_<

When you use the event "takes damage" you cannot use "attacking unit". A unit takes damages being attacked, activating some mine, receiving AoE dmg, receiving damage from a buff and etc. Basically, not always there will be a attacking unit, so, attacking unit will not work.Instead, just replace your action by:

  • Events
    • Unit - AgilityTrainer0105 is attacked
It will works ;D
 
Level 4
Joined
Apr 20, 2009
Messages
106
Using the event 'is attacked' can be exploited, though, by mashing on the stop button. Every time a unit attempting to train begins attacking the trainer the trigger runs, not every time the trainer actually is attacked. Thus, a player mashing the stop button will be able to make a trainee begin its attack many times within the space of a single attack, abusing the system.

I realize I explained that like crap, so the best way to see what I'm talking about is to try it for yourself, but it was just a fair warning. Anyways, you could use some form of damage detection system to get that trigger working how you want, or just risk the abuse. Up to you.

EDIT: Because I realize I'm horrible at explanations, I uploaded a really small map to illustrate what I was trying to say. Mash the stop button on the footman and it will show you how the is attacked abuse works.
 

Attachments

  • IsAttacked.w3m
    12.3 KB · Views: 57
Last edited:
Level 8
Joined
Jun 26, 2010
Messages
530
Using the event 'is attacked' can be exploited, though, by mashing on the stop button. Every time a unit attempting to train begins attacking the trainer the trigger runs, not every time the trainer actually is attacked. Thus, a player mashing the stop button will be able to make a trainee begin its attack many times within the space of a single attack, abusing the system.

I realize I explained that crap, so the best way to see what I'm talking about is to try it for yourself, but it was just a fair warning. Anyways, you could use some form of damage detection system to get that trigger working how you want, or just risk the abuse. Up to you.

EDIT: Because I realize I'm horrible at explanations, I uploaded a really small map to illustrate what I was trying to say. Mash the stop button on the footman and it will show you how the is attacked abuse works.

That's the third time i forget that event is triggered before the damage calculation. El3mentGamer, you could make an area where if the player hero enters, it's ownership is givem to an neutral player that will automatically train for the player, but without cheating (the player would leave the unit training by itself even if he still got the unit ownership), then, you give the player (commands, units, etc) a way of returnig he's hero from the training area and giving him back the control over it.

Edit: i got an idea, maybe it works:

  • Events
    • Unit - TrainingDummy is attacked
  • Conditions
  • Actions
    • set variable DummyLife to life of TrainingDummy) ///this is a real variable
    • Wait - 1 second
    • If-Then-Else
      • if
        • Life of (atacked unit) Lesser Than DummyLife
      • then
        • Hero - Modify attributes - add 1 agility
      • else
I also tested it and attached the test map ;D
As the dummy actually takes damage, you will need triggers to revive them. (don't worry, it's VERY simply).
BUT, this trigger can still be exploited by two units atacking the same dummy. It will be possible on your map?
 

Attachments

  • IsAttacked.w3x
    12.5 KB · Views: 53
Last edited:
Level 4
Joined
Apr 20, 2009
Messages
106
That could work if the dummy doesn't regen health. It may jip the player a point of agility on the killing (and therefore respawning) blow, but hey, oh well, right? One thing I'd add is a line of custom script as the first Action to localize the real variable so it won't bug out with more than one person attacking it.

  • Custom script: local real udg_DummyLife
And I'd shorten up the wait, no need for it to be that long.

EDIT: As I'm looking at it, it's still may screw up with one play trying to abuse the is attacked bug while one player trains normally. I like your first suggestion, the computer training one, I'm going to take a crack at coding a quick one of those.
 
Level 8
Joined
Jun 26, 2010
Messages
530
That could work if the dummy doesn't regen health. It may jip the player a point of agility on the killing (and therefore respawning) blow, but hey, oh well, right? One thing I'd add is a line of custom script as the first Action to localize the real variable so it won't bug out with more than one person attacking it.

  • Custom script: local real udg_DummyLife

Yeah, how could i forget this? A local would do fine :)

And I'd shorten up the wait, no need for it to be that long.

That was just an example but it's good you metioned that.

EDIT: As I'm looking at it, it's still may screw up with one play trying to abuse the is attacked bug while one player trains normally. I like your first suggestion, the computer training one, I'm going to take a crack at coding a quick one of those.

The problem here is making a natural way of releasing him of the train. I, personally, don't like chat commands in-game unless they are for doing stuff you only can with chat commands. I think a way that would be natural would be double-clicking it.
 
Level 3
Joined
Jan 23, 2010
Messages
53
See, but i dont wanna do "is attacked" because i also want to make the dummy hard to hit. So, those RARE hits that actually deal damage to the dummy will increase agility. I dont want +1 agility THAT often.
 
Level 4
Joined
Apr 20, 2009
Messages
106
I don't like chat commands, either, which is why I set it up the way I did. I haven't gotten to test it with multiple players, but I don't forsee any problems cropping up. Try it out and tell me what you think. I could add some instructions, but it's pretty basic. Enter the grass to train... I need signposts telling which area is which stat... Oh well, this is just a proof of concept, not a finalized version.

EDIT: Just saw your response, El3mentGamer. Simple solution is add a randomized number between maybe 1 and 10, and if the integer is greater than or equal to 7, it will add a stat. That example is a 30% chance of getting your stats up. I can add that to my test, if you'd like.
 

Attachments

  • Training.w3x
    18.4 KB · Views: 61
Level 8
Joined
Jun 26, 2010
Messages
530
What you mean by hard to hit? How can players miss? Bad AoE spells targeting? Or missing in attacks? Like every have 25% chances to miss? In that case the missing could even be made in the same trigger :)
 
Level 4
Joined
Apr 20, 2009
Messages
106
I can add that if it's truly important, but for now... Is my little creation something like what you're thinking, El3mentGamer (Not including the chance to miss, of course)?
 
Level 3
Joined
Jan 23, 2010
Messages
53
I can add that if it's truly important, but for now... Is my little creation something like what you're thinking, El3mentGamer (Not including the chance to miss, of course)?

Qiraji, if you could somehow add a 75% chance to miss on that, that would be outstanding for my map. Let me know if you can rig that in.
 
Status
Not open for further replies.
Top