Wednesday, April 18, 2012

Need some help.

Im making a campain lvl and want to know how to walk up to say a peon and make him walk into a house and change into a grunt lilke in the human campain ynow.:y-|||Code:
Melee Initialization
Events
Unit - A unit comes within 100.00 of Peon 0001 <gen>
Conditions
Actions
Unit - Order Peon 0001 <gen> to Move To (Center of Region 000 <gen>)
Wait 2.00 seconds
Unit - Replace Peon 0001 <gen> with a Grunt using The new unit's default life and mana

You might want to add a condition if you only want this to happen if a specific unit enters the peon, for a wider or more narrow "in range" distance, you want to change the value in your event.

You want to use an additional wait time if the peon has to walk a longer distance, or make a new trigger for it to wait until it enters that region.|||Thats great tyvm but how do i make more then 1 do it. and what if its not number0001? And what does <gen> mean

|||Quote:






View Post

Im making a campain lvl and want to know how to walk up to say a peon and make him walk into a house and change into a grunt lilke in the human campain ynow.:y-




try making a region right in front of the house where the door is (or a region at every door) and try copying this and substituting in the new regions for every region you want to do this for:

Untitled Trigger 001

Events

Unit - A unit enters No region

Conditions

(Unit-type of (Triggering unit)) Equal to Peon

Actions

Unit - Replace (Triggering unit) with a Grunt using The new unit's max life and mana



I tested it out, it works. :)

Edit: oops forgot about the walking up to part...let me redo that lol|||Ok I tested this out and hopefully it wont cause too many problems:

Untitled Trigger 001

Events

Unit - A unit Is issued an order targeting an object

Conditions

((Owner of (Triggering unit)) controller) Equal to User

(Unit-type of (Target unit of issued order)) Equal to Peon

(Issued order) Equal to (Order(smart))

------------------Note : The order "Smart" pretty much means "Follow" -----------

Actions

Set PeonWorker = (Target unit of issued order)

Set FollowingUnit = (Triggering unit)

------------------Note: "PeonWorker" and "FollowingUnit" are both (Unit) type Variables that were made---------------

Wait until (((Region centered at (Position of PeonWorker) with size (600.00, 600.00)) contains (Position of FollowingUnit)) Equal to True), checking every 0.25 seconds

Unit - Order PeonWorker to Move To (Center of picked Region in front of door)

---------------------------------NEW TRIGGER----------------------------

Untitled Trigger 002

Events

Unit - A unit enters (Center of picked Region in front of door)

Conditions

(Unit-type of (Triggering unit)) Equal to Peon

Actions

Unit - Replace (Triggering unit) with a Grunt using The new unit's max life and mana



And I hope that that all works for you without any problems. =)



Edit: LOL I just realised you could make a chess type game out of this trigger hahaha

No comments:

Post a Comment