Shadow orb

Rui

New Member
Reaction score
0
I tried placing shadow orbs and fragments on the map but they don't stack like in the campaign, how do i do this so I can create a shadow orb +10 in game?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I am not going to write those triggers for you, but here is a rough draft of what you need to do:
1) Create 10 copies of your shadow orb item. One for each level.
2) Have one additional copy of the shadow orb item which will be placed on the map and be picked up!
3) Have a trigger for picking up the item: (pseudo code)
Code:
Event
    a unit picks up an item
Condition
    (item being manipulated) == Shadow Orb (Map-Version)
Actions
    remove (item being manipulated)
    if (triggering unit) carries item of type "Shadow Orb Lvl 1"
        remove the item of type "Shadow Orb Lvl 1" from (triggering unit)
        add item of type "Shadow Orb Lvl 2" to (triggering unit)
    else if (...) // continue like this for all levels
4) Have another trigger for dropping the item: (pseudo code)
Code:
Event
    a unit drops an item
Condition
    or any
        (item being manipulated) == Shadow Orb Lvl 1
        (item being manipulated) == Shadow Orb Lvl 2
        (item being manipulated) == Shadow Orb Lvl 3
        ...
Actions
    create new item of type "Shadow Orb (Map-Version)" at the location of (dropped item)
    remove (dropped item)
 

Rui

New Member
Reaction score
0
I am not going to write those triggers for you, but here is a rough draft of what you need to do:
1) Create 10 copies of your shadow orb item. One for each level.
2) Have one additional copy of the shadow orb item which will be placed on the map and be picked up!
3) Have a trigger for picking up the item: (pseudo code)
Code:
Event
    a unit picks up an item
Condition
    (item being manipulated) == Shadow Orb (Map-Version)
Actions
    remove (item being manipulated)
    if (triggering unit) carries item of type "Shadow Orb Lvl 1"
        remove the item of type "Shadow Orb Lvl 1" from (triggering unit)
        add item of type "Shadow Orb Lvl 2" to (triggering unit)
    else if (...) // continue like this for all levels
4) Have another trigger for dropping the item: (pseudo code)
Code:
Event
    a unit drops an item
Condition
    or any
        (item being manipulated) == Shadow Orb Lvl 1
        (item being manipulated) == Shadow Orb Lvl 2
        (item being manipulated) == Shadow Orb Lvl 3
        ...
Actions
    create new item of type "Shadow Orb (Map-Version)" at the location of (dropped item)
    remove (dropped item)
thanks dude!
 

Rui

New Member
Reaction score
0
Here is my current code can anyone tell me how to fix it, i know in the beginning i have to create the orb +1 from the fragment but i dont know how to set that condition for only when the character has no other fragments, for example, i pick up 2 fragments and it gives me 2 orbs+1 instead of 1 orb+2
Events
Unit - A unit Acquires an item

Conditions
(Item-type of (Item being manipulated)) Equal to Shadow Orb Fragment

Actions
Item - Remove (Item being manipulated)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Hero - Create Shadow Orb +1 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +1) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +2 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +2) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +3 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +3) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +4 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +4) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +5 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +5) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +6 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +6) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +7 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +7) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +8 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +8) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +9 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Shadow Orb +9) Equal to True
Then - Actions
Item - Remove (Last created item)
Hero - Create Shadow Orb +10 and give it to (Triggering unit)
Else - Actions
Do nothing
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
You want something like this:
Trigger:
  • ShadowOrb PickUp
    • Events
      • Unit - A unit aquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Shadow Orb (Dummy)
    • Actions
      • -------- Remove the dummy item that was picked up --------
      • Item - Remove (Item being manipulated)
      • -------- Check for the current level of the orb that is being carried --------
      • -------- Variable "TempBool" will check whether any item was added or not --------
      • Set TempBool = False
      • -------- First Level -> Second Level --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Triggering unit) has an item of type Shadow Orb Lvl1) Equal to True
      • Then - Actions
        • Item - Remove (Item carried by (Triggering unit) of type Shadow Orb Lvl1)
        • Hero - Create Shadow Orb Lvl2 and give it to (Triggering unit)
        • Set TempBool = True
      • Else - Actions
      • -------- Second Level -> Thid Level --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Triggering unit) has an item of type Shadow Orb Lvl2) Equal to True
      • Then - Actions
        • Item - Remove (Item carried by (Triggering unit) of type Shadow Orb Lvl2)
        • Hero - Create Shadow Orb Lvl3 and give it to (Triggering unit)
        • Set TempBool = True
      • Else - Actions
      • -------- Thid Level -> Fourth Level --------
      • -------- ... --------
      • -------- ... --------
      • -------- ... --------
      • -------- First Level --------
      • -------- Hero was not carrying any level previously. Create first level --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempBool Equal to False
      • Then - Actions
        • Hero - Create Shadow Orb Lvl1 and give it to (Triggering unit)
      • Else - Actions
 

O.A

Quantum physics rules
Reaction score
29
Correct me if I'm wrong, Accname, but in that system, unless I missed something, if I set the OrbX on the ground and pick up the dummy I will get a 2nd Orb (lvl1). And if the OrbX will be removed when dropping it, like you wrote in post #4, then after that I would once again get OrbLvl1, which would effectively cancel the progress made in accumulating the fragments of the Orb, no? Also, in the above trigger, I believe, if you don't add the TempBool condition to all the If/Then/Elses the orb will immediately grow to Lvl10 after Lvl1, since it will be continuously replaced by the new orb. It's 3am, I might have missed something...

EDIT: @Rui; if you copy your code in between the tags [WC3.] X [/WC3.] without the punctuation marks, it will look a lot better on the site, and will be easier to read through. X would be your code there.
 
Last edited:

Accname

2D-Graphics enthusiast
Reaction score
1,462
You are right O.A, thats why I said "something like ...".
I didnt test anything, but its a step in the right direction. The TempBool variable must be checked in every other condition to make this one work.


To get it working really well I would prefer to go with integers and Item-Type arrays. But to make that MUI you would probably need hashtables and I simply doubt the op is ready for that.
 

jonas

You can change this now in User CP.
Reaction score
67
Here is something else that you might want:
Make your code tabledriven.
That is, create a global item type array and initialize it like this:
Code:
...[1] = orb +1
.
...[i] = orb + i
.
...[10] = orb + 10
Then go through it with a loop to determine which one is already there and add the next one.

Later you can try to get the index of two items, add them, and get the combined result.
Code:
 ...[a] + ...[b] = ...[a+b]

(if a+b <= 10)

And also you might want to go through the items before you start creating anything, and remove the combined items before you combine them. That should be enough to prevent it from combining too much.
 
Last edited:
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top