• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

How to do things I don't know how to do?

risner

Well-known member
Transition to a bootstrap from the bootstrapper? Say I bootstrap 'booted' and assign it a tag 'User.bootme'. This doesn't seem to work:
Code:
perform this.child[boostrapid].assign[User.Something]

Also I'd also like to ammend the description, and I've tried everything I can think to do:
1)
Code:
perform this.child[boostrapid].appenddesc[description,"blah"]

2) I also tried bootstrapping via a gizmo
Code:
perform gizmo.child[boostrapid].appenddesc[description,"blah"]

3) I also tried a loop:
Code:
foreach pick in hero where "thingid.boostrapid"
    eachpick.appenddesc[description,"blah"]
  endif
nexteach

Anyone have any ideas? I keep coming back to wanting to do things this way. And I've long been unable to solve the problem.
 
I don't understand what you are trying to do with the first one.

With the description, there is a macro for that.

#appenddesc[thingid, 'desc text']

I am not at HL right now, so I am unsure if that is the exact format. You can search for the macro though.
 
I worry about multiple of the same thingid and since child[] only finds the first I worry that #appenddesc does the same or does all of them. I need a specific one to make sure I don't modify a different one I shouldn't touch.

The only way I know to get the one I am sure I want is to put something unique (tag or field) on the bootstrap and loop looking for that unique field. Then I have it on an eachpick. focus.

Mathias said:
Code:
#appenddesc[#thing,#descript] is:

perform state.thing[#thing].amendthing[description,state.thing[#thing].field[descript].text & "{br}{br}" & #descript]

I also tried .amendthing via the loop.

Does state.thing[] work like child[] where it finds the first? Or does it find all? How can I apply amendthing to the current eachpick. value?
 
Last edited:
What are you trying to do that there would be multiple versions of the same Thing displayed? Are you trying to adjust a spell the first time it shows? Are you wanting to change a racial special depending on the level?
 
What are you trying to do that there would be multiple versions of the same Thing displayed? Are you trying to adjust a spell the first time it shows? Are you wanting to change a racial special depending on the level?

Various tasks. For example, load an item (bootstrap) and modify it in some way. Which is better than making a separate item for each "similar" item. Other cases I've wanted to do this is to make a generic tracker and modify it's name and description to order. Otherwise I need a new tracker per thing that needs tracked.

Both of those tasks I wouldn't want to modify all those things, since only the one I bootstrapped would be an item I want to change.

I've been playing all morning with trying to make a Gizmo. Apparently the Gizmo Entity Id is predefined and the only two I can find are wSpecMagic and mSpecMagic. When I make a gizmo using either of those, and add a bootstrap below it, they do not show up.
 
CustDesc is deprecated, but I can't get access to the existing description. I seem to only be able to modify it. So I can't just append to the end since I can't find what it is set to now.

A different problem was a tracker. I couldn't find a field I could modify that would change it's description.
 
Last edited:
Unfortunately you can't directly transition from the bootstrapper to the bootstrapped thing, although you can go the other way with the root. transition. Closest thing you can do is foreach through things, check that they are bootstrapped to the thing you want, and then modify them if they are.

Also, you can't add a pick in an eval script, but you can always bootstrap that pick with a marker, and then hide or reveal it with an eval script appropriately (to make it seem like it is added under certain circumstances). This can be good if you can't do a bootstrap condition.
 
I just confirmed that:
Code:
#appenddesc[thingid,"blah"]

Does modify all copies of thingid.
Just to build on this your not modifying all copies as much as your modifying the "Thing" and not the "Pick".

When something is in the XML and NOT loaded yet onto a character/hero we call it a "Thing" and it has to be unique by its very design. Once added to a the hero, and based on settings, a Pick can have multiple instances of itself running each with different Field values or Tags.

So going from a Thing to Pick is like the same as instantiating a new object or a unique instance of an object in memory.

So the #appenddesc[] is actually modifying the text on the Thing which is then carried over to all the Picks. This is why if you use #appenddesc[] on a feat the changed text actually shows in the List of Feats. This is the only macro/function that I know of that can actually modify a Thing.
 
you can go the other way with the root. transition.

I believe both of these will result in the same end, but which is less CPU:

Narrow by a thingid--
Code:
foreach pick in hero where "thingid.ioRbItems"
  if (compare(this.idstring, eachpick.root.idstring) = 0) then

or

Skip the additional check in the foreach loop
Code:
foreach pick in hero
  if (compare(this.idstring, eachpick.root.idstring) = 0) then

How about the other question? Can you do amendthing inside a foreach loop? If so what is the syntax? Since in the case of an object I would like to reuse, I can't use the macro as I will have other objects I don't want to modify.
 
Good point. I guess even if I managed to get amendthing to work in the foreach it would still be reflected in all picks.
Correct. So if you had two Picks and did different Text on each one the text you set on the last one would actually be on BOTH picks. Cause you really changed the "Thing" not the Pick.

So your foreach has to be foreach thing also not a foreach pick which is what you see 99% of the time.
 
Back
Top