Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Screen Text and Coding Practice

Author
Message
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 9th Aug 2013 19:17
Right, iv'e been trying to fix this bug for several days now and have made no headway and ran out of idea's what it could be.

The purpose of this code is to update the person you recruited to say recruited instead of recruit.

The problem I am having is on the first two pages it's fine but the next four pages it just overlaps the 'recruit' and 'recruited' text over one another.

Solutions I tried and didn't work:

Deleting the code for first two pages and next two pages after the middle two.
Cls after they are recruited to make sure there no chance of recruit being showed from before.
Debugged by showing the variable in the top right which changes to the number 1 (1 is for 'recruited' and 0 is for 'recruit' text)
Pasting the sprite again to also make sure the recruit is left behind.

I've tried more but can't remember them.

The Code(I put it all there as it may help):



Thanks in advance and I bet it's a simple fix as always but I can't find it.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 9th Aug 2013 19:32
Have you looked closely at the FONT TEXT commands?

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 9th Aug 2013 19:37
I don't think I use any Font Text commands in this program, I do use font size commands, but they look both the same size to me when there overlapping or have I completely misunderstood?
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 9th Aug 2013 19:47
What are you using to draw text to screen?

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 9th Aug 2013 19:52
I'm using the command text,coordsX,coordsY,"Text" and I got a condition to check if they have been recruited. Here is the code for that part.

