• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

3 Easy Questions

Status
Not open for further replies.
Level 2
Joined
Jun 11, 2004
Messages
9
How do you make someone name changed by what hero they pick? for example if I picked a warrior the players name will change to the warrior's name.

How do you make recipes in a game? like dota recipes.

How do you make certain heroes only use certain items? like if I wanted the warrior to only use something.
 
Level 21
Joined
Feb 14, 2004
Messages
3,311
Not really easy because quite alot of people also want to learn...

- When the hero is picked by the player, just change the player's name in triggers to the name of that picked hero, simple.

- Recipes work when specific items are in the Hero's inventory and replaced to the combined item in the inventory. If DOTA is not protected, open it and learn if it is, go their site and ask in the forums.

- Use triggers. For example the hero recives a item and the condition of it is not a melee attacker or ranged attacker then cause him/her to immediately drop it with triggers.
 
Level 2
Joined
Jun 11, 2004
Messages
9
I still cant get the hero name to work. I told it to change players name when hero was selected.

Could you explain a litte more about the item thing?

Im new to map making so I dont know too much.

Thanks
 
Level 21
Joined
Feb 14, 2004
Messages
3,311
Recipies (though I'm not sure)
Use variables

So, when the hero gets one of the ingredients for the items he/she wants, set the (swordofdoom) variable to 1, and add it on as the ingredient increases to make it.

Eventually when everything is in the hero's inventory (swordofdoom) has 3 value then it removes the ingredients from the hero's inventory and gives him/her the item.

I'm not sure though.
 
Level 2
Joined
Jun 11, 2004
Messages
9
If I have a hero select how would I make it where if someone picks a warrior his name becomes the warriors name or if he picks a paladin his name becomes the paladins name.

I know how to make a players name change normally but not when you get to choose your hero.
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
I don't have World Editor open, so i'll see what I can remember:
Code:
Events
--Unit - A unit is selected
Condition
--(Selected/triggering unit) equal to [your hero here]
Actions
--Set name of (triggering player) to (unit's name)
 
Level 1
Joined
Jul 10, 2004
Messages
6
Well, I have an idea about the Recipe thing :


Events
TTESST
Events
Unit - A unit Begins training a unit
Conditions
(Unit-type of (Trained unit)) Equal to Recipe
Actions
Set Hero_of_player = (Triggering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero_of_player has an item of type Tome of Experience) Equal to True
(Hero_of_player has an item of type Ring of Protection +5) Equal to True
(Hero_of_player has an item of type Full Vial) Equal to True
Then - Actions
Item - Remove (Item carried by Hero_of_player of type Tome of Experience)
Item - Remove (Last dropped item)
Item - Remove (Item carried by Hero_of_player of type Ring of Protection +5)
Item - Remove (Last dropped item)
Item - Remove (Item carried by Hero_of_player of type Full Vial)
Item - Remove (Last dropped item)
Wait 1.00 seconds
Item - Create Finished Recipe at (Position of Hero_of_player)
Else - Actions
Player - Add COST to (Owner of (Triggering unit)) Current gold

---

I didn't try the trigger and I doubt it will work without tweaking ( a lot.....) But it gives ya an idea
 
Level 4
Joined
Jun 11, 2004
Messages
50
i have to bump this because i was just about to ask the question about hero-specific items, but saw this thread before i did.

so that's my main question, but its a little different from the original poster. yeah, i want items only useable by specific heroes, but i also want it so that i can sell those items from shops, and if any other hero type tries to click on that item to buy it, they get the typical error/invalid sound.

so, i'm feeling confident enough with my use of the GUI trigger functions that if someone points me in the right direction i feel like i could do it. is it possible to detect what item is being sold? i can't find any trigger like that so far...

if i need to set up variables please let me know! i'm not so good with those yet. honestly, not too sure how to create them or how they are used. basically i want an item that just 1 hero can use and i want to specify that in the purchase tooltip, but i want to make sure he's the only one who can buy it too.

any help very very very much appreciated, thanks!
 
Level 1
Joined
Jul 10, 2004
Messages
6
cata said:
i have to bump this because i was just about to ask the question about hero-specific items, but saw this thread before i did.

so that's my main question, but its a little different from the original poster. yeah, i want items only useable by specific heroes, but i also want it so that i can sell those items from shops, and if any other hero type tries to click on that item to buy it, they get the typical error/invalid sound.

so, i'm feeling confident enough with my use of the GUI trigger functions that if someone points me in the right direction i feel like i could do it. is it possible to detect what item is being sold? i can't find any trigger like that so far...

if i need to set up variables please let me know! i'm not so good with those yet. honestly, not too sure how to create them or how they are used. basically i want an item that just 1 hero can use and i want to specify that in the purchase tooltip, but i want to make sure he's the only one who can buy it too.

any help very very very much appreciated, thanks!

Yes, it is possible to detect what item is being sold, I don't KNOW the code for it, but I have been experimenting with a Unique Weapon System that checks every slot for the (type) of item that is picked up, and that is kind of like what you want, a trigger system that checks what hero is buying what item, and if that item is equal to a item that he is not allowed to have, then he will drop that item (or remove and set it up so he gets his money back). And so far, I would have to say, yes, Variables are probably needed. Variables could possibly shorten the whole trigger system, but also could allow it to work more accuratly. Or try without, not impossible, just gotta find the right triggers :D . To start off, the event that is probably used :

Unit - A unit Acquires an item

but for later on use, you will have to tell the editor what unit it is in a variable for storage, and what item for storage, and later. It would actually be a Unique Weapon System. Play Undead Budgie's FFORPG, it has for example, Short Bows, only wieldable by certain chars/jobs, or if they have items, it sounds a lot like what you are looking for, if UndeadBudgie has enough time, he might help you by giving you some of the triggers. Good Luck with your Trigger System! I sure hope you do better then me, so far I've tried about 5 different trigger systems.....

Edit: Ok, well, I took some triggers out of ETS TE 2004 V1.09a for a "recipe" thing, it is the trigger of Recipe Lvl 1, DankStoner made this map btw, some may not like I "took out" a trigger, well not really, I simply opened it up in a readable form of JASS (hope you can read it!) and I can't edit it which is good, it helps teach people about triggers so long as they can read JASS. Here it is :

function Trig_Lvl_1_Recipes_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetSoldItem()) == 'I02Z' ) ) then
return false
endif
return true
endfunction
function Trig_Lvl_1_Recipes_Func002C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I00K') == true ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I00H') == true ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I004') == true ) ) then
return false
endif
return true
endfunction
function Trig_Lvl_1_Recipes_Func003C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I001') == true ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I006') == true ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I005') == true ) ) then
return false
endif
return true
endfunction
function Trig_Lvl_1_Recipes_Func004C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I00S') == true ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I00R') == true ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetBuyingUnit(), 'I00E') == true ) ) then
return false
endif
return true
endfunction
function Trig_Lvl_1_Recipes_Actions takes nothing returns nothing
if ( Trig_Lvl_1_Recipes_Func002C() ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I00K') )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I00H') )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I004') )
call CreateItemLoc( 'I02I', GetUnitLoc(GetBuyingUnit()) )
call UnitAddItemSwapped( GetLastCreatedItem(), GetBuyingUnit() )
call AddSpecialEffectLocBJ( GetUnitLoc(GetBuyingUnit()), "Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl" )
call ConditionalTriggerExecute( gg_trg_DestroySFX )
else
endif
if ( Trig_Lvl_1_Recipes_Func003C() ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I001') )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I006') )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I005') )
call CreateItemLoc( 'I02J', GetUnitLoc(GetBuyingUnit()) )
call UnitAddItemSwapped( GetLastCreatedItem(), GetBuyingUnit() )
call AddSpecialEffectLocBJ( GetUnitLoc(GetBuyingUnit()), "Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl" )
call ConditionalTriggerExecute( gg_trg_DestroySFX )
else
endif
if ( Trig_Lvl_1_Recipes_Func004C() ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I00S') )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I00R') )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetBuyingUnit(), 'I00E') )
call CreateItemLoc( 'I02M', GetUnitLoc(GetBuyingUnit()) )
call UnitAddItemSwapped( GetLastCreatedItem(), GetBuyingUnit() )
call AddSpecialEffectLocBJ( GetUnitLoc(GetBuyingUnit()), "Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl" )
call ConditionalTriggerExecute( gg_trg_DestroySFX )
else
endif
endfunction
function InitTrig_Lvl_1_Recipes takes nothing returns nothing
set gg_trg_Lvl_1_Recipes = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lvl_1_Recipes, EVENT_PLAYER_UNIT_SELL_ITEM )
call TriggerAddCondition( gg_trg_Lvl_1_Recipes, Condition( function Trig_Lvl_1_Recipes_Conditions ) )
call TriggerAddAction( gg_trg_Lvl_1_Recipes, function Trig_Lvl_1_Recipes_Actions )
endfunction




And also, about the unique weapon system of UndeadBudgie's FFORPG, I do not want to put out a post of the whole system at all mainly because of the fact their are multiple triggers that are scattered, and I am unable to find all of them.
 
Level 4
Joined
Jun 11, 2004
Messages
50
so basically,

event
-a unit sells an item

condition
-item type of item being sold equal to (recipe-maker)
-buying unit has item of type (required item1)
-buying unit has item of type (required item2)
-buying unit has item of type (required item3)

action
-remove (required item 1) from buying unit
-remove (required item 2) from buying unit
-remove (required item 3( from buying unit
-hero: create (recipe item) and give it to buying unit

sounds right to me! just doesn't seem to be any way to prevent the cost from being deducted even if the conditions aren't met...jeez i don't want to have to make another trigger to compensate for that.
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
You will have to make another trigger to keep the money, just make it identical as the first one, except that the conditions are the opposite, and make it have one action to add that amount of gold to the player's current gold. I don't thinki there's any other way, unless you use dummy items...
 
Status
Not open for further replies.
Top