| 09-11-2002, 11:53 PM | #1 |
Guest | I got good help on my last question, so I got one more that I thought might be cool. I can create a custom magic item. I can create a custom creature (like a modification of the Inferno called SuperInferno). It seems like the effects that are assignable to an item are all pre-set and can't be changed (for example, you can have an item use the Item-Inferno ability). What might a trigger look like that would summon a custom unit (like my SuperInferno) to a point on the map specified by the hero when the item is used, and NOT the normal effect assigned. I know it has something to do with: "A unit uses an item" "Item type of item being manipulated equal to "whatever item" and "Unit - Create..." First problem: I get the effect or unit that is normally summoned, and I get the unit appearing next to me (the only way I've gotten it to work is to create the new unit next to the triggering unit), and not where I want - like the normal Inferno effect. Any help on this one? Is it even possible? Thanks. |
| 09-12-2002, 12:28 AM | #2 |
Why don't you just edit the infernal into your super infernal? |
| 09-12-2002, 06:12 AM | #3 |
Guest | Because that would be toooooooooo easy and wouldn't give me an aneurysm in the process. :) I think I wanted to have a game where it was possible to have both an item that summoned an inferno, then another item that would summon the improved type, so I couldn't modify the original inferno type. I may just go with your idea in the end though. Thankz |
| 09-12-2002, 09:19 AM | #4 |
Guest | the only solution for that is to create a custom trigger.... so (i don't feel like writing it, cuz i don't feel so good, i'm gonna pass out on the floor :) ) make it look like replacing that infernal something like this function InfernoSwap_Conditions takes nothing returns boolean if ( not ( GetSummonedUnitType() == ' "InfernoName" ' ) ) then return false endif return true endfunction function InfernoSwap_Actions takes nothing returns nothing call TriggerSleepAction( 0.01 ) call AdjustPlayerStateBJ( ( ( GetUnitPointValue(GetTriggerUnit()) / 2 ) * R2I(( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) / GetUnitStateSwap(UNIT_STATE_MAX_LIFE, GetTriggerUnit()) ))), GetOwningPlayer(GetTriggerUnit()), "SuperInfernoName" ) endfunction //=========================================================================== function InitTrig_InfernoSwap takes nothing returns nothing set gg_trg_InfernoSwap = CreateTrigger( ) call TriggerRegisterPlayerUnitEventSimple( gg_trg_InfernoSwap, Player(0), EVENT_PLAYER_UNIT_SUMMON ) (copy this for all players,just change the Player(0) to Player(X) where X is player #) call TriggerAddCondition( gg_trg_InfernoSwap, Condition( function InfernoSwap_Conditions ) ) call TriggerAddAction( gg_trg_InfernoSwap, function InfernoSwap_Actions ) endfunction i think that this should work fine, altho i'm not feeling quite ok, so i may have missed something, but i think it's ok....if that doesnt work try like this E-Unit is selected *E-hero manipulates an item C-Unit type of triggering unit is Infernal *C- Item being manipulated is ... A-Unit replace triggering unit with a SuperInfeno using the New unit's max mana and life i think that this should work :) |
| 09-13-2002, 05:19 AM | #5 |
Guest | Or you could just move the last created unit (the superinferno) to the region you want as soon as it's created. EDIT: I just used: Event: <Hero> uses item Action: Unit-Create 1 <unit> at <region> facing <angle> That worked fine for me. |
| 09-13-2002, 03:28 PM | #6 |
Guest | Thanks for the ideas. The programming is a little hardcore for me right now. I havent read anything on getting code to be read by the editor (what the filenames should be, etc.). Are there any good introductions on writting your own code? For the most recent idea: How can I define a reigon that is variable. I konw that I could define a point (x) degrees and a fixed distance from the triggering hero, but how can I have the (x) be the same as the direction of facing (or is already set that way?) Merci, Gracias, and all the other stuff. |