` Page 5 Name
If RecruitPage=2
text 182,105,Recuitable5FirstName$ + " " + Recuitable5SecondName$
center text 182,219,"Trustworthy : " + str$(Recuitable5Trustworthy)
center text 182,300,"Loyalty : " + str$(Recuitable5Loyalty)
center text 182,335,"Recruit"
If Recuited5=0 then center text 182,335,"Recruit"
If Recuited5=1 then center text 182,335,"Recruited"


The endif is on page 6 as there are two per a page turn (Like a book)
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 9th Aug 2013 20:01
Give me half an hour, just heading home...

LastChance
14
Years of Service
User Offline
Joined: 11th Sep 2011
Location:
Posted: 9th Aug 2013 20:04
Does "set sprite priority spriteID, priority" help?

If not, try:
1. Paste the sprite
2. Print the text
3. Use: get image imageID, left, top, right, bottom
4. Create another sprite from the image you've just got
5. Paste the new sprite

I think you have some sort of a design flaw too.
Once you load an image, image exist(imageID) will return true until you delete it. You load all required images during the first do..loop cycle. With each next loop after that you are wasting CPU time for statements like this one:
Quote: "
If image exist(1)=0 then load image "Night Watch/Main Menu/NightWatchMenuPatrolsHighlighted.bmp",1
"

I suggest you to encapsulate all media loading in a separate function and call it before do..loop
After the loop create another function which will free the resources if needed.

Hope this helps.
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 9th Aug 2013 20:06
Okay, that will be great!
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 9th Aug 2013 22:11
Quote: "center text 182,335,"Recruit"
If Recuited5=0 then center text 182,335,"Recruit"
If Recuited5=1 then center text 182,335,"Recruited""


well, your writing two things on top of each other.

top line writes recruit no matter what, then if var is 0 it writes same thing again over it or if 1 writes recruited over it

I'm gonna be king of the moon dots!
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 9th Aug 2013 22:27
Thanks so much, I'm such a idiot at times. I've been trying for about 8 hours to fix this and I didn't realize that! I feel like such a fool. Thanks so much Ortu for finding the issue and MrValentine for taking time to have a look at the issue.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Aug 2013 23:40
It is interesting how other people do their work; I would not be able to stand using all those literals but you seem comfortable writing out text content and coordinates in the source code.

I keep forgetting to try out your ship editor, hopefully I will get round to it shortly.

Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 10th Aug 2013 00:56
hey man we've all been there, it's no worries. the little things will always be a programmer's bane.

I'm gonna be king of the moon dots!
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Aug 2013 01:08
Yeap

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 10th Aug 2013 02:21
awesome, got to love this community!

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 10th Aug 2013 03:22 Edited at: 10th Aug 2013 03:32
Yea, this community is amazing and most of the time I guess programmers just over complicate things, well I do also Chris I would love to hear your feedback for it as well You also might want to have a look at the IndieDB(http://www.indiedb.com/games/the-scrolls-of-eithador-the-great-war) page to see some of the newer stuff and got 81 people who follow it now, so it's going well!


Edit:

Also Chris with the text you start to be able to guess the coords quite well the more you do it and the main reason I do it like that is that I don't know another way would love to know other ways as well though
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 10th Aug 2013 05:20
While this is not related to the original problem, more a handy hint.. What you could do is rearrange some of the code blocks to remove the redundant calculations. These are calculations where the result is computed over and over and over again but doesn't change between calls.

For example in this block, the code is calling the image exist(), doing a compare, comparing RecuitmentMenu=1 then anding the results together. This becomes fixed overhead, where it could be selectable.

ie..



may also be expressions as,



This is functionality identical and saves around 11 function calls, 22 compares and 11 ANDS.

The same 'compute once' idea can be further applied inside the new block, so we can block all the Recuitable1Trustworthy=1 and's into a single check. Same goes for the Recuitable1Loyalty=1 and expressions

Here's a separated version of what the code is doing where, so it's a bit easier to see the redundancy.



So broken apart, we get something like this,




we've chomped another 10 equality comparisons as well 10 AND operations.

Now we're left with a series of RecruitPage= comparisons inside the inner most IF blocks. These could be stacked also.




The execution behavior of the code is the same, it's just a little easier to follow and we've ripped some redundant overhead from the executable.

This type of structure really lends itself to a 'typed array' perhaps you could pack the comparisons into an Index, then look up the type from an array.

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 10th Aug 2013 13:34
Thanks Kevin Picone for helping with optimizing it and I have just put it in. I'm not sure how to do the other bit though.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Aug 2013 14:02
Yes like Kevin said. I was thinking the same kind of thing as Kevin but was too tired to bother explain it as well as Kevin did.

As for the text coordinates, for a game that requires so much of it; why not make use of a GUI system? Most MMORPGs have loads of stories and descriptions.

It just seems you are giving yourself more work than it is worth. There is no need to work out the text coordinates on your own, and you should not use literal coordinates so that people with different monitors can play your game in the their desired resolution.

It is also unnecessary to re-compile the game to change text. If the text was documented outside or written in a database which the game could link up with, you would simply need to restart the game to make such changes.

It seems however that you are so far into it that it would be a mission to arrange such a thing. I had better play a bit of the game to get a better feel of it before I make any more comments.

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 10th Aug 2013 21:36 Edited at: 10th Aug 2013 22:12
If you can't find what's causing a problem in under five minutes... you've done something stupid.

I've chucked your code into EMACS because I need practice with it anyway. I'll post what I come out with when I'm done as it may still be useful to you.

[edit]
This must have taken you a heck of a long time to write! You're missing out on a lot of commands and structural tricks that could save you a lot of time and produce neater, more efficient code.

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 10th Aug 2013 22:48
Thanks that would help a lot Also Chris I didn't GUI worked like that I thought I was going to have to write the coords on each resolution out.
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 10th Aug 2013 23:32
Also btw Chris I have done another update video for my game if your interested

http://www.youtube.com/watch?v=sIQTyzpxzIo
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 10th Aug 2013 23:58 Edited at: 11th Aug 2013 00:10
Here's what I have done so far:

The indenting might be a bit funny because this forum makes tabs HUGE and I had EMACS in general text editing mode (which tabs differently to code).

Here's the original section of code before editing


I don't want to change your variable names since it might mess things up elsewhere but I would recommend using shorter names that are quicker to read and distinguish between. i.e. when most of the variables have the prefix 'NightWatch' it adds a lot to reading time. If you want to retain the prefix then consider shortening it to 'NW'. If you think using abbreviations would get confusing you can always specify useful abbreviations, like 'NW', in the comments at the top of the program. However, if some of your variable names include words that are rarely used throughout the program, or don't have common/obvious contractions, then I'd suggest keeping those ones as their full names, or changing the name to something more commonly used or shorter.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Aug 2013 23:59 Edited at: 11th Aug 2013 00:11
Quote: " I thought I was going to have to write the coords on each resolution out. "


Don't worry, you got the gift of will; that is all you need really. I will do my best to help you speed up your work later, first I will need to get more familiar with the project.

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 11th Aug 2013 00:09
ah okay thanks so much, ahahaha. I thought this project would take me 5yrs to do, so a way of speeding it up and having the same results sound amazing!
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 11th Aug 2013 00:43 Edited at: 11th Aug 2013 00:46
Well this is going to be a long discussion; should we start here or in the SoE WIP?

There are a number of things I'd like to know before going any further.

Did you get what Kevin was talking about before?

Do you like writing game text in the source code? How has spell checking been? Some people like writing in the source code; I do not; but it is possible with a certain hard coded text reference system.

Do you ever imagine your game needing multi-language support?

Will characters often say similar things? Do you want players to be able to click on text mid-sentance?

Do you use variables in sentences? For example:

Quote: ""NPC Says: I am unable to grant you with your request, you have failed to obtain [Variable Quantity] gem stones from Mount Scathern; you need to collect [Variable Quantity] more before we can proceed""


Do you want to have to re-distribute the .EXE file each time you add new changes to the user interface and character speech?

Do you see yourself wanting a bit of animated text in certain places in the game?

Do you want to create your own fonts in the future?

All of these questions are related to how you decide to handle game text; some of these things are not possible along the route you are currently taking. In about a year or so your programming experience is going to expand and you will regret working with the constraints you have carved in stone. It is good to think scalable and flexible; tomorrow better ideas come, so today you need to make room for them.


Don't rush with the answers; post them up in the WIP or here, when ever. This is all to save as much time as possible, I'd hate to recommend a GUI system that sends you in the wrong direction; the whole point is to make life easier.

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Aug 2013 08:02 Edited at: 11th Aug 2013 08:02
This is how far I got with your code


You really should learn some better coding practices because you have some neat ideas and you are obviously dedicated, but your coding is holding you back. Hope this helps you.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 11th Aug 2013 13:36
I like that ObTrip function

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Aug 2013 16:14
Thanks, I'm quite proud of it.
Please use it.


The arse-tit formally known as OBese87.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Aug 2013 18:48 Edited at: 11th Aug 2013 19:28
bump for new code edit:

[edit: I realised I hadn't finished the recruit bias text so put that in.]


There are still some things that can be tided up but I think I'll leave it there. Let me know if there are any problems or you want me to explain any of the changes I've made.


The arse-tit formally known as OBese87.
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 12th Aug 2013 00:45
Hi Libervurto, thanks for all the code cut down, looks so much shorter and tidier but I don't understand quite a bit of it. I will have a closer look as I'm a bit busy this week with a fencing course which is pretty much all day.

If you don't mind checking back about mid week next week and explains the bits I don't fully understand it would be greatly appreciated!

P.S I also had a error when I tried to use it saying 'Both operands are required for non-uniary operations at line 145.' which I don't have a clue how to fix

------------------------------------------------------------------------------------------------------------------------------------------

Hi Chris, I think I know the answers you asked me a day or so back.

Did you get what Kevin was talking about before?
Not overlay but I would love to understand.

Do you like writing game text in the source code?
I don't mind it and I can get the concordant's correct first time

How has spell checking been?
The spell checking have been done by it being written in Microsoft office first and then copy and pasted over.

Do you ever imagine your game needing multi-language support?
Hopefully down the line

Will characters often say similar things?
I want them to quite a diverse set of things to say but some will be the same.

Do you want players to be able to click on text mid-sentance?

Do you use variables in sentences?
Yes I will need this as it a key feature by them saying your name and having them treat you differently depending on your reputation.

Do you want to have to re-distribute the .EXE file each time you add new changes to the user interface and character speech?
No I wouldn't want a new .EXE all the time as it will take longer to upload and download.

Do you see yourself wanting a bit of animated text in certain places in the game?
I don't really see I want any animated text.

Do you want to create your own fonts in the future?
I have created my own fonts for the game already to have the different languages harder to read unless your character knows the language.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Aug 2013 01:24
Quote: " P.S I also had a error when I tried to use it saying 'Both operands are required for non-uniary operations at line 145.' which I don't have a clue how to fix "

It seems to be complaining about this line:
Quote: "menuControl = (keystate(17) || keystate(200)) - (keystate(31) || keystate(208))"

I don't know why that's a problem for it because I'm pretty sure '||' is bitwise OR in DBPro -- I really should install DBP here so I can test these things! You could always change that line for this:
Quote: "menuControl = keystate(17) + keystate(200) - keystate(31) - keystate(208)"

is does basically the same thing except you could hold <w> and <up> to scroll two at a time, which could send the menu variable out of bounds if there isn't proper bounds checking for it.


The arse-tit formally known as OBese87.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 12th Aug 2013 01:58 Edited at: 12th Aug 2013 02:06
Ok, I'll consider your goals for a day or so before I propose any GUI system.

Meanwhile it would be good to know of any GUI you have seen that you would like to use for inspiration. I know you have already designed a nice interface theme, but it would be good to know of any video game that springs to your mind personally when you imagine SoE as a finished product.

About the fonts you created, are they system fonts or bitmap fonts? TTF files or images? Do you know what I mean by bitmap fonts? Here's an example:



Since you already document your text in Office initially, you may as well use it as a data entry and GUI development tool; after-all, you understand how to use it don't you? Other than MS Word, what other office software application are you familiar with?

Is SoE online yet? Do you have a server in place? Or is it offline at the moment? How will people connect to the world? How will they save their progress? MySQL,Microsoft SQL, ASP, PHP, XML or your own thing with Dark NET? What ever type of database the game gets its player data from, should really be available whilst you develop the game so you can test things.

Don't worry about answer these networking questions if you do not understand or do not wish to disclose, this is all just a curiosity. It does not matter how you provide the online service, MS Office will be able feed data into what ever data server or file I can imagine you choosing.

[edit]Oh and the most important question. What is next? What are the next 2 or 3 important sections of the game you need to produce a GUI for? These can use the new GUI system.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Aug 2013 14:46
The following code compiles and runs fine for me:





Powered by Free Banners
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 16th Aug 2013 18:35
Hi, sorry for the slow reply, been very busy this week but it's over now, so more programming!


I'm having a error with this line at the moment, any fix would be great!



I would also love for someone to go through this with me just so I can fully understand it.

Thanks!!!
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 17th Aug 2013 20:46 Edited at: 18th Aug 2013 04:08
Quote: "select = obtrip(keystate(28),select)"

Oops! I tried to use a keyword as a variable name.
Just change that to "sel": sel = obtrip(keystate(28),sel)

You don't need to understand how the function works to use it, but if you want to here is the thread about it — and the silkey function which I now prefer: http://forum.thegamecreators.com/?m=forum_view&t=207193&b=1&p=0



The gluteus-maximus mammary-gland formally known as OBese87.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 17th Aug 2013 21:09
Change the select variable as well. sel = obtrip(keystate(28),[[[select]]])

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Aug 2013 04:09
Quote: "Change the select variable as well. sel = obtrip(keystate(28),[[[select]]])"

I don't know what you're talking about... *whistles innocently*



The gluteus-maximus mammary-gland formally known as OBese87.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 18th Aug 2013 13:11 Edited at: 18th Aug 2013 13:11
hehe

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Aug 2013 17:32
Hi, I'm having a issue with the code you wrote for me Libervurto I have tried to fix it but I don't understand most of it. Here's what I got at the moment



The Issues I'm having is when the recruitment text is highlighted on the main menu there's no image but you can still advance to the recruitment screen but then it crashes with this 'Runtime Error 302 - Sprite does not exist at line 221' but it looks like it loading from the code. This is the part of the code which have the runtime error 'paste sprite 11,400,130'

Thanks again!
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Aug 2013 19:03 Edited at: 18th Aug 2013 20:22
Sorry about the bugs, I still haven't been able to test the code since I'm on GNU/Linux and haven't yet been able to get DBP working through Wine.

Look at it as debugging practice.

I'll have a look through and see if I spot anything else.

Quote: "Runtime Error 302 - Sprite does not exist at line 221"

If you follow the order of the code you'll see that the input that selects the submenu comes after the section that first draws the sprite, so the sprite does not exist at line 221. This is why the structure of your program is very important. I have restructured the loop and will post shortly.

When you get an error like this, comment out the lines you think are causing the issue, then you can see what works and figure out what the issue really is. Another good tip for debugging is to display all hidden variables.



The gluteus-maximus mammary-gland formally known as OBese87.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Aug 2013 23:47 Edited at: 19th Aug 2013 00:56
Updated code:

Hopefully this has fixed some of the bugs and is now in a better structure.

[edit]
Just for fun, I took screenshots of your original code and the updated code scaled down to font size 2.
Here's what the original code looked like:


and the improved version:




The gluteus-maximus mammary-gland formally known as OBese87.
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 19th Aug 2013 19:33
Hi, sorry to be pain but there is still a error and I can't figure it out




Also yea you have shorten it considerably! Thank you
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Aug 2013 20:14
What error?



Powered by Free Banners
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 20th Aug 2013 00:07
Sorry I somehow copied the wrong bit of code

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Aug 2013 02:17
While the intention of that snippet is clear, it isn't valid DBPro code for at least two reasons: (i) case needs a literal value such as 1, 2 or "name", i.e. expressions or variable names are not allowed; (ii) the > operator needs two arguments as in diff>2, etc. You should read the error messages and check the Help files - although, to be fair, the help file entry for select seems to be misleading as expressions are allowed.



Powered by Free Banners
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 20th Aug 2013 03:08 Edited at: 20th Aug 2013 03:09
Additionally, you did not need all of that code in the first place. You are doing what I used to do as a newbie; making excessive redundant calculations. Don't worry, it happens to many of us; but you will soon find yourself shorting your workload by simplifying.

Consider that following example would pretty much do the same thing as all of that code; except that the bias variable would need to use 0 as neutral.

Even the bias variable is not necessary, but sometimes a local variable copy of a UDT field is good for processing efficiency (they get read and written more quickly by the CPU)

Bias = recruit(selectedRecruit).Lawfulness

Do you get it? You did not need the select statement or the loyalty field.

Why do you need to store loyalty and lawfulness in two separate variables if they measure the same thing? At least that is what it seems.

Its like heat in the following illustration:

If Hotness - Coldness > 50 Then Print "Hot"

If Temperature > 50 Then Print "Hot"

The latter example suffices. Better to use nouns that measure both ends of the scale, than half.

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 20th Aug 2013 05:42
@Christ Ate
Now that you mention it I am also confused by the lawfulness/loyalty. Both can independently be 0 to 10, but I agree that surely they are two ends of the same scale so can be simplified as a single variable.
Is there some other use of these variables that we don't know about, flamerator? I.E. would Loyalty=10;Lawfulness=10 be treated any differently to Loyalty=4;Lawfulness=4?

@GG
I only have dbc to test at the moment, but the following works as intended.

Does this work in dbp? Or is there another problem, like using types in select or something?



The gluteus-maximus mammary-gland formally known as OBese87.
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 20th Aug 2013 11:17
If I'm honest at the moment I don't really know but it does seem like they are both two ends of the same scale.



Also it doesn't work in DBPro

It says 'Both operands are required for non-uniary operations at line 3.' which is something to do with this 'case >1 : bias = 0 : endcase'
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Aug 2013 14:20 Edited at: 20th Aug 2013 14:26
I've already told you what's wrong with that.

Edit To elaborate a bit, you need to use case as in the following examples:





As I said before, in DBPro you can't use expressions or variables in the case statement, only literals.



Powered by Free Banners
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 20th Aug 2013 14:56 Edited at: 20th Aug 2013 15:11
Following on.. Try to think of Case 1 or Case "Cheese" as gosub labels; you would not use the command [Gosub 2 > n] in the same way you cannot do with a case block.

These [case] parameters must be literal, so they are resolved at compile time.

Case blocks are not related or the same as goto/gosub labels, but a similarity they have is that their parameters cannot be variables or an expression; unlike IF blocks.

As for:


What did you want it to do?

You could use:


But again, you need to tell use what bias is for; because for example; if it was purposed for some kind of AI decision making; you could simply use maths; for example:



If you compare each significant requirement as a unit of measurement, add together the measurements that are important for a given request; if there is enough of that measurement, proceed.

Simple, but all complex game mechanics start from somewhere.

These are positive scale character attributes; zero means bad, anything greater than zero is better; the higher the better. A buff adds, a de-buff subtracts and an affect multiplies.

You've just got to take one step at a time, and post up on here what you are doing on a regular basis so experienced ones can see what you are doing and give you a little more experience, RAISING your experience level so you can one day take on the level 60 overlord in the dungeon; actually building an MMO.

Don't forget to re-read what Kevin wrote, word for word. Remind yourself to do it so that you can avoid the mistakes.

Login to post a reply

Server time is: 2026-07-07 03:46:32
Your offset time is: 2026-07-07 03:46:32