HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Town Portal Scroll On Creation

12-18-2002, 09:19 PM#1
SickZip
An intial confession, I am completely clueless when it comes to triggers, I'm good at laying down the terrain, I'm experienced at editing the slk and txt files, but I despise and suck at triggers. This is just as well since I normally just make modified and rebalanced melee maps, but I need help with a trigger for the map I'm making.

As part of my current attempt at rebalancing I want to make town portal scrolls less available since I feel they make certain strategies obsolete (siege drops, raiders in general). I want the intial hero created to start with a tp scroll, but I don't want later heroes to start with one. I, however, have no idea how to do this.

My never dying grattitude to whoever helps me with this.
12-18-2002, 09:20 PM#2
FyreDaug
Map init
-----
-----
Melee Game - Hero Starting Resources
12-18-2002, 09:26 PM#3
SickZip
I don't think you understand. That's the very trigger I deleted and don't want. That trigger gives a TP scroll to every hero trained, while I want a TP scroll given ONLY to the intial hero. If you train a second or third hero, they come with an empty inventory.
12-18-2002, 10:57 PM#4
CBWhiz
you basicly need to recreat that trigger, for that action actually creates a new trigger.

heres how u go:

make integer array "GaveTP"

event
player (n) trains a unit
condition
unit is a hero
GaveTP[Player Number of Owner of Trained Unit] = False
action
Hero - Give TP to Trained Unit
Set Variable GaveTP[Player Number of Owner of Trained Unit] = True
12-18-2002, 11:00 PM#5
Guest
make a boolean variable for each player like player1boolean and set it to false in a trigger. then the trigger is
event: unit is trained, or built or whatever not sure
condition: unit is a hero equal to true
player1boolean equal to false
action: set player1boolean to true
i'm not sure how to add an item to the inventory but try make an item at location of (triggering unit) and order unit to pick up the item. (there is a better way tho) and triggering unit may not be the right function either, check the list.
12-19-2002, 01:18 AM#6
ph33rb0
Instead of one variable per player use an array. Much better when you know how to use it.
12-19-2002, 02:52 AM#7
CBWhiz
I like when my posts are ignored :D
Read 3 posts up, his answer is right there.
12-19-2002, 07:26 PM#8
Guest
sry I think we postd abotu the same time tho. and arrays would be better, I always forget about arrays
12-19-2002, 08:21 PM#9
dataangel
Eh, much easier way for someone inexperienced with triggers:

Setup 1 trigger for each player like this:

Event
Player1 trains a unit (Change for each player)
Condition
Boolean comparison: (Trained unit) is a hero
Action
Give Trained Unit Scroll of Town Portal
Turn off (this trigger)

That and delete the hero starting resources action and you'll be set.
12-20-2002, 12:22 AM#10
SickZip
Alright, what did I do wrong. It's currently failing to spawn a TP scroll for any hero.

Here's the exact text of my trigger:

Events
- A Unit Owned By (Owner Of (Triggering Unit)) Finishes Construction.

Conditions
- ((Triggering Unit) is A Hero) Equal To True
- GaveTP(( Player Number of (Triggering Player)) Not Equal To True.

Actions
- Hero - Create Scroll Of Town Portal and give it to (Trained Unit)
- Set GaveTP((( Player Number of (Triggering Player))) = True

And I did create the integer array GaveTP.
12-20-2002, 12:55 AM#11
Dinadan87
Construction refers to buildings. This is how you should have it, EXACTLY as it appears in the editor.

Unit - A unit owned by Player 1 (Red) Finishes training a unit

((Trained Unit) is a hero) equal to true

Hero - Create Scroll of Town Portal and give it to (trained unit)
Trigger - Turn off (this trigger)



That should do it. Repeat it for all players and it'll do fine. Make sure to turn off starting hero items too.
12-20-2002, 05:22 PM#12
Guest
yes he's right, and make sure to use the right function at all times. it seems that you, like many, use (triggering unit) for a lot of things, its not the perfect function, serach through them and find the right one. remember this when you make your next map, it will save you a lot of trouble.
12-21-2002, 12:57 AM#13
SickZip
So there isn't any way to consolidate this into a single trigger? I've keeping my balance changes ready to port to any map in 5 minutes, by saving my unit changes to a .w3u file and keeping my edited .slk and .txt files ready to import quickly with winmpq. I was hoping for a single, not too long trigger so I could quickly add it to other maps I decide I want to play with my balance changes.

If that isn't possible, does anyone know which file the triggers are saved in? For example, I can open a map with winmpq and see a .w3u sitting there and know it's storing the unit statistics and any changes made to them with the Unit Editor. Is there any equivalent file for triggers? I was thinking that extracting and adding that to another map's archive would probably for quick porting to other maps, since the WorldEditor doesn't let you save trigger modules like it does unit modules.

Also, does anyone know what happens if you mod the .slk files for the units (like unitdata.slk and unitweapons.slk) and also change things with the worldeditor's unit editor? Which set of changes take precedence?
12-22-2002, 01:07 AM#14
SickZip
bump for the answering-my-questions krew