• 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

Custom Resource

I've been at this for hours, and frankly this is must be so simple I'm missing it.

- I've created a custom Resource called Ship Creation Points "resSCP".
- I'm created modified Priorities that add default starting values for Ship Creation Points.

I cannot figure out how to set the "resSCP" current value.

For example, I'm trying to do:

Code:
hero.child[resSCP].field[[I]something here[/I]].value = 200

Unfortunately, I don't know what field actually represents the actual current value of this thing. I can't find it anywhere.

This is obviously basic, but I'm totally missing it.

Thanks for any help.
 
In the develop menu, make sure "Enable Data File Debugging" is enabled. Then, right click one of the resources you see on the basics summary panel, and choose "Show debug fields for XXXXX".

Then, take a look at the field names - you can also compare the numbers in the fields to the displayed numbers to see what's storing what, and find the field that stores the maximum value for that resource.
 
Okay, so I now think I'm not using this correctly. I'm needing this to update the value of the SCP Resource whenever the priority is changed.

I have five priority entries, A-E, and each one I have tried to set the Eval Script to the appropriate number of SCP, but the value doesn't change when the priority is changed. I've also set this value as an Auto-add, but this doesn't make a difference. I seriously have no idea what I'm doing wrong.
 
Sorry, how did you add the value as an auto-add?

Auto-adding something adds a new item to the character. So how did you set a new value by adding a new item? And this is a resource - you want that to be a permanent part of the character, so why auto-add it as a temporary thing, not bootstrap it as a permanent addition?

Could you please show me the script you're trying to use for this? Make sure to include the phase & priority you're running the script at.
 
I added the Auto-add to the Priority thing. To do the Auto-adds, I set <Choose thing!> to "resSCP", added the field "resMax" in the Fields dialog, and set the Value to 200 with "Assign" option selected.

When trying to use the Eval Scripts, I used:

Code:
if (hero.childlives[resSCP] <> 0) then
  hero.child[resSCP].field[resMax].value = 200
endif

I thought Auto-adds was simply added when the Priority thing was active and selected. I.e., if Priority A is set, the SCP are 200. If Priority B is set, the SCP are 160, etc.
 
I believe auto-add is to automatically bootstrap items with a single selection, like a kit of items where you add the kit and it automatically adds everything else to the character individually.
 
All priorities are always present on all characters, unless they have a source that isn't turned on. Then, the user's choice for that priority chooses which one of them to activate and apply the effects from. But bootstrapped/auto-added items are not something that's automatically tied to the activation state of an item, so what you ended up doing is adding 5 copies of your resource.

So, in the develop menu, look at the bottom, at "Floating Info Windows", and then "Show Hero Tags" - watch those tags change as you change priorities.

Once you've figured out the tags that represent the correct priority, on the Mechanic you've created for your system, add an eval script that has an if...elseif...endif and uses that to figure out the priority and assign the correct value to the resource.

Also, you left out the phase & priority you used for your script, so if there's a problem with the timing, I still don't have enough information to help you debug that.
 
Yeah, the phase and priority, I'm still trying to figure out the effects and when things fire.

But assuming I create a logic saying "if priority A is active, set SCP to 200", what would you recommend the phase and priority be to ensure this is triggered whenever the user changes the priority locations?
 
Looks like there's a wide range for that - after Initialize/750, and before Traits/5000.

Here's how to find that out;

First, right-click one of the priority selections on the basics tab - "Metatype" or "Magic or Resonance", for example. Then, select "Show Debug Tasks for XXXX", and look at the list of scripts that are running on that pick - you'll see one named "[Apply Priority Table Selections] Eval Script" at Initialize/750.

To find out the late extent, right-click one of the resources, and look at its tasks - you'll see one named "[Calc resLeft #1]" at Traits/5000.
 
YES! Got it working! Set the phase to Initialization and the priority to 1000.

Working script:
Code:
if (hero.childlives[resSCP] <> 0) then
  if (hero.child[priMagic].field[priOrder].value = 1) then
    hero.child[resSCP].field[resMax].value = 200
  elseif (hero.child[priMagic].field[priOrder].value = 2) then
    hero.child[resSCP].field[resMax].value = 150
  elseif (hero.child[priMagic].field[priOrder].value = 3) then
    hero.child[resSCP].field[resMax].value = 80
  elseif (hero.child[priMagic].field[priOrder].value = 4) then
    hero.child[resSCP].field[resMax].value = 20
  elseif (hero.child[priMagic].field[priOrder].value = 5) then
    hero.child[resSCP].field[resMax].value = 0
  endif
endif

Thanks for the help!
 
Test that under Sum To Ten, as well as normal character creation. priOrder is not used in Sum To Ten (and Street Scum and High Life) and priSmOrder is used instead.

Use the MagicPrior tags on the hero instead (I just double-checked, and those aren't assigned until Initialize/1000, so move your script back slightly to Initialize/2000).
 
Back
Top