Changing ownership to Custom Value

lindenkron

You can change this now in User CP
Reaction score
102
Trigger:
  • Unit - Change ownership of (Last created unit) to (Player((Custom value of (Item being manipulated)))) and Change color


Edit:
Post #13 has a shortterm explanation if you dont want to read the triggers before you know what I'm trying to achieve.

I narrowed it down, this crashes my game. Need the full trigger? let me know.

Anyone know the reason? :)

EDIT:
Full triggers;

Trigger:
  • PlaceC4New
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Small C4
        • Then - Actions
          • Wait 0.10 seconds
          • Unit - Create 1 Explosive C4 (Small) for (Owner of (Triggering unit)) at TempPoint[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
          • Unit - Change ownership of (Last created unit) to (Player((Custom value of (Item being manipulated)))) and Change color
          • Unit - Make (Last created unit) Invulnerable
          • For each (Integer A) from 1 to 36, do (Actions)
            • Loop - Actions
              • Wait 0.05 seconds
              • Set TempPoint2[(Player number of (Owner of (Hero manipulating item)))] = (TempPoint[(Player number of (Owner of (Hero manipulating item)))] offset by 300.00 towards ((Real((Integer A))) x 10.00) degrees)
              • Special Effect - Create a special effect at TempPoint2[(Player number of (Owner of (Hero manipulating item)))] using Abilities\Spells\Human\SpellSteal\SpellStealMissile.mdl
              • Set SaveSpecialEffect[((Player number of (Owner of (Hero manipulating item))) + ((Integer A) x 12))] = (Last created special effect)
              • Custom script: call RemoveLocation(udg_TempPoint2[GetConvertedPlayerId(GetOwningPlayer(GetManipulatingUnit()))])
        • Else - Actions
          • Do nothing
      • Custom script: call RemoveLocation(udg_TempPoint[GetConvertedPlayerId(GetOwningPlayer(GetManipulatingUnit()))])
      • Custom script: call RemoveLocation(udg_TempLocation)


Trigger:
  • CreateC4Point
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Target item of ability being cast)) Equal to Small C4
    • Actions
      • Set TempLocation = (Target point of ability being cast)
      • Set TempPoint[(Player number of (Owner of (Triggering unit)))] = TempLocation
      • Wait 0.10 seconds


Me and swe_suffer have been trying to figure this out for a while now :p


Edit:
Post #13 has a shortterm explanation if you dont want to read the triggers before you know what I'm trying to achieve.
 

CaptDeath

New Member
Reaction score
103
i suggest using
(player (owner of(triggering unit)))
would that work [^ is free hand]
 

lindenkron

You can change this now in User CP
Reaction score
102
Trigger:
  • CreateC4
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to C4 Explosives (Based off channel)
    • Actions
      • Set TempPoint[1] = (Position of (Triggering unit))
      • If ((Current research level of C4 Explosives for (Owner of (Casting unit))) Equal to 1) then do (Item - Create Small C4 at TempPoint[1]) else do (Do nothing)
      • If ((Current research level of C4 Explosives for (Owner of (Casting unit))) Equal to 2) then do (Item - Create Medium C4 at TempPoint[1]) else do (Do nothing)
      • If ((Current research level of C4 Explosives for (Owner of (Casting unit))) Equal to 3) then do (Item - Create Large C4 at TempPoint[1]) else do (Do nothing)
      • Item - Set the custom value of (Last created item) to (Player number of (Owner of (Casting unit)))
      • Unit - Order (Casting unit) to Right-Click (Last created item)
      • Custom script: call RemoveLocation(udg_TempPoint[1])
      • Set TempUnitGroup[(Player number of (Owner of (Triggering unit)))] = (Units in BuildingSpawn <gen> owned by (Owner of (Casting unit)))
      • Unit Group - Pick every unit in TempUnitGroup[(Player number of (Owner of (Triggering unit)))] and do (If ((Unit-type of (Picked unit)) Equal to Old C4 explosive detonated) then do (Unit - Remove (Picked unit) from the game) else do (Do nothing))
      • Custom script: call DestroyGroup (udg_TempUnitGroup[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])


The Item custom value is set there.
 

CaptDeath

