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 / Error in Line 5 PLEASE HELP ITS EATING ME AWAY

Author
Message
Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 21:21


K im doing that and it says limb already exists error in line 5
Shadow
21
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 22nd Oct 2002 22:07
Your object 1, robot.x already has a limb number 1. If you want to add another limb, you will have to use a different number.

P.S. Why are you deleting the other object (no. 2, gun.x)without using it for anything?
Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 22:21
the gun is the limb

ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 22:36
try this:



what shadow was saying was that you didn't use the gun object for anything. MAKE MESH FROM OBJECT expects the object number from which you wish to create the mesh, not where the mesh will end up as a limb.

hope this helps.

-= i only do what my rice krispies tell me to do =-
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Oct 2002 22:37
i'm gonna have to ask you to stop these multiple posts, please keep it to one - thanks

i forgot about trueSpace's export bug...
to solve it after "load object "robot.x",1"
type ->
make mesh from object 1,1
delete object 1
make object 1,1,0 `// last number is texture value
delete mesh 1

i forgot about trueSpace makes like 1million limbs, other exporters do too - its a weird bug. but converting to mesh first makes it a single mesh

Anata aru kowagaru no watashi!
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 22:39
the other thing (that shadow was talking about) is that the robot model may already have limbs in it. did you create the model?

try using a limb number that is not already in the model.

you can use these commands to help you determine the limb count:
PERFORM CHECKLIST FOR OBJECT LIMBS
CHECKLIST QUANTITY

-= i only do what my rice krispies tell me to do =-
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 22:40
wow...talk about typing over top of each other...get away from my keyboard, Raven!

-= i only do what my rice krispies tell me to do =-
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Oct 2002 22:42
make me :p

Anata aru kowagaru no watashi!
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 22:47
/me sends 3 armies of ninja monkeys to Raven's house

-= i only do what my rice krispies tell me to do =-
Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 22:50
Thanks guys :S

Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 22:51
You cant edit so I had to make new ones :d

Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 22:53
I cant see the gun just a grey model of RT1337 my robot.
What should i do the gun was supposed to be on his head :S

ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 22:58
does the gun need to be scaled?
does the robot?
is it inside the robot?
did you double check in a seperate project to make sure the gun loads properly on its own?
double check your offsets?
make sure the textures are in the same directory as the model?

-= i only do what my rice krispies tell me to do =-
Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 23:02

is the gun definetly there cause it loads fine as a seperate model Im just wondering if it has loaded in as a limb onto the mesh ?

Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 23:03
woohoo I see it you guys rock.

How would it work for me to do when g is pressed go into site just above gun and then the gun pivots by moving the mouse wihtout the robot and then you press g to come back out?

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Oct 2002 23:04
hahaa... the 180dbu was just an example
obviously alter until you can see it

Anata aru kowagaru no watashi!
Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 23:07
yeh read up thanks btw

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Oct 2002 23:08
well thats easi ...


that should work

Anata aru kowagaru no watashi!
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Oct 2002 23:08
oh i know the g code is a little much, but it makes sure that whilst g is still held it doesn't flick between 1 and 0

Anata aru kowagaru no watashi!
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Oct 2002 23:12
whoops
just noticed something



hehee try that instead

Anata aru kowagaru no watashi!
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 23:18
why can't you just use:


The way you have it, the inner if statement will *always* return true: you only ever reach the statement if inkey$()="g" and you explicitly set the value of bTurret.

there's also the issue of the sight turning. raven's given you code to pivot the gun, not adjust the camera.

if you look in the RGT forums, there are some good code snippets there on sights.

-= i only do what my rice krispies tell me to do =-
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 23:18
get off my keyboard before the ninja monkeys get you, raven!

-= i only do what my rice krispies tell me to do =-
Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 23:18
Nah that dont work what is bturret btw ?have I supposed to replace anything?

Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 23:20
what have I supposed to do with bturret? a function or sumtin ? how do you work that? hehe

Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 23:23


why does it say error program ran into a function declaration ?

(test function btw not real thing)

ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 23:23
Danny, man, we need to get you an intro to programming!

bTurret is an arbitrary variable raven's using to determine whether or not we are in 'scope mode'. this is a common technique, often referred to as setting flags.

flags are placeholders where you can set information for you to use later on. in this case, it's so that we know the g key is pressed, or, at a higher level, that the user wants to use the scope.

now, you can do things like:


make some more sense?

-= i only do what my rice krispies tell me to do =-
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 23:25
if you're going to write functions, you need to do this:



-= i only do what my rice krispies tell me to do =-
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 23:29
here's a big tip for you too. if you make a mistake, you will not break your computer. in the process, you'll also learn.

few of us here had someone to answer ALL of the questions we had. in fact, half of what i enjoy is trying to figure out the language i am working with.

remember always that you are not learning to program games. you are learning to program, and you are learning to write games. two different things.

keep that in mind and you'll go a lot further.

-= i only do what my rice krispies tell me to do =-
Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 22nd Oct 2002 23:30
sorry I see now thankyou I will be back tomorrow I gtg you have been loads of help its been immense thankyooooouuuu

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd Oct 2002 04:11
i did the if the way i did it becuase its was a switch rather than when held.

i used "Turret" as the value because its accessing the turret weapon and i use "b" to signify Boolean (basically a statment thats either yes or no )

if you checkout my RTS camera code in the snippets you'll probably be able to add a camera angle based on the guns angle and update the position ofcourse ... but remember to store the old positions in an array

Anata aru kowagaru no watashi!
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 23rd Oct 2002 07:05
okay...a toggle it is, then. but the code you have won't do anything other than set bTurret to 2 once 'g' is pressed once, and then nothing. it will always be 2.

here's what i think you wanted to do. you need an external variable to store whether or not the 'g' has been pressed already or not, and only do the switch once the key has been let go:



of course, the core of the snippet that you need is this:


btw, using and inkey$()="g" inside the outer if statement is never needed. you wouldn't have made it into the inner statements if it weren't true in the first place.

hope this helps.

cheers

-= i only do what my rice krispies tell me to do =-
Danny Gall
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location:
Posted: 23rd Oct 2002 17:06
ok basically Im not sure what you guys are on about do you have any examples of this being used ?

or atleast both parts of it the function and the part you have already shown me plz thx

ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 23rd Oct 2002 18:21
Danny,

Run the first snippet in my last post, dated 22nd Oct 2002 9:05 pm. This shows a simple toggle for you to determine whether or not your player is in the sniper scope (a bTurret value of 1) or not (a bTurret value of 0).

now that you know when the player wants to use the gun, you'll have to do some setup to move into the scope:
1) store the current camera co-ordinates
2) switch to a different camera positioning loop
3) wait for the toggle to flip and then restore the camera co-ords
4) return to the previous camera position loop

cheers.

-= i only do what my rice krispies tell me to do =-
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd Oct 2002 19:25
lol oki... just noticed i added 2 instead
well ya know same deal really

Anata aru kowagaru no watashi!

Login to post a reply

Server time is: 2024-03-28 11:43:57
Your offset time is: 2024-03-28 11:43:57