big frustration: variable won't show up

M

MrJoeS

Guest
Current goal: to write triggers that allow a hero to become a different hero by picking up an item.

I expected to write the trigger like this:

At map initialization, a unit varible called hero1 would be set equal to the hero that was placed for player one.

To accomplish the morph from one hero into another triggered by hero1 picking up an item, I used this event:

Event:

[hero1] [acquires an item]

I couldn't get past there, because WE would not let me choose hero1 for the event. It would allow me to choose one of the units on the map (in this case a Mountain King) but it would not even let me choose "any unit." If "any unit" were there, I'd choose that and include a condition [trig. unit] equal to [hero1].

What am I doing wrong?
 

Darg

Administrator
Reaction score
49
You're looking at the wrong event - you're currently looking at the 'specific unit event', when you should really be looking at the 'player-owned unit event'.

So:

event:
[player-owned unit event]
a unit owned by <player x> acquires an item

condition:
[unit comparison]
<hero manipulating item> equal to [hero1]

action:

do blah.....
 
U

Unregistered

Guest
Thanks again Darg. I though using [player owned unit event] would unnecessarily complicate things. I'll go back and do it that way.
 

Darg

Administrator
Reaction score
49
The reason why you can't define variables in the event itself is because the events are all created when the map is loading up, and variables dont have any value at all during this time, meaning that using them in events is illogical.

You can create new triggers with new events in the game itself, but only through custom text. These events I believe can use variables, BUT it will only use the value of those variables at the time you create the trigger.

The bottom line is that events do not possess any dynamic behaviour, due the fundamental nature of what an event is.


edit: i had blabbed on a bit more than this, but decided it wasn't worth keeping so i deleted it.
 
M

MrJoeS

Guest
With the help you gave me on that trigger, I was able to write one that I though would allow one hero to change to another by picking up the appropriate item.

I wrote the trigger, and tested the map and BOOM!

War3 crashes every time the trigger activates. I tired a couple of things I thought might be causeing it but no luck yet. I even added some test strings to see how far through the execution of the actions it got. None of them came up. The crash is a very merciful one: sudden but painless. War3 closes and everything else is unaffected.

I don't want to try to write out the whole trigger. It's too long. Instead I attached the map.
 

Attachments

  • heromorph map.w3m
    115.3 KB · Views: 274

Darg

Administrator
Reaction score
49
lol, even though it took me only about 20 mins. to solve this one, I can tell you that the problem had me really stumped for a while! :)

So here is what you were doing wrong:

- the trigger fired whenever <hero1> acquired a <cloak of the hunter>

- problem is, in your last line, you create a <cloak of the hunter> and give it to <hero1>!

- so guess what happens! the trigger fires again! and it keeps on firing again and again until the whole game comes crashing down!

- the fix? i stuck a 'turn off this trigger' before the last line, to make sure the trigger did not fire again, and then i turned the trigger on again straight afterwards.

Anyway, I've attached the map, you'll see what I did.

p.s. i renamed it 'hero morph map' to avoid confusion - you had kept the name 'plunder isle' in the map description (scenario -> map description)
 

Attachments

  • heromorph map.w3m
    115.4 KB · Views: 266
M

MrJoeS

Guest
Thanks for finding that bug. My first, biggest, map-making mistake was writing a trigger whose event was periodic, every 0.00 seconds. When I tested that file, my computer got very cross with me. Frame rate went down to about one every 15 seeconds. I felt awfully silly.

Well thanks for your fix! Also, I'll be sure to change the map description in future files. This isn't the final map or anything, but working on a blank field of dirt like the one that always comes up when you load WE is no fun. I load Lost Temple or Plunder Isle and work on those.

My final map idea will require this ability, but there is much more to it that I'll need to learn. Now that I have UMSWE 3.6 I'll get back to those tutorials on special abilities!
 
M

MrJoeS

Guest
Oh, and should I edit out the attachment that I used to give you the map, Darg? I don't know if it's important to save space on the website here. There's nothing sensitive about the file, so it's fine if we leave it up as an educational tool.
 

