wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > General Development
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 09-21-2014, 08:17 PM   #16
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

This part of the code begs to differ.
Collapse JASS:
// If both the old and new units are heroes, handle their hero info.
    if (IsUnitType(oldUnit, UNIT_TYPE_HERO) and IsUnitType(newUnit, UNIT_TYPE_HERO)) then
        call SetHeroXP(newUnit, GetHeroXP(oldUnit), false)

        set index = 0
        loop
            set indexItem = UnitItemInSlot(oldUnit, index)
            if (indexItem != null) then
                call UnitRemoveItem(oldUnit, indexItem)
                call UnitAddItem(newUnit, indexItem)
            endif

            set index = index + 1
            exitwhen index >= bj_MAX_INVENTORY
        endloop
    endif
Fledermaus is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-21-2014, 09:36 PM   #17
andreasaspenberg
User
 
Join Date: Jul 2007
Posts: 149

andreasaspenberg is on a distinguished road (12)

Default

i cant use jass but you already know that. i dont have time to learn jass at this time. i have to learn ruby as that is needed for an rpg maker vx ace game. triggers however dont transfer items when units are replaced.
andreasaspenberg is offline   Reply With Quote
Old 09-22-2014, 12:16 AM   #18
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

That is part of the ReplaceUnitBJ function that ani posted. That is what is called when you use the GUI "Unit - Replace Unit" action. So yes, it will transfer all items to the new unit, provided they are both heroes. Please don't try and say that it won't. Functions don't lie.

If you're refering to this topic, the items weren't transfering because ReplaceUnit only transfers items when both the old and new units are Heroes (and the Gnome unit isn't a hero).

Last edited by Fledermaus : 09-22-2014 at 03:11 AM.
Fledermaus is offline   Reply With Quote
Old 10-02-2014, 05:36 AM   #19
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

Quote:
Originally Posted by andreasaspenberg
Thanks, you've really helped me out a lot with multiple problems! it's really appreciated.
No problem, glad to help.
Fledermaus is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:19 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services