• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit with Range Trigger Help

Status
Not open for further replies.
Level 2
Joined
Feb 14, 2006
Messages
16
Hello all,

I have been working on a campaign that utilizes multiple maps that saves and loads a selected char.

I am currently trying to use the Unit within range global trigger in the Event category to point to my last restored char. Ultimately, I want to use this action to cause a stationary mob - which I set to a slower speed (walk effect) to increase its movement rate (run) at the char if the char gets too close.

My prob is that the Unit within Range trigger only lets me select a unit that I have already placed on the map. It seems like an easy fix for Blizz to just go in and make a small coding change to let you select Last Restored or Last Created unit but alas I have tried everything including creating a Variable to assign my char to but nothing seems to work. I believe I have tried every possible Variable type and no Variable seems to pop up when I have to select a unit.

Can someone write a JASS script to allow me to use the Unit within Range Event option and have it to point to the Last Restored unit or Last Created unit? I dont know JASS at all but that seems to be the only possible option I have left.

Thanks for your time and any help you can give me.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Add this action to some trigger and run it. Then you csn use "My trigger" to do what you want. You can select Last created unit from the list with this trigger.

Trigger - Add to (My trigger) the event (Unit - A unit comes within 256.00 of Unit)

===========================
 
Level 2
Joined
Feb 14, 2006
Messages
16
Thanks a ton Maker. I had to tinker with it just slightly but in the end it was a success. Again.. thanks much.

Now.. wonder if you could help me with trying to save items when I change my maps. I have looked at the bag trigger that someone created that allows you to open up a bag and put stuff in the 5 slots but no idea how to assign an item to a variable to store in a game cache. Seems all I can store is a unit, boolean, real, string, and integer. If I could only tie an item to one of those.. I can fix the last hang up on my map.

Thanks for any help or info in advance.
 
Status
Not open for further replies.
Top