Darg

Administrator
Reaction score
49
Yep it's fine if you leave it up.

Good luck with going through those tutorials.
 
M

MrJoeS

Guest
one hitch

I hit the tutorials today, and after downloading the requisite utilities, I extracted the important .slk and .txt files to a special folder. I got all the Func and Strings files from war3.mpq, but when I tried to get the ones from war3patch.mpq, some of them caused techmpq to crash.

I am using techmpq and not winmpq because the copy of winmpq I dled would not run. Oh well but other than this techmpq did fine.

I am starting to see that what I have in mind for a map WILL be possible, and it's very encouraging. How do I extract those files that are crashing techmpq though?
 

Darg

Administrator
Reaction score
49
Hmm, I'm sorry i have never used TechMPQ. I don't understand why WinMPQ would crash either. Did you get it from the link I pasted in the FAQ?

I will download TechMPQ myself and have a look at it. But if you could try getting WinMPQ from the FAQ link (if you haven't already), that program is really nice to use.
 
M

MrJoeS

Guest
I never tried the download on the FAQ thread. I got WinMPQ from a link at the site where I read my tutorial.

I'll go get the one you linked to.
 
M

MrJoeS

Guest
I downloaded from the site you linked to, and I got the same error message as before:

--
winMPQ.exe - Unable to Locate Component

This application has failed to start because VB40032.DLL was not found. Re-installing the application may fix this problem.
--

I just unzipped the download into a folder and ran the .exe. Did I do something wrong?
 
M

MrJoeS

Guest
winMPQ is nice!

I'm surprised by how user-friendly a free utility like that is.

Anyway, in browsing War3.mpq, I noticed some .wav files for unit voices. Could I import unit voices into my map buy embedding my own waves with the filenames of the voice of a unit that is not used in my map? (Like "Ice Troll")

I guess my first instinct is to go get the marine voices from StarCraft. Are they in an MPQ that's this easy to play with? Also, it would probably make the file size pretty big. Even embedded, waves are huge.

So I've gotten used to winMPQ and I understand how all this mpq business works. ::pats self on back::
 

Darg

Administrator
Reaction score
49
Anyway, in browsing War3.mpq, I noticed some .wav files for unit voices. Could I import unit voices into my map buy embedding my own waves with the filenames of the voice of a unit that is not used in my map? (Like "Ice Troll")

holy cow, you are one smart thinker! 9 out of 10 ppl who claim to not know too much about the editor would not have thought of doing that. It indicates that you are putting some serious thinking time into figuring things out. Well done!

As far as I'm aware, only wav files can be embedded, although war3 does accept mp3 files in the sound editor. You could try importing with the same file name but use an mp3 file instead and see what happens (I've never done it).

The marine voices can be found in the starcraft mpq file, I'm not 100% sure what the name is, star.mpq or something like that. You should be able to open it up with winMPQ anyway.
 
M

MrJoeS

Guest
I opened up Stardat.mpq in my Starcraft directory, but I was disappointed to find that the embedded names are not so user friendly as the ones in War3.mpq.

Example: ~unknowns\unknown_00000010

I'll goof around and try to find the voice .wav files, but a filter for *.wav didn't turn anything up. In any case, this would probably make a map inordinately big unless I could embed them as .mp3 files. Maybe for one unit, but it would be like 200 k at least.
 

Darg

Administrator
Reaction score
49
Hmm, perhaps MPQView may allow you to see inside stardat.mpq. If you can't find this prog on the web, then give me your email via a PM and I will email it to you.

Just remember that w3m maps heavily compress any files you import into them. If you stick a wav file in there, it should shrink its filesize quite considerably.
 
M

MrJoeS

Guest
The broodwar mpq, broodat.mpq, is very accessable. The medic, valkyrie, lurker and such have their wav files explicitly deliniated. I'm still experimenting with the stardat.mpq.

If I wanted to use Duran's voice, I'd have no problem.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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