Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Miscellaneous => Topic started by: abdalrahman9 on July 20, 2015, 03:40:49 am

Title: The Null Value
Post by: abdalrahman9 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.
Title: Re: The Null Value
Post by: Chase on July 20, 2015, 03:43:19 am
isn't it something like
Title: Re: The Null Value
Post by: abdalrahman9 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.
Title: Re: The Null Value
Post by: schlumpf 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?
Title: Re: The Null Value
Post by: abdalrahman9 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?
Title: Re: The Null Value
Post by: schlumpf 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?
Title: Re: The Null Value
Post by: abdalrahman9 on July 20, 2015, 09:56:56 am
i want to recreate something like this:
(http://i.imgur.com/2skw20H.png)
Title: Re: The Null Value
Post by: schlumpf 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?
Title: Re: The Null Value
Post by: abdalrahman9 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
Title: Re: The Null Value
Post by: abdalrahman9 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)
Title: Re: The Null Value
Post by: schlumpf 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 (http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-423269A5-B395-4A90-8058-F96C0A24115F.htm,topicNumber=d30e172159" onclick="window.open(this.href);return false;)

The function in this case would be writelong
Title: Re: The Null Value
Post by: abdalrahman9 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.