[DLL] loadtags and addbytes *example proj*

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

[DLL] loadtags and addbytes *example proj*

Post by modder4321 »

well this dll is my first and it works. i releasing this because its my first and because alot of people have trouble with loading tags in vb.net2005 so i compiled a .dll, i hope this helps and heres a vb.net2005 code snippet of how to use

1. add refrence to .dll(project>add refrence...) then choose browse and select the .dll then the app will look for the dll there but if it cant find it it will look for it at the applications startup path. so just include this with the project if u release

2. code

Code: Select all

Public Class Form1
    Dim open As New OpenFileDialog
    Dim loadtag As New loadtags.Class1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If (open.ShowDialog = Windows.Forms.DialogResult.Cancel) Then Exit Sub
        loadtag.loadarray(open.FileName)
        loadtag.loadtags(open.FileName)
        For i As Long = 0 To loadtag.realtagcount - 1
            ListBox1.Items.Add(loadtag.tagnames(i))
        Next
    End Sub
End Class
there is more it can do and to findout all the functions type in "loadtag." and it will show them all.
u might be wondering y loadarray first well loadarray first because it will save time if u decide to add bytes because it will have it in an array when u use "loadtag.addbytes" and add instantly

http://www.teamdefiance.la/forum/index. ... ost&id=140

post feedback on how u feel or how i could make this better.

heres an example projet on how to use.
http://kayuni.com/H2Dll.rar
Last edited by modder4321 on Thu Jan 05, 2006 10:56 am, edited 1 time in total.
r4nd0m





Posts: 48
Joined: Wed Sep 21, 2005 1:15 pm

Post by r4nd0m »

Pretty nifty
Account=redundant;
If someone in power could delete this.. new account is Prodigy... so, yea... thanks....
Klaz0r





Posts: 49
Joined: Tue Jul 27, 2004 2:36 pm

Post by Klaz0r »

Great dll, but I'm having a problem. Every time I try to compare a string to one in the array, it never finds it. The only way I can get it to match is if I load them up into 2 separate listboxes and compare them from there, but that isn't going to work for the program I'm making.
Kurroda





Posts: 1737
Joined: Sat Sep 03, 2005 10:01 am
Contact:

Post by Kurroda »

can i just ask a question(i am not very adavanced at coding) what would this do ?
Image
Klaz0r





Posts: 49
Joined: Tue Jul 27, 2004 2:36 pm

Post by Klaz0r »

You can use this dll to load a mapfile and work with tags, like finding offsets and stuff. BTW I am still having the problem from above^
Kurroda





Posts: 1737
Joined: Sat Sep 03, 2005 10:01 am
Contact:

Post by Kurroda »

oh really some one should rite a tut for this i would like to use it but dont no how
Image
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

Post by modder4321 »

wat are u trying to compare? or find in the array?
Klaz0r





Posts: 49
Joined: Tue Jul 27, 2004 2:36 pm

Post by Klaz0r »

Say I'm trying to find a tag's ID. I search through the array in a for loop looking for the tag "objects\characters\marine\marine". When I find it, I will use the same index from the loop to locate the ID. But, the for loop never matched the tags. When I'm viewing the array in debug mode during a break, all the tags are listed as something like: "globals\globals without the ending quotation mark, if that has anything to do with it.

And royal, I have a program (that R4ND0M made and I modified) that can show you the code to use the dll(It's written in VB2005). Download it at: http://kayuni.com/H2Dll.rar
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

Post by modder4321 »

Klaz0r wrote:Say I'm trying to find a tag's ID. I search through the array in a for loop looking for the tag "objects\characters\marine\marine". When I find it, I will use the same index from the loop to locate the ID. But, the for loop never matched the tags. When I'm viewing the array in debug mode during a break, all the tags are listed as something like: "globals\globals without the ending quotation mark, if that has anything to do with it.

And royal, I have a program (that R4ND0M made and I modified) that can show you the code to use the dll(It's written in VB2005). Download it at: http://kayuni.com/H2Dll.rar
in the loop u should have something like.

Code: Select all

dim w as long = 0
do until w = realtagcount - 1
if loadtag.tagnames(w) = "objects\characters\marine\marine" then
do something
endif
w += 1
loop
btw i added that example proj to the main post
superaison





Posts: 175
Joined: Mon Jul 25, 2005 5:06 pm

Post by superaison »

yay, Kayuni, i think we can finally finish!!
Not allowed more then three lines in your Sig.
Kurroda





Posts: 1737
Joined: Sat Sep 03, 2005 10:01 am
Contact:

Post by Kurroda »

thanks i use vb2005 i like it much more than 6 i have both versions
Image
Klaz0r





Posts: 49
Joined: Tue Jul 27, 2004 2:36 pm

Post by Klaz0r »

Still not working, here is the code I am using:

Code: Select all

For i As Long = 0 To loadtag.realtagcount - 1
   If loadtag.TagTag(i) = "hlmt" Then
      If loadtag.tagnames(i) = replacedtag Then
         bipdoffset = loadtag.TagOffset(i)
         bipdid = loadtag.TagID(i)
      End If
   End If
Next
I put in the "If loadtag.TagTag(i) = "hlmt" Then" line to help speed things up, that way only hlmt's are checked.

But anyway, I think my VB may be buggy. Cause when I use a breakpoint at the spot, and then check the contents of the array, they are all listed as something like: "objects\characters\marine\marine (notice the last quotation is missing). When I make my own array, there is a quotation on each side. Sorry for bugging you, but if I can get this to work, then I can finish my program. Also, your code gave me the same problem.
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

Post by modder4321 »

debug it and c wat if it doesnt go into(does it not find hlmt or the tagname?)

then i can help its possible that i accidently did something so the tagtag's are reversed...
superaison





Posts: 175
Joined: Mon Jul 25, 2005 5:06 pm

Post by superaison »

mmmmk, it like here ill take a pic 4 ye:

Image
Not allowed more then three lines in your Sig.
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

Post by modder4321 »

well tagid should be dimmed as

0 to realtagcount - 1

that error means ur trying to do something like

dim some(0 to 9) as string
some(100) = "this will have an error because its not a valid number in th array"
Klaz0r





Posts: 49
Joined: Tue Jul 27, 2004 2:36 pm

Post by Klaz0r »

Ok, i fixed the problem, the string is fixed when it is loaded into a text box and then re-extracted. Thanks anyway for your help. And btw, the hlmt part works fine, I can get it to parse through all the tags and only load up hlmts or bipds.
Post Reply