HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Transfer Levels to New Hero

07-21-2005, 01:36 AM#1
CronoImprezaWRX
I looked for like thirty miniutes, but couldn't find it. This is what I want my result to be:

Hero A walks into Region X
Hero A's level is stored, and Hero A is removed from game
Hero B spawns at Region X with level and name stored

could someone tell me the action trigger for that?

I've got the unit walking into region, unit equal to hero A part...
but transfering the level is where i'm stuck.
07-21-2005, 01:57 AM#2
Guest
Code:
Transfer Level
    Events
        Unit - A unit enters (Region X)
    Conditions
        (Entering unit) Equal to (Hero A)
  
    Actions
        Set HeroLevel = (Level of (Entering unit))
        Unit - Remove (Entering unit) from the game
        Unit - Create 1 Hero B for (Owner of (entering unit)) at (Region X) facing Default building facing degrees
        Hero - Set (Last created unit) Hero-level to HeroLevel, Hide level-up graphics

And the variable looks like this:
Code:
Variable Name: HeroLevel
Variable Type: Integer
Initial Value: 0 (default)
07-21-2005, 05:00 AM#3
CronoImprezaWRX
Thanks, okay, I have another question.

I haven't done the triggers yet (I wanted to get opinions for the best way), but would this be the BEST way to do this?

Unit A goes to Region X
Owner of Unit A gains control of another Unit (a type of sentry turret)
Owner of Unit A has camer panned over new unit, and selects new unit

Unit leaves, give the turret back to neutral passive

meanwhile, the turret is CONSTANTLY being moved to Region Y

the result I want is this:
A hero walks upon a platform and gains control of a turret. The turret is invisible and unseen, and the player may control the turret. The turret, however, cannot move, and is constantly being moved to wherever another unit (a ship) is moving. So it would be like a unit controls a turret of the ship. Would this be the best way?


EDIT:
i'm also having trouble moving the rect to the unit. this is what i have so far:
Code:
Event:
    Unit - A unit leaves Region X <gen>

Conditions:
    Triggering Unit equal to Random Units from Units of type Unit X
Now i need to move Region X to Unit X, that way, the region always stays with the unit

any help?

EDIT 2:
Alright well, after further testing, the trigger works, but only on some occasions. Sometimes, when the unit comes into the area, it doesn't do anything, but other times, it works like a charm.

I think theres a delay with the variable, but i'm not 100% sure.
can anyone clarify this for me? thanks a ton.
07-21-2005, 10:08 AM#4
Anitarf
Could we see your triggers again? Also, this should be moved to the Triggers and Scripts section...
07-21-2005, 06:45 PM#5
CronoImprezaWRX
Quote:
Originally Posted by Anitarf
Could we see your triggers again? Also, this should be moved to the Triggers and Scripts section...

Sure!
Here is one of the triggers for the switching heroes. The rest are just copies. I also need some help on the turret trigger too heh...

Code:
Events:
    Unit - A unit enters Region X

Conditions:
    Entering Unit Equal to Random Units from Units of Type Hero A

Actions:
    Set HeroLevel = Hero level of entering unit
    Unit - Remove entering unit from the game
    Create 1 Hero B for owner of entering unit at the center of Region X center blah blah
    Game - Display to owner of last created unit blah blah blah blah
    Hero - Set last created unit Hero-Level to HeroLevel, hide level up graphics

if you want, i could e-mail you my map so you can see it for yourself :)
07-21-2005, 06:54 PM#6
CronoImprezaWRX
for some reason, i posted a message, but it hasn't shown up....
07-22-2005, 07:53 AM#7
CronoImprezaWRX
I posted this morning but the forums didn't seem to work
07-22-2005, 09:30 AM#8
Peekaboo
Code:
Event:
    Unit - A unit leaves Region X <gen>

Conditions:
    Triggering Unit equal to Random Units from Units of type Unit X

The way you've done this, say you have 3 footmen on the map, one footman leaves region X, there is only a 1 in 3 chance that the 'Random Units from Units of type Footmen' is the one that left the region. What you want is a 'Unit type of triggering unit is equal to Unit X' then it should work every time.

As for the turret one, I think there might be a better way of keeping the turret on the ship other than constantly moving it, i'm not sure though. To take control of the turret you need something like
Code:
 EVENTS
Unit enters Region x

ACTIONS
Change control of Turret_001 to owner of triggering unit
Change camera_target to Turret_001

then:
Code:
EVENTS
Unit leaves region X

ACTIONS
Reset game camera for (owner of Turret_001)
Change control of Turret_001 to neutral passive
Change camera_target to (No Unit)

for the camera lock you need something like:

Code:
EVENTS
Every 2 seconds of the game

CONDITIONS
Unit camera_target is NOT equal to No Unit

ACTIONS
Set camera object for (owner of Turret_001) to Turret_001

Hope this works/helps :)
07-22-2005, 06:54 PM#9
CronoImprezaWRX
Quote:
Originally Posted by Anitarf
Could we see your triggers again? Also, this should be moved to the Triggers and Scripts section...

Okay, i got everything working (the region moving with unit, everything else)
except for the first thing i came here for:

The trigger sometimes refuses to activate (I think the event isn't working). When i step into the rect, it sometimes works (displays text and activates all my triggers and everything else), but sometimes it does absolutly nothing.

Code:
Events:
Unit- A Unit enters Rect A <gen>

Conditions:
(Entering Unit) Equal to (Random unit from (Units of type Hero A)

Actions
Set HeroLevel = Hero Level of (Entering Unit)
Unit - Remove (Entering Unit) from the game
Unit - Create 1 Hero B for (Owner of (Entering Unit) at center Rect A <gen> facing blah blah
Game - Display to (Owner of (Last Created Unit)) blah blah blah
Hero - Set (Last created unit) Hero-level to HeroLevel, Hide level up graphics
07-22-2005, 08:18 PM#10
Anitarf
Well, if you have more units of type Hero A, then the randomly picked unit may not always be equal to your entering unit even if the entering unit is in the group. Can't you just do a unit type comparison instead of unit comparison?
07-22-2005, 08:41 PM#11
CronoImprezaWRX
Quote:
Originally Posted by Anitarf
Well, if you have more units of type Hero A, then the randomly picked unit may not always be equal to your entering unit even if the entering unit is in the group. Can't you just do a unit type comparison instead of unit comparison?

wasn't aware such a thing existed

thanks a lot mate...

last question to this thread:
where should i go to submit my maps? I've been told they're good... i think they're decent for people to play... But i don't know a good way to spread them. tips?
07-23-2005, 12:07 AM#12
Guest
www.wc3sear.ch



No .com


and yes theres a full stop in the middle.

Just register, then go to the submit link (top right), click on maps then submit ur map.
07-23-2005, 12:24 AM#13
Anitarf
You can also post on the completed maps subforum here on wc3c, but that's more usefull for getting feedback form other mappers, not for spreading the map among players.