Programming: VB Programming Tutorial #3

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




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Programming: VB Programming Tutorial #3

Post by Locke »

This one will be more Halo orientated.I will explain how to make a simple program like this.
http://files.halomods.com/viewtopic.php?t=18487
Just got it moved to utilities,people spammed last one.

Im going to again asume you have read the previous tuts.

To start off make a form.Name it frmmain
Change caption to Halo Dedicated Server Program

Make a textbox on the form,and name it txt1.Go down to text and delete it.Go to Multiline,and say True(makes it type on more than 1 line)
Image

Now that you have that,lets create some labels
Drag out a label and place it on screen.Change caption to
Server Name

Make a new label and change caption to Maxplayers

Make a new label and change caption to Maps

Make a new label and change caption to gametypes

And creat a command button called submit
cmdsubmit
Caption=Submit
Image
Now create a txtbox,name it txtname,and delte the text from it.Place it next to the label that says Server Name

Create another textbox and name it txtmaxplayers,and delete all text,And place by label Maxplayers

Create another textbox and name it txtmap,and delete all text,And place by label Map

Create another textbox and name it txtgametype,and delete all text,And place by label Gametype
Image
Now for some coding
type
txt1.text="sv_name "+""""+txtname+""""
'That says,type sv_name then add a space,and put "" around the name the user typed in.
So txt1 will say
sv_name "Test"

go down a line anf type
txt1.text=txt1.text+vbcrlf+"sv_maxplayers "+txtmaxplayers
You dont need the "" around it cause its a number
txt1.text=txt1.text,that means add this to the current txt1(otherwise,it would delete what you said,and qrtie new text)
vbcrlf just makes it go to next line

now go to next line and type
txt1.text=txt1.text+vbcrlf+"sv_mapcycle_add "+txtmap+" "+txtgametype
Longer code there,cause it combines txtmap,and gametype together
Image
Now run and type Name,maxplayers,map,and gametype.
Image

And thats the basics of my program.Youll have to mess around a bit to put in more stuff.

All the dl's for vb trial have disapered and I cant find them.Search google for
Visual Basic 5.0 Control Edition

if you find a link please post it here
Any suggestions for another tut?
Image
Feel free to send me an instant message if you need anything.
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post by [CL]9mm-Man »

Sweet tutorial there, Im going to try adding more things like FF and stuff (yeah, I know you did it, but I wanna try figure it out myself) Good job, nice and easy to follow.
Your image cannot exceed 400x200 or 50kb
User avatar
Locke




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Post by Locke »

The problem is if its not easy then people wont readSo I want to make better tuts,but there harder.So Im limited to what people can understand
Image
Feel free to send me an instant message if you need anything.
User avatar
Danke




Wordewatician 500 Mad Hatter

Posts: 2256
Joined: Sun Nov 02, 2003 7:44 pm

Post by Danke »

Do you know how to make a prog that can actively edit and read a text file in VB? That's what I need to know how to do.
Image
User avatar
Locke




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Post by Locke »

You mean like it scans the file for specific words and lines,and you can edit them?Btw did you find vb trial?Where
Image
Feel free to send me an instant message if you need anything.
User avatar
Danke




Wordewatician 500 Mad Hatter

Posts: 2256
Joined: Sun Nov 02, 2003 7:44 pm

Post by Danke »

No I didn't.

But yes, scanning would be great, but editing is pretty important too. I really just want it to find the <filename> in the xml and give me what's inside it.

Basically, here is what I want the program to do, possibly in different inner windows: I want it to start in the extracted map's folder. Then I want it to load all the xml files' names in that directory and it's sub directories. I want it to list them, and then I want to click on indivindual ones and be able to open them in a different inner window. This window will just list the dependencies mentioned in this xml file, starting with the ID stuff (obje, proj, the yyyy thing). You click one and there'll be an edit box with a browse button. You choose a different xml file and the one you selected is replaced by the new one and the ID stuff is set (predetermined by filename: proj.xml would make it jorpejboyyyy). Maybe even have an open button next to it to change that one's dependencies.

Here's a concept: (blue is double click, red is single click)
Image

It's actually not that complicated. Oh, and if it's easier I might just go with one window, the main window, and it changes into the other ones and a little bottom would put it back at the main window.
Image
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post by [CL]9mm-Man »

Wow, cool idea, very usefull... Idk how to do any of that im just here to tell you what I think of it :D.. Its cool..Could be hard to make tho
Your image cannot exceed 400x200 or 50kb
User avatar
Locke




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Post by Locke »

Ill see what I can do.Ill work on it after school
Image
Feel free to send me an instant message if you need anything.
Thebirthdayhat





Posts: 94
Joined: Mon Nov 15, 2004 7:01 pm
Location: over there

Post by Thebirthdayhat »

Nice tut, real easy to follow, but can u tell me the code to make txt 1(the one wit all the text for init text) pop up in a wordpad doc named init. or watever the initial text name is plz.



-hat
Signature exceeded 3 lines of text.
halo-sniper





Posts: 199
Joined: Sat Jun 19, 2004 6:50 pm

Post by halo-sniper »

Yomama Wrote:
txt1.text="sv_name "+""""+txtname+""""
'That says,type sv_name then add a space,and put "" around the name the user typed in.
why is their so much "'s shouldn't their only be one after the "+" before the "txtname"
Image
sparkicks





Posts: 151
Joined: Sat May 15, 2004 8:07 am

Post by sparkicks »

one thing. how do you actually host the game... i dont see ne code there that actually makes the game unless i missed something
Cheech|N|Chong





Posts: 115
Joined: Fri Jan 14, 2005 9:26 am
Location: Why The Fuck Would I Tell You? Indiana...
Contact:

Post by Cheech|N|Chong »

uh...he didnt go that far in the tutorial yet... :roll:
Signature exceeded 75KB.
[Spawn]





Posts: 105
Joined: Wed Mar 23, 2005 12:33 pm
Contact:

hey

Post by [Spawn] »

Hey I moved onto Final Fantasy XI and decided to make a macro maker for people who don't know how to do extended macros, I used this as a base but I made multiple add buttons, I.e. add for head gear neck gear, etc all throughout the inventory but I can't get them to add one by one, can you help me?
Attachments
beta.JPG
beta.JPG (164.57 KiB) Viewed 5257 times
Sig too big!
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

Two year bump and a ridiculously large image. >_<
DirtJumper





Posts: 81
Joined: Fri Oct 19, 2007 6:33 pm

re

Post by DirtJumper »

This is very helpful, I am actually getting somewhere. THanx
Broke my xbox
[Spawn]





Posts: 105
Joined: Wed Mar 23, 2005 12:33 pm
Contact:

Post by [Spawn] »

I never knew you could bump a stickied thread.
Sig too big!
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

That post was clearly necessary.

So tell me, does it, or does it not, bring the topic to the top of the stickied threads? It does. Making a post in a thread that's been dead for two years is a bump, and you're just going out of your way to instigate an issue and argue about trivial semantics.
[Spawn]





Posts: 105
Joined: Wed Mar 23, 2005 12:33 pm
Contact:

Post by [Spawn] »

I'm clearly going out of my way? I responded to your post like you just did to mine, are you going out of your way also?
Sig too big!
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

That was months ago. If you wanted to respond, you could have done it then. The situation is over now, and you are reviving it.
User avatar
kornman00




ONI New Age

Posts: 146
Joined: Fri Dec 12, 2003 6:30 pm
Contact:

Post by kornman00 »

Image

owait, this is VB isn't it? nvm, worst. thread. ever.
Post Reply