:: --=| Games & Modding |=-- :: - WARCRAFT 3 -
Share | 
 

 Change unit depending on what item in slot 1

View previous topic View next topic Go down 
AuthorMessage
COL
Lisianthus

avatar
Posts : 979
realm_3
Réputation : 5

Regist Date : 2006-11-03

PostSubject: Change unit depending on what item in slot 1   Mon 24 Dec 2007, 14:31

I need a trigger that changes the unit u are using depending on what item is in slot 1
for example
slot1=empty -> Unit=UnarmedDude
slot1=Handgun -> Unit=handgun dude with same current hp/mana etc

....................
Quote :
Courage is what it takes to stand up and speak; courage is also what it takes to sit down and listen. ~Winston Churchill

Back to top Go down
http://www.dotd-stars.com
LTG
Sunny_D

avatar
Posts : 1655
realm_1
Réputation : 3

Regist Date : 2006-02-04

PostSubject: Re: Change unit depending on what item in slot 1   Mon 24 Dec 2007, 16:13

you are triggering today? ^_^

anyway, you know i don't have WE atm, but if i remember correctly it would be something like:

Code:

EVENT
  Unit acquired an item
COND
 
ACTIONS
  if
    Item in slot 1 equal to handgun (should be boolean comparison...)
  then
    Unit - Replace Unit with unit-type handgunner
  if
    Item in slot 1 equal to shotgun
  then
    Unit - Replace with shotgunner etc...

the second one below is for being unarmed:

Code:

EVENT
  Unit looses an item
COND
  Item slot 1 is empty (i believe that cond exists in booleans as well)
ACTIONS
  Unit - replace with Unit (Unarmed)

....................

"Sir, we are surrounded!". "Excellent, then we can attack in any direction."
Back to top Go down
COL
Asgard_Ragna

avatar
Posts : 756
realm_3
Réputation : 7

Regist Date : 2006-01-21

PostSubject: Re: Change unit depending on what item in slot 1   Mon 24 Dec 2007, 18:20

Sunny_D wrote:
you are triggering today? ^_^

anyway, you know i don't have WE atm, but if i remember correctly it would be something like:

Code:

EVENT
Unit acquired an item
COND

ACTIONS
if
Item in slot 1 equal to handgun (should be boolean comparison...)
then
Unit - Replace Unit with unit-type handgunner
if
Item in slot 1 equal to shotgun
then
Unit - Replace with shotgunner etc...

the second one below is for being unarmed:

Code:

EVENT
Unit looses an item
COND
Item slot 1 is empty (i believe that cond exists in booleans as well)
ACTIONS
Unit - replace with Unit (Unarmed)

Doesn't have Wc3 on my new computer but i think you are right, replacing the unit with a dummy unit is the only way it should work.
Back to top Go down
COL
Lisianthus

avatar
Posts : 979
realm_3
Réputation : 5

Regist Date : 2006-11-03

PostSubject: Re: Change unit depending on what item in slot 1   Mon 24 Dec 2007, 20:30

But then I will have to drop the item and pick it up to get the trigger to run right?
I could have something that looks every 2sec or so, but that would slow down a lot.

EDIT: Well I tested sunnys idea and well it worked as far as picking up an item before the game crashed >_> I must have made something wrong.

Code:

Ninemm
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item carried by (Triggering unit) in slot 1) Equal to (Item carried by (Triggering unit) of type 9mmNightHawk)
            Then - Actions
                Unit - Replace (Triggering unit) with a 9mmNightHawk using The old unit's relative life and mana
            Else - Actions

....................
Quote :
Courage is what it takes to stand up and speak; courage is also what it takes to sit down and listen. ~Winston Churchill

Back to top Go down
http://www.dotd-stars.com
LTG
Sunny_D

avatar
Posts : 1655
realm_1
Réputation : 3

Regist Date : 2006-02-04

PostSubject: Re: Change unit depending on what item in slot 1   Wed 26 Dec 2007, 09:08

geez, if just my WE would freaking work! did it crash because of this code btw?

1) ok, is it necessary to have it restricted to a specific slot? in DotDS i would have solved it with restricting 1 weapon per inventory (let only pick up 1 weapon, if you want another, you'd have to drop your current one).

2) would it probably be possible to replace the unit when clicking on the item? or you used that for reloading or something already?

3) besides that, i don't know exactly if the acquired item is already "connected" to slot1 when picking it up. you could try a small wait (0.1) just before the if-then-else.

....................

"Sir, we are surrounded!". "Excellent, then we can attack in any direction."
Back to top Go down
Sponsored content



PostSubject: Re: Change unit depending on what item in slot 1   

Back to top Go down
 
Change unit depending on what item in slot 1
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» I.C.U. (Intensive Care Unit) Clan
» Most powerful 40k unit
» faction change MAY start next week
» Time slot of 12am-5am east or 4am-8amgmt
» Going to Nala's cabin to change.. xD. (KATNISS.)

Permissions in this forum:You cannot reply to topics in this forum
dotd6.net :: --=| Games & Modding |=-- :: - WARCRAFT 3 --