New Member
Reaction score
103
Trigger:
  • CreateC4
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to C4 Explosives (Based off channel)
    • Actions
      • Set TempPoint[1] = (Position of (Triggering unit))
      • If ((Current research level of C4 Explosives for (Owner of (Casting unit))) Equal to 1) then do (Item - Create Small C4 at TempPoint[1]) else do (Do nothing)
      • If ((Current research level of C4 Explosives for (Owner of (Casting unit))) Equal to 2) then do (Item - Create Medium C4 at TempPoint[1]) else do (Do nothing)
      • If ((Current research level of C4 Explosives for (Owner of (Casting unit))) Equal to 3) then do (Item - Create Large C4 at TempPoint[1]) else do (Do nothing)
      • Item - Set the custom value of (Last created item) to (Player number of (Owner of (Casting unit)))
      • Unit - Order (Casting unit) to Right-Click (Last created item)
      • Custom script: call RemoveLocation(udg_TempPoint[1])
      • Set TempUnitGroup[(Player number of (Owner of (Triggering unit)))] = (Units in BuildingSpawn <gen> owned by (Owner of (Casting unit)))
      • Unit Group - Pick every unit in TempUnitGroup[(Player number of (Owner of (Triggering unit)))] and do (If ((Unit-type of (Picked unit)) Equal to Old C4 explosive detonated) then do (Unit - Remove (Picked unit) from the game) else do (Do nothing))
      • Custom script: call DestroyGroup (udg_TempUnitGroup[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])


The Item custom value is set there.
but this creates the mine for the owner of triggering unit so there isnt need to change the owner is there?
 

lindenkron

You can change this now in User CP
Reaction score
102
The C4 being placed is an item.

The item changes owner if the person putting the item down is someone else.

I need the item (building being created when using the item) to change to the original owner of the item (The one who created it)

I need this to make my detonation work.
 

darkbeer

Beer is Good!
Reaction score
84
Code:
Unit - Change ownership of (Last created unit) to (Player((Custom value of (Item being manipulated)))) and Change color

this should only crash if the Custom value is a Player that doesnt exist in GUI like 0.
so somehow the Custom value probably returns 0, but i dont now why yet^^

add a message to see what the custom value is.
 

lindenkron

You can change this now in User CP
Reaction score
102
I've been waiting for a day+ now, take your time mate. Thanks for looking into it :)
Edit;
Just made a If Then Else, "If custom value of last created item greater than or equal to 1 then do Game display - Then a text"

It is 1+ (Me being Red, its probably 1) so still don't know why game crashes :(
 

lindenkron

You can change this now in User CP
Reaction score
102
I can use the ability without crashing but it's not functioning as I want it to, no.
If that answers your question :)
 

Weegee

Go Weegee!
Reaction score
102
why is there a 0.10 wait at the end :confused:

Edit: and also every units custom value is 0, were do you actually set it in that trigger :confused:
 

CaptDeath

New Member
Reaction score
103
i dont wanna read your trigger but are you using the items custom value as the index?
 

lindenkron

You can change this now in User CP
Reaction score
102
Problem is a need 2 events, "Unit uses item" and "unit starts casting an ability"

So trying to fuse 2 triggers together to get both points, the wait is to make sure the other triggers get first..
But any solution will be good because this aint working :(

2nd Post:
i dont wanna read your trigger but are you using the items custom value as the index?

What does that mean?


--------------------

Basically:
What I need is;

Bomb (An item) has an ability that is based off "Dispel".

When you place/ uses that item / uses the ability in the item, it creates a building. I need to change ownership of that to be = (equal) to the custom item value of the Bomb (An item).
 

Weegee

Go Weegee!
Reaction score
102
Wait dude you do know there is no setting for the custom value for the unit right? (if I am wrong please let me know)

Edit: let me explain it if you don't get it about the custom value

each time a unit is created it has a 0 point value. SO if you make a unit, it cant change its ownership since there is no player 0 in GUI
 

CaptDeath

New Member
Reaction score
103
lol dragon lance
Trigger:
  • Item - Set the custom value of (Last created item) to (Player number of (Owner of (Casting unit)))

:p
 

CaptDeath

New Member
Reaction score
103
umm its in the first under all the if then dos dragon you need to get out side NAO!
ps i didnt see it immediately after your post so...
GET OUT SIDE NAO!
--edit---
WERED IT GO IM CRAZY TO!!
-edit-edit-
it was in his 4 post
Here
 

Weegee

Go Weegee!
Reaction score
102
I still don't get why he has to make a unit and then change its ownership if he can just make a dummy unit :p

Offtopic
------------
lol I would +rep you (cause im like that :p) but I already randomly +repped you (like I do to everyone on random threads)
 

lindenkron

You can change this now in User CP
Reaction score
102
I got a Detonate ability. For that ability to be able to detonate the bomb, the bomb(building) needs to be owned by the player using the ability detonate.

aka: (also known as) I need that building to be changed to the owner of the custom item value, since the custom item value is the player number of the player who created the bomb (item) aka: The same person who is detonating.

Any of this starting to make sense to anyone .. soon ? :eek:
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top