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 / Changing Values To Create Object With A Custom Size

Author
Message
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 22nd Mar 2014 18:13
Hey community,

I don't really know if this is a bug, but i want to try enter in my engine some values from a textbox made in BLUE GUI and even on the DB Pro's input to make lets say a box with the entered values. But the thing is that the cube doesn't appear at all or if it appears, it stays at the size of 25 and thats it.
If you can explain to me a bit please!

Thank You!

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Mar 2014 21:39
Quote: "If you can explain to me a bit please!"


How on earth can we help you unless we see some relevant code?



Powered by Free Banners
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 22nd Mar 2014 21:58
Really sorry,

like lets say that i have:


input "sizex",szx
input "sizey",szy
input "sizez",szz

make object box 1,sizex,sizey,sizez

This is the code...

Thank You Again!

Alex Matei CEO
www.alexmatei.com
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Mar 2014 22:50 Edited at: 22nd Mar 2014 22:50
What values are you setting?
Those will be integers by default, thus if you set anything less than 1 they will be truncated to 0.


"Why do programmers get Halloween and Christmas mixed up?"
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 22nd Mar 2014 22:52
Yes i know they are integers i am settings higher then 0 like if i want to make a box with the values 25 by 25 etc... it doesn't appear or it doesn't create with the values that i enter like 25.

Alex Matei CEO
www.alexmatei.com
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Mar 2014 22:56
Oh wait, is that your actual code?
Because you're not using your variable names, but rather the strings you display as the input prompt in that snippet
(In other words, you should use szx, szy and szz in your call to make object box).


"Why do programmers get Halloween and Christmas mixed up?"
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 22nd Mar 2014 22:58
Well i thought that when i finish with an input in that variable assigned to the input will enter the number that i typed and then stored and after that i can assigne it to the cube...

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Mar 2014 12:02
I think you've missed Rudolpho's point. You've written:



Those three variables haven't been given values and will all default to zero.

The variables in your input statements are called szx, szy and szz so your code should say:



The strings "sizex", "sizey", and "sizez" in your input statements are simply helpful text displayed to the user and are not variables.



Powered by Free Banners
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 23rd Mar 2014 12:16
Ok so the values are 0, but how can i type a value, and retain it into a variable and then apply it to the box?


Thank You!

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 23rd Mar 2014 12:26
Here is a code i written...




Alex Matei CEO
www.alexmatei.com
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Mar 2014 12:43
int(varxtext) will just give you the memory address of your edit control. Use val(getGadgetText(varxtext)) to achieve what you want.


"Why do programmers get Halloween and Christmas mixed up?"
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 23rd Mar 2014 12:58
Thank you all for the help! It worked now!


Thank You Again!

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 23rd Mar 2014 18:24
Altough i resolved this i don't know why the box doesn't create with the size assigned to the brush box... Like in this example:



Please tell me if you need more code!
Thank You

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Mar 2014 21:59
Quote: "
`The Brush remains the same, it goes with the camera and then when i want to place a cube with brushe's size it gives me the same size always even if i put 1 to the brush this is the code that creates the box after the brush

`Is something wrong?
make object box objm,object size x(48),object size y(48),object size z(48)"


I don't really understand what you've done. The code you've shown us makes the box object 48 have size 355x355x355. Where's the code that changes it's size?

Specifically, what does this phrase mean:

Quote: "even if i put 1 to the brush"


Do you mean when you use 1 instead of 355 when you create the brush? If not then tell us what you mean. We are not mind readers.

The following code works perfectly for me. Where do you change the brush size?





Powered by Free Banners
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 23rd Mar 2014 22:05
This is what makes the cube from the brush... Its not a defined object...the object increments . objm is a assigned with a number already.




Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2014 00:22
Quote: "This is what makes the cube from the brush"


That's why they all have the same size. What makes you think they would be different?



Powered by Free Banners
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 24th Mar 2014 11:28
Well, look at the brush size and the object created from it

Alex Matei CEO
www.alexmatei.com
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 24th Mar 2014 11:44
Are you trying to make a box from a texture size? It's very confusing what you are writing.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2014 12:51
Quote: "Well, look at the brush size and the object created from it "


That picture tells me nothing. Where is the brush size in your code snippet, reproduced here?



Your new objects will be the same size as object 48. The new objects will only be a different size if you change the size of object 48 - or if you rescale the new object elsewhere in the code. You really do need to explain yourself more clearly - and show us the relevant code.



Powered by Free Banners
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 24th Mar 2014 18:28
Yeah, apparently i missed some code lines...that first time i typed them but didn't had any result...it was the scale object objm and the values assigned to the TextBoxes...


Thank You Community for having so much patience with me!

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Mar 2014 10:33
Have you solved the problem then?



Powered by Free Banners

Login to post a reply

Server time is: 2026-07-06 10:34:32
Your offset time is: 2026-07-06 10:34:32