• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

How to move a destructible wherever i want.

Status
Not open for further replies.
Level 11
Joined
Dec 5, 2009
Messages
846
Hello there. Im doing an inventory system. My problem is that how much im trying to change the position of the item i can't move it to the right spot... And im using destructibles for the item icons. I know you can fix this in someway cuz im using the same inventory board as cloudwolf who made diablo 3 and he used destructibles too as icons. Here is a pic how wrong it looks like:

PLEASE HELP! +rep will be given !
 

Attachments

  • Screen.png
    Screen.png
    232.1 KB · Views: 204
Level 11
Joined
Dec 5, 2009
Messages
846
The trigger i used to move the doodads?. Well you can't move doodads like units. Try it yourself. Take a tree or whatever. And try to move the tree like you can do with units, it wont work. Everytime you move the doodad it will jump over some space. And i need that space.

here's a pic so i can show you. You see that i can't put it on the right place there. You can't do it with triggers neither i've tried.
 

Attachments

  • Screen2.png
    Screen2.png
    390.7 KB · Views: 261
Level 11
Joined
Dec 5, 2009
Messages
846
Well i've tested that and it doesn't work if 2 icon fits the other doesn't.. But i don't get it . In the map diablo 3 beta they have a inventory system and they're using same item board and the same doodad as I am. How did they got it to work?
 
Level 11
Joined
Dec 5, 2009
Messages
846
I posted a post right now at the thread. Nope you can't make them dummy units. Because to get the icon as a model you need a model base. Then you need the texture file and texture ID. And so far as i know units doesn't have the texture file.

EDIT1: LTGH has given me premission to send the code to you guys. And he can't help me because before he sended the map to his pal he converted the trigger to JASS and then he deleted the map. Maybe you guys can help me instead the guys who is skilled at JASS. Here's the map. And i want to know how he did with the destructibles.

Thanks !
 

Attachments

  • Diablo-III-beta-Unprotected -.w3x
    6 MB · Views: 59
Last edited:
He simply remove and create destructable instead of move them.
Here is the code part that does that :
JASS:
    // Create new icon
    set udg_rect = GetUnitLoc(GetTriggerUnit())
    call CreateDestructableLoc( udg_A_Weapon_Item_Icon[GetForLoopIndexA()], GetUnitLoc(GetTriggerUnit()), 270.00, 6.50, 1 )
    call RemoveLocation(udg_rect)
    set udg_Inventory_Item_Player1[GetUnitUserData(GetTriggerUnit())] = GetLastCreatedDestructable()
    // Switch Values between slot
    set udg_A_Item_Class_1[GetUnitUserData(GetTriggerUnit())] = udg_A_Item_Class_1[udg_Inventory_Selected_Slot[GetConvertedPlayerId(GetTriggerPlayer())]]
    set udg_A_Item_Type_1[GetUnitUserData(GetTriggerUnit())] = udg_A_Item_Type_1[udg_Inventory_Selected_Slot[GetConvertedPlayerId(GetTriggerPlayer())]]
    set udg_A_Item_Class_1[udg_Inventory_Selected_Slot[GetConvertedPlayerId(GetTriggerPlayer())]] = GetItemType(null)
    set udg_A_Item_Type_1[udg_Inventory_Selected_Slot[GetConvertedPlayerId(GetTriggerPlayer())]] = GetItemTypeId(null)
    // Remove old icon
    call RemoveDestructable( udg_Inventory_Item_Player1[udg_Inventory_Selected_Slot[GetConvertedPlayerId(GetTriggerPlayer())]] )

This is with the event "A player select a unit" : slots are units and when you select them when you already selected an item, it creates the destructable icon in the selected slot and removes the previous one.
 
Level 11
Joined
Dec 5, 2009
Messages
846
Okay thanks but that's not what im searching for. i want to know the point where the destructible is spawning. And please post it in GUI trigger. Because the destructible can't spawn at the position of slot dummy unit. It must be something more.
 
Level 11
Joined
Dec 5, 2009
Messages
846
But the destructable does spawn at the position of the slot dummy unit...
I'm not going to make it in GUI because it would be awful and it's not the request section : I just copied/pasted the code which is used in Diablo III to show you that destructables are not moved but dynacically created.

I didn't mean the whole thing... I just meant the trigger the position trigger. the rest i got myself. But i know what was wrong. I used the wrong model. I took the model from diablo III the item model base. and copied in my map and now it works. And BTW i've already set all the pathings to none.

Thanks anyway.
 
Status
Not open for further replies.
Top