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.

Newcomers DBPro Corner / a ball, a box, and some dots.

Author
Message
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 10th Dec 2005 06:55
I want to make a simple program where a ball moves around with a limb attached to it. The limb will be short and a long rectangular box will be placed in it resembling a weapon of some kind. When the limb hits an enemy (a box) particles will spew out (using fire effect) for blood.
For moving forward i point the boxes towards the charector and move them forward at rates between 1-3. Thats my 1st problem. I dont know how to make random rates. I also need to know how to make it so that the enemies dont spawn to close to your main charector.
Also i want to have archers which are boxes that are brown.

I need a dot(the arrow) to travel up and down from the archer, to my charector. I can make it move towards me but i cant make it in an arch and i cant add or subtrace the values at random. (i dont want to add an arched limb because i always want the dots to hit close or on my charector)

I plan to compact it and put it in the 20 line thing. I know i'm asking for alot and i dont expect to get all of what i asked for

There are only two types of people. The ones that agree with me and the ones that are wrong
Torq
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location:
Posted: 10th Dec 2005 11:43 Edited at: 10th Dec 2005 11:45
Well for the speed part it would be something like this.

Use the rnd command for random values.




Now for preventing the spawning too close when you pick the spawn position of the boxes compare the x,y,z values to the players subtract them such as enemyx -playerx if they are too close then have it respawn or pick a new position. Use the If then statement like I used above to compare and use the object position (object number) command to get your objects postion values.

Now as for making a line in an arch you will need to use your sin and cos commands. I have a small orbiting program I made to teach me how to get things to circle things Ill post that when I get off today. This will help you learn these functions. And how to mess with them to predict an arch.

Hope this helps. Most of this is general info its important to stick with it and figure these things out it will help in the long run.

http://badtempergames.tripod.com

Torq
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location:
Posted: 10th Dec 2005 19:57
Here is the orbit code. This will help you mess with sin and cos functions. After making this program I finally understood how to make these work for me.
Experiment moving around the sin and cos and using different signs.



http://badtempergames.tripod.com

MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 11th Dec 2005 06:41
thanks, except i'm not sure about these commands
Quote: "angle#=angle#+0.4
angle2#=angle2#+0.5
angle3#=angle3#+1

if angle#>359 then angle#=0.0
if angle2#>359 then angle2#=0.0
if angle3#>359 then angle3#=0.0
"

What is does is increase the angle that the object is at by the specified value every time it passes through the loop right? the only problem is that i want the archer to shoot the arrow towards the player which either means i have to make sure the computer gets within a certain distance before he shoots (meaning he would stay the same distance from me unless i lowered his speed). I want the arrow radius to vary based on the distance.
The only way i could think of doing that was to have a number that told the distance and take that number, do some equation to it and use it...

look, a signature!
made you look---------dancing penguins rule... you dont
Torq
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location:
Posted: 11th Dec 2005 07:39 Edited at: 11th Dec 2005 07:42
Your correct in what the code is doing to the angle.
This code is not meant to plug straight in to yours. You have to do some work to it. If you look and think about it there are some ways you could use this code for what you need.
Your radius varies ? No problem a radius/distance is a variable you can change. For an arch dont exceed 180 degrees. This is just to try to help you a long.
If you want an eaiser way you can check the code base and I believe there some code that throws a ball. Same thing your looking for, it will make the arching effect. For distances a real easy way to do that would be to use an invisible sphere for detection like so.

Make object sphere 50,Your_radius
hide object 50
rem this part in main loop
position object 50,object position x(player),object position y(player),object position z(player)

if object hit (player,50)=1

rem launch arrows here
endif

Just use the hidden sphere as a collision dector Your_radius can be what ever you want. Just look at it before you hide it Also be sure to keep updating its position where the player is.

http://badtempergames.tripod.com

MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 25th Dec 2005 00:21
i still dont get it. I dont want it to go in a half circle curve i want it to go straight with a large curve like... in a normal game an artillery shot, scaled down and facing straighter.

santah my god, theyre real! *santa faints*
red m&m:oh my god, hes real!*m&m faints*

Login to post a reply

Server time is: 2024-09-24 11:23:12
Your offset time is: 2024-09-24 11:23:12