dthnote801
-
Posts
225 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Calendar
Posts posted by dthnote801
-
-
@aqleus:
> what shop open ?
A: Please use better grammar.
B: Their probably talking about Robin's programming shop. -
^this and install the library files.
-
-
@Anŧhøñy:
> If you're referring to microsoft's, it's a good compiler on windows, it just enforces bad standards and stuff (like allowing you to not return 0 at the end of a program). I usually develop my code under gcc (or mingw with DevC++, on windows), then compile it for release under microsoft's (since their compiler-generated code is faster on windows than devc++'s). Though you don't have to deal with things like stdint, etc, atm, so you should be fine with the current compiler for learning. Just be sure to keep the standards in mind, since MVC++ won't enforce them.
I meant I'm using DevC++ I get sidetracked when posting messages so I tend to leave out information…
@Anŧhøñy:
> Here is an interesting site that provides some random number generators (looks like it's using C): http://www.geekpedia.com/tutorial39_Random-Number-Generation.html
> You may find some interesting functions in there that can help you with capping a max number for rand().
I'll check it out, I could use any information I can get at this point. (I'm only about half a day into learning this.)
@Anŧhøñy:
> Also, the rand() that is getting printed to your screen, is a different number than the rand() that it's checking input against. This is because every time you call rand(), it [usually] returns a different number. As another member said, you may want to put it in a variable, to use it twice, like so:
> ```
> int randomNumber;
> do
> {
> randomNumber = rand();
> printf("%d\n", randomNumber);
> }while(randomNumber < input);
>
> ```
I was wondering whether or not it'd be correct to do that, in the first place that's how I set it but I really wasn't sure.
@Anŧhøñy:
> This will ensure you're testing the same number in the printf.
> You can also verify that scanf is reading your input correctly, you could print that out in the do loop (or before it), by doing something like:
> printf("Entered: %d – Random: %d", input, randomnumber);
> That's up to you; this is just something you can use if you're worried that someone might put invalid data into scanf().
I'm not too worried about it at this time because this code was to help me retain the information about it better instead of just reading about it, and then moving on. -
@Anŧhøñy:
> Some quick things.
>
> I've noticed that there is no "return 0;" at the end of your main function. If you haven't learned about C-functions yet, that's an acceptable mistake, but I'd recommend ending all of your programs (within main()) with a "return 0;". This also tells me you're probably using Microsoft's compiler, which doesn't have the C99 standard with it, so you're better off looking into something like [DevC++](http://www.bloodshed.net/devcpp.html) if you're considering cross-platform code.
This is what I'm using at the moment, I'm not sure if I'm going to switch, it seems like a good enough compiler.
@Anŧhøñy:
> With scanf, for something like this it should be fine (unless you want to read in the input into a character buffer, then parse/intemperate it, etc). Currently (atleast on GCC) if you enter a string instead of a number, it will probably just set the value of 'input' to zero, or a negative number (though I think something like cin/cout would crash it though, since those are streams; but that's C++). If you want to have some error checking, you can do something like:
> ```
> int result = scanf("%d", &input);
> if (result != 1)
> {
> puts("Invalid input");
> return -1;
> }
>
> ```
> This is because scanf returns a value, based on it's success. If it successfully reads one thing in (which is what you're trying to do), it will return '1'. If it returns 0, that usually means scanf fails. Should stop people from inputting a string.
>
> As for your do-while loop, rand() usually returns a very big number (much bigger than what most users will input). Almost every time, you'll end up only doing the loop once (unless you enter for input something really big).
>
> PS: I don't actually use scanf much anymore, as I mainly just handle input through buffers, etc, so if I'm missing something, please let me know.
For the do-while loop, I'll probably add a % 8 or 9, not sure…
I also noticed that it exits the program irregardless to the input number being larger than the random number..
Edit: as for the error-checking I might add it, or not, I'm not sure at this point. -
@NnsNightshade:
> Shilotta Jackson says
> Someone asked me your comments on this program (they are learning C) http://www.touchofdeathforums.com/smf/index.php/topic,70420.msg757696.html#new
> Michael S says
> Wellt he only possible issues i see are the possible issues with scanf that that other guy pointed out and the fact that thier using rand() twice so what they rint out wont bee the same as what they just tested against int he loop
> Teh should set it to a variable and test adn print that instead.
> Shilotta Jackson says
> Okay thankx
I see, I'll try what he suggested thanks, and also try to fix the scanf. -
@Soul:
> If you learn it wrong, you do it wrong.
Then I'm doing it wrong, are there any tutorials that you'd recommend then, or even just a good place to learn in general? -
@Soul:
> No. Don't use scanf. Try entering a string instead of a number and watch your program destroy itself.
I'd use something else, but I literally just started to learn C, and the tutorial I'm learning from only shows the scanf function. -
Basically what this does is take your input, and loops until the random number is larger than your guess. Its very buggy, and the first program I coded in C.
Any suggestions?
```
#includeint main(void){
int input;
srand(time(NULL));
printf("Enter your number\n");
scanf("%d", &input);
do
{
printf("%d\n", rand());
}
while(rand() < input);
getchar();
}
``` -
I'm using Sony Vegas 9 as well, its a pretty legit and decent software.
-
New player with most levels in fishing.
IGN: Varethien
No specific world.
attack 1
defense 1
strength 1
range 1
prayer 1
magic 1
runecrafting 1
construction 1
dungeoneering 1
hp 10
agility 1
herbology 1
thievery 1
crafting 1
fletching 1
whatever two skills below fletching 1
mining 4
smithing 1
fishing 40
cooking 12
firemaking 1
woodcutting 1
farming 1
summoning? 1
combat level 3 -
@Helladen:
> Name needs to be a string.
> ```
> Public Sub DrawPlayerName(ByVal Index As Long)
> Dim TextX As Long
> Dim TextY As Long
> Dim color As Long
> Dim Name As String
>
> 'Title System
> Dim TitleX As Long
> Dim TitleY As Long
> Dim title As String
>
> ' If debug mode, handle error then exit out
> If Options.Debug = 1 Then On Error GoTo errorhandler
>
> ' Check access level
> If GetPlayerPK(Index) = NO Then
>
> Select Case GetPlayerAccess(Index)
> Case 0
> color = RGB(255, 96, 0)
> Case 1
> color = QBColor(DarkGrey)
> Case 2
> color = QBColor(Cyan)
> Case 3
> color = QBColor(BrightGreen)
> Case 4
> color = QBColor(Yellow)
> End Select
>
> Else
> color = QBColor(BrightRed)
> End If
>
> Name = Trim$(Player(Index).Name)
>
> 'Title System
> title = Trim$(Player(Index).CurTitle)
>
> ' calc pos
> TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))
> If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
> TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16
> Else
> ' Determine location for text
> TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16
> End If
>
> 'Title System
> TitleX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(title)))
> If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
> TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 4
> Else
> ' Determine location for text
> TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4
> End If
>
> ' Draw name
> Call DrawText(TexthDC, TextX, TextY, Name, color)
>
> 'Title System
> If title = "----" Then Exit Sub
> 'Draw Title
> Call DrawText(TexthDC, TitleX, TitleY, "[" & title & "]", color)
>
> ' Error handler
> Exit Sub
> errorhandler:
> HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext
> Err.Clear
> Exit Sub
> End Sub
> ```
D'oh, I didn't even bother to look at the variables. Thanks Helladen. -
![](http://i55.tinypic.com/1zvyaab.jpg)
When initial start-up of the client, I get this error.
RTE 13 mismatch
It's in this sub.
```
Public Sub DrawPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim color As Long
Dim Name As Long
'Title System
Dim TitleX As Long
Dim TitleY As Long
Dim title As String
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
' Check access level
If GetPlayerPK(Index) = NO Then
Select Case GetPlayerAccess(Index)
Case 0
color = RGB(255, 96, 0)
Case 1
color = QBColor(DarkGrey)
Case 2
color = QBColor(Cyan)
Case 3
color = QBColor(BrightGreen)
Case 4
color = QBColor(Yellow)
End Select
Else
color = QBColor(BrightRed)
End If
Name = Trim$(Player(Index).Name)
'Title System
title = Trim$(Player(Index).CurTitle)
' calc pos
TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))
If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16
Else
' Determine location for text
TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16
End If
'Title System
TitleX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(title)))
If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 4
Else
' Determine location for text
TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4
End If
' Draw name
Call DrawText(TexthDC, TextX, TextY, Name, color)
'Title System
If title = "----" Then Exit Sub
'Draw Title
Call DrawText(TexthDC, TitleX, TitleY, "[" & title & "]", color)
' Error handler
Exit Sub
errorhandler:
HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
``` -
@Craselin:
> Heres the new one with a slightly edited hop
Bloody hell, that looks like a booger monster (No joke.) But it looks good craselin. -
Honestly, update the main post with what the forum is for. There are people who can't be bothered to go to random links on the spot just because they seen it, I'm not one of those people. So update the main post with what the forum is for, and a little bit of information on the game.
-
No offense but those maps are god awful. As others are saying don't mix tilesets, but also try to limit theuse of rmxp tiles. Try to find a mapper that doesn't mix tilesets.
-
Bumping for glory, plus mappers are needed badly.
-
@sunku:
> Can any one get me a resource for mining?
Browse around the resource board, there's a few out there. -
That's what I was planning on doing Marsh, thats what the personal uses were for.
-
@Richy:
> 0 Player, 1 Moderator, 2 Mapper, 3 Developer, 4 Owner, 5 subscript not found error. No Access level 5 in EO :P..
Actually, there is an Access 5 in EO, in both engines (1.5 and 2.0) I was able to give myself Access 5, but it's a long and un-needed process. -
I'm planning on learning the languages described on top, and I'm wondering if anyone here would think it would be worth-while to learn this.
Granted, some of it would be for profit, the rest would be for personal use, what do you think? -
-
If you have VB6, you will be able to change these.
-
@NnsNightshade:
> Um…no he wasn't. o.o Have you even played through the .hack series? >_>
>
> Either way, good luck with the game.
Cubia is the 8th phase, Corbenik. He acts good because he wanted to get rid of the other phases as well.
[EO] Npc guard behaviour problem
in Source
Posted