Doom Angel's Question Thread

Chocobo

White-Flower
Reaction score
409

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
"Channel", as well as "Spell Book" and "Charge Gold and Lumber", come with a special option, "Data - Order ID", which can be used to actually change the order it uses.

Which makes it rather easy to avoid any conflicts.

Now, if, for example, you have some unit with "Heal", and add a version of Channel where you set the order to "heal" too... there's a problem.

Well, there's plenty of orders to choose from.


Note: Changing "text - order string" does nothing. It doesn't do anything on Channel either.
It's no problem to have several channels on the same unit with all the same text - order string.
Provided, of course, that all "Data - Order ID"s are unique.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
k thx for the explanation guys +Rep :)

and i still have my other question:
Though it should be rather easy to keep a list of spells the unit learns or gets from buying or so.
so from what i understand u meant to detect when u unit learns a skill and add it to variable but yet i tried it and i can't since i don't have any option to do something like:
Code:
Set Ability = (Learned Ability)
anyway to add the learned ability to a variable?
any answer?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Code:
Events
    Unit - A unit Learns a skill
Conditions
Actions
    Custom script:   set udg_Ability = GetLearnedSkill()
    Game - Display to (All players) the text: (Name of Ability)
 
Z

Zell

Guest
Note: Changing "text - order string" does nothing. It doesn't do anything on Channel either.
It's no problem to have several channels on the same unit with all the same text - order string.
Provided, of course, that all "Data - Order ID"s are unique.
The order string can be used as sort of a classification of the spell, as with items. Let's say you gave the order string "heal" to all of your spells that heal or give a positive buff. You can then use "Conversion - Convert Order to String" to obtain the order string and do actions accordingly. This could be used for some sort of 'Divine Favour' effect from Guild Wars. But again, order string will never, ever cause a conflict if a unit has multiple spells of the same string. Only the ID is important.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
hmm Zell there's another way for conflict with order string and that's when using issued order by trigger so if both are with same order string only one of them would run.....
____________________________

k Ace i made something and im pretty sure it's k:
Code:
Untitled Trigger 001
    Events
        Unit - A unit Learns a skill
    Conditions
    Actions
        For each (Integer A) from 1 to 5000, do (Actions)
            Loop - Actions
                Custom script:   if (udg_Ability[GetForLoopIndexA()] == null) then
                Custom script:   set udg_Ability[GetForLoopIndexA()] = GetLearnedSkill()
                Custom script:   endif
is there anyway for me to detect as well other spells?
like spell from spell book or any other way that adds skills by not learning? (not including trigger actions)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> any other way that adds skills by not learning? (not including trigger actions)

What way would that be?

As for the Spell Book, well, you know what spells are inside...
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
well k thx
just one question:
Code:
Untitled Trigger 001
    Events
        Unit - A unit Learns a skill
    Conditions
    Actions
        For each (Integer A) from 1 to 5000, do (Actions)
            Loop - Actions
                Custom script:   if (udg_Ability[GetForLoopIndexA()] == null) then
                Custom script:   set udg_Ability[GetForLoopIndexA()] = GetLearnedSkill()
                Skip Remaining Actions
                Custom script:   endif
i don't want every ability to be set so i need to stop it somehow when the "if" is true so my question is if i make 'Skip Remaining Actions' inside Integer A loop would it still skip the remaining loops as well?
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
k here's a new question:

is it possible to detect which abilitys a certain unit has?
(checking it 1 by 1 won't help i can't start checking every skill)

i don't mind either JASS or GUI solution.

+Rep Guaranteed :D

This is going to be long and painful to code, but it's doable...
It will use the idea of binary coding...

Make an ability array and set all abilities (save for dummy-only abilities) that a unit in your map COULD have to it in this order.

Ability[1] = A
Ability[2] = B
Ability[4] = C
Ability[8] = D
Ability[16] = E

The number you seek is always (sum_of_all_previous_numbers + 1)


Then set the Point value of a unit to the sum of the unit's ability handlers.
Example: My unit has Ability A, D and E -> Point value of unit = 1+8+16 = 25

Whenever a unit loses/gains a skill you substract/add that skills value to the point value of the unit.

Now comes the hard part:
To list the abilities of a unit, you must convert it's point value back into a series of numbers, which you then list.

Example:
For each Integer A: 1 -> "amount of ability codes you got from breaking point value down into bits"
Do - Action - Set tempInteger = BitsYouGotFromBreakingDownPointValueArray[Integer A]
Do - Action - Show Message ("I have the ability: " + ConvertToString(Ability name of AllAbilities[tempInteger]))


