This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: The Null Value  (Read 1323 times)

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
The Null Value
« on: July 20, 2015, 03:40:49 am »
Hello there, i am having some problems representing a null value in maxscript and even in 010 editor. I have tried the ctrl 2 and alt 00 but with no avail. I was not sure if there was a special way to do this or if i had to do it through hex. The reason is because i am currently making an exporter in 3ds max.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Chase

  • Registred Member
  • Loreweaver
  • *****
  • Posts: 116
    • View Profile
Re: The Null Value
« Reply #1 on: July 20, 2015, 03:43:19 am »
isn't it something like
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: The Null Value
« Reply #2 on: July 20, 2015, 09:02:53 am »
I am not sure, i have pressed the "" and the "0" keys together and separately but nothing works. I am still new at programming in maxscript.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: The Null Value
« Reply #3 on: July 20, 2015, 09:33:22 am »
Uh, there isn't any special supposed to happen. The sequence is an escape sequence in strings that represents a zero byte (0x00). "foobar" is 'f', 'o', 'o', 0x00, 'b', 'a', 'r'.

Though, the better question to ask here, instead of answering, is: What are you trying to do?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: The Null Value
« Reply #4 on: July 20, 2015, 09:47:51 am »
I didn't really want to share but i am attempting to create my own wmo exporter for learning purposes. As mirror machine is limited, i wanted to try this to create better wmo's and such. But this is really early and i am not sure what might happen in the future. So i am sure you know that there are many empty bytes in wmo as i was trying to recreate that in maxscript though i have been having some problems.

I am pretty sure you think i am dumb but  from i understand, i have to type "foobar" to get the null value?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: The Null Value
« Reply #5 on: July 20, 2015, 09:51:54 am »
I more wanted to know _where_ you want to "get the null value". What exactly do you need "the null value" for? Where does it have to appear? Why do you need it?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: The Null Value
« Reply #6 on: July 20, 2015, 09:56:56 am »
i want to recreate something like this:
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: The Null Value
« Reply #7 on: July 20, 2015, 10:38:14 am »
Yes, but WHERE?

HOW do you want to write those bytes? How do you write the others?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: The Null Value
« Reply #8 on: July 20, 2015, 10:43:05 am »
I want to write them in my script in maxscript, but that is the problem. I haven't found a functionality in maxscript that can do it.(If i understood from you correctly)

EDIT: The other bytes i created is by doing something like this
Code: [Select]
verHeader = "REVM" --4 Bytes
verChunkSize = bit.intAsChar 4 --4 Bytes
wmoVersion = bit.intAsChar 17 --4 Bytes
Format "%%%" verHeader verChunkSize wmoVersion to:out_file

Now i could have instead of written bit.intAsChar 4, i could have wriiten "x04" but the same result
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: The Null Value
« Reply #9 on: July 20, 2015, 11:20:16 am »
Now i hope i answered your question but to answer "how to write them", i really hope there is a way in maxscript. If there isn't, isn't there a way to run an alternate program after the export and then input the null values? Though i would really dislike doing such thing in the first place. (Sorry for double posting)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: The Null Value
« Reply #10 on: July 20, 2015, 02:03:39 pm »
You apparently don't use binary file IO. What you want is probably http://docs.autodesk.com/3DSMAX/16/ENU/ ... d30e172159

The function in this case would be writelong
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: The Null Value
« Reply #11 on: July 21, 2015, 08:32:25 am »
Thank you it worked! The help is much appreciated. Now i can finally continue on my work.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »