Zwiebelchen
Hosted Project GR
- Joined
- Sep 17, 2009
- Messages
- 7,234
So... I was using LUA to auto-generate levels for a channel ability. The problem comes with two object data fields that are kind of unique in their implementation for the channel ability:
'Ncl3' and 'Ncl2'; better known as "options" and "target type".
These fields have checkboxes in GUI, allowing to select stuff like "visible" or "physical spell", or target types like "point target" or "self cast".
If you use Ctrl+D to display the raw data for these fields, these options simply get reduced to integers, which should in theory make it easy to write into these fields with the ObjectMerger, right?
Wrong!
It seems that these fields are the only fields in the object editor that are not strings typecasted as integers, but actual integers.
If I use object merger like this, to write the value 0 into the field:
It actually writes 48, which is the ascii equivalent of the character "0".
If I do this:
then the same thing happens.
It seems that whatever I put into the field, object merger will typecast it to a string (and then back to integer), offsetting the input value by the ascii equivalent. Is there a way to prevent this? Or a clever exploit to trick the calculation into putting actual zero into the data field?
Can I use hex like
'Ncl3' and 'Ncl2'; better known as "options" and "target type".
These fields have checkboxes in GUI, allowing to select stuff like "visible" or "physical spell", or target types like "point target" or "self cast".
If you use Ctrl+D to display the raw data for these fields, these options simply get reduced to integers, which should in theory make it easy to write into these fields with the ObjectMerger, right?
Wrong!
It seems that these fields are the only fields in the object editor that are not strings typecasted as integers, but actual integers.
If I use object merger like this, to write the value 0 into the field:
//! i makechange(current, "Ncl3", "1", "0")
It actually writes 48, which is the ascii equivalent of the character "0".
If I do this:
//! i makechange(current, "Ncl3", "1", 0)
then the same thing happens.
It seems that whatever I put into the field, object merger will typecast it to a string (and then back to integer), offsetting the input value by the ascii equivalent. Is there a way to prevent this? Or a clever exploit to trick the calculation into putting actual zero into the data field?
Can I use hex like
0x00
in object merger?