I forgot the most efficient way to break down a binary-ish number into the bits, but it's out there on Google ;)


2 problems:
Many abilities = Point values like 1.244.224.353.535 could occur, and I don't know the WE limit for it.
Setting the point values in WE for each unit may be time-absorbing, but only needs to be done once though.


EDIT: If point values have a limit, you could create 2 more arrays:

UnitType_AllUnitsThatCOULDBeInMyMap[1] = Unit Type 1
UnitType_AllUnitsThatCOULDBeInMyMap[2] = Unit Type 2
etc

Integer_ValueForUnitType[1] = "number that would be the point value for this unit type"
Integer_ValueForUnitType[2] = "number that would be the point value for this unit type"
etc.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
thx but i already found a solution for the ability thing (as u see see at posts above)
and also i was speaking about abilitys which are i dunno about them not abilitys i do know about....

so i only need to know is if skip remaining actions also work for loops (skip remaining loops as well)
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
thx but i already found a solution for the ability thing (as u see see at posts above)
and also i was speaking about abilitys which are i dunno about them not abilitys i do know about....

so i only need to know is if skip remaining actions also work for loops (skip remaining loops as well)

Just set LoopIntegerA to MaxAmountOfLoops and it will end the loop.

Code:
Untitled Trigger 001
    Events
        Unit - A unit Learns a skill
    Conditions
    Actions
        For each (Integer A) from 1 to 5000, do (Actions)
            Loop - Actions
                Custom script:   if (udg_Ability[GetForLoopIndexA()] == null) then
                Custom script:   set udg_Ability[GetForLoopIndexA()] = GetLearnedSkill()
                Set Integer A = 5000
                Custom script:   endif
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
just so u know u can't just do:
Code:
Set Integer A = 5000
u need to use custom script:
Code:
Custom script:  set GetForLoopIndexA() = 5000
and i already thought of it be4 and i planned to use it in case of the skip is not possible, not that i realy need it but i wanna know if it's possible (i have this question bugging me long time)
so anyway any1 answer this little question? :)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> set GetForLoopIndexA() = 5000

???

You can't assign a value to a function call...


set bj_forLoopAIndex = 10000

or, even simpler:
exitwhen true
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
set bj_forLoopAIndex = 10000
k thx for for letting me know.
exitwhen true
when the if\then\else is true?
i don't want every ability to be set so i need to stop it somehow when the "if" is true so my question is if i make 'Skip Remaining Actions' inside Integer A loop would it still skip the remaining loops as well?
i still got this question (i know i have other ways but i wanna know :p)
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
k thx for for letting me know.

when the if\then\else is true?

i still got this question (i know i have other ways but i wanna know :p)

Code:
E - 5.00 seconds in game
C - none
A - For each Integer A from 1 to 10
   L
       A - Show message "Loop nr." + Integer A + "is being run"
       A - If Integer A = 5, then Skip Remaining Actions, else Do Nothing

If this shows 5 lines of text, it works; if it shows 10, it doesn't.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> when the if\then\else is true?

...


Code:
loop
    ...some actions, or maybe no actions at all, as you need it
    exitwhen <condition>
    ...some actions, or maybe no actions at all, as you need it
endloop

"exitwhen" evaluates its condition.
If the result is "true", it breaks out of whatever loop it is in.

"exitwhen true" ends loops instantly.
The condition, "true", is always true...


"Skip remaining" instantly returns from whatever function it is in.

With the trigger from post #137 for example, the trigger would end with the skip action.
(Assuming an integer can be set to null...)


1.
For each integer A from 1 to 10
- Skip remaining actions
Game - Display to (All players) the text: "You will never see this"

2.
For each integer A from 1 to 10
- Custom script: exitwhen true
Game - Display to (All players) the text: "This text will show"
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
2.
For each integer A from 1 to 10
- Custom script: exitwhen true
Game - Display to (All players) the text: "This text will show"
so exitwhen true would skip only the next loop right?

the trigger would end with the skip action.
k thx
only 1 more issue:
if i skip the loop can i continue the actions beyond the loop?
i mean as skiping only the loops of integer A and continue with actions outside the loop
(im pretty sure not but i gotta ask it)
 
I

IKilledKEnny

Guest
if i skip the loop can i continue the actions beyond the loop?


Most certainly. When setting exitwhen = true you exit the loop, however, the rest of the trigger remains unchanged becuase you did not do anything but making the loop's exit condition to true.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • 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!
  • 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

      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