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 / Would i need these codes in these places?

Author
Message
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 17th Sep 2003 20:40 Edited at: 17th Sep 2003 20:42
For a little while, i hav'nt got the hang of the character for fighting.
People have told me to make a collision between the two but hold on a min....

The first question is, if i was making a character attack an enemy, would i need up the top a code like :
rem character/emeney attacks
gosub character_emeny_attack

Or would i just put the attacking code underneath both control character and enemy?

Second question is, i have the basic idea on how to take down a character/ememy health down, but how to actually attack.
Like i have a ninja, (in the DarkMATTER) and i want to make sure that when you hit a button like "a" it will attack.
What sort of code would be best? do i need to collide? cant i just have a code that does something like:
attack=0
If keystate(32)=1 then attack=1
Then somewhere in the code have something to do with.
If attack=1 then.......

Or do i have to collide?

Alsocould i possible ask this question, in my game i will have a big area, when you do a certain thing i want to make a cut scene, and then taking to another level, what sort of code would i need, this does sound hard?
What i mean is, if you are controlling a character, right, now say you walk into a house and beat a certain monster, how would you make a cut scene after it, and then a level complete and then a level 2?

Really would like help for this.
Also i have now understanded something new which is the Matrix, i thought this would take me forever to learn.
Really would love someone to reply, also as I'm planning to sell my game later on in life, i really would put your name into my game in the help list.

Thanks
Andrew
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 17th Sep 2003 22:55
The first question is, if i was making a character attack an enemy, would i need up the top a code like :
rem character/emeney attacks
gosub character_emeny_attack

Put that code in the bit of the program where the attack happens - if it was at the top then the char would attack once when it's first run and nowhere else. Usually it would go where marked here:



Quote: "Second question is, i have the basic idea on how to take down a character/ememy health down, but how to actually attack.
Like i have a ninja, (in the DarkMATTER) and i want to make sure that when you hit a button like "a" it will attack.
What sort of code would be best? do i need to collide? cant i just have a code that does something like:
attack=0
If keystate(32)=1 then attack=1
Then somewhere in the code have something to do with.
If attack=1 then.......

Or do i have to collide?"


Looks fine here - the collision bit would go in the "If attack=1 then......." bit. After checking if we're attacking then you check iuf the sword is colliding with the enemy, and if so then deduct health.

Quote: "Alsocould i possible ask this question, in my game i will have a big area, when you do a certain thing i want to make a cut scene, and then taking to another level, what sort of code would i need, this does sound hard?
What i mean is, if you are controlling a character, right, now say you walk into a house and beat a certain monster, how would you make a cut scene after it, and then a level complete and then a level 2?"


Yes - in the main loop check if you have defeated the monster. When you do then call sub subroutine which will put the camera somewhere, move around some models and then go back to the main loop, with the char in a different position.

c:/dos
c:/dos run
run dos run
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 17th Sep 2003 22:55 Edited at: 17th Sep 2003 22:57
Thanks
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 17th Sep 2003 22:56
well depends if you call my post an answer

c:/dos
c:/dos run
run dos run
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 17th Sep 2003 22:59
you may want to see if someone has a game already done, that has similar features that you want to implement in your game, and ask them if you can see the code so you can learn from it.

-RUST-
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 17th Sep 2003 23:00
I do, sorry i just typed that bit out before i knew you answered
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 17th Sep 2003 23:03
There is something that i dont understand.
The bit where you said "Looks fine here - the collision bit would go in the "If attack=1 then......." bit. After checking if we're attacking then you check if the sword is colliding with the enemy, and if so then deduct health"
The ninja already has a sword, so what would i do? would i just have code like this
If object collision(ninja,enemy)
?
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 17th Sep 2003 23:24
Quote: "The ninja already has a sword, so what would i do?"


Panic.

Or use limb collision instead and find out the limb number of the sword.

c:/dos
c:/dos run
run dos run
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 17th Sep 2003 23:27
So where will i find the limb number?
Would i have to look inside the .x file
Plus i dont panic LOL
What if i had more than 1 monster in the same area, like a different monster, how would i make it collide that as well?

Also if i want my game to make the enemies health go down, do you know a sort of like code that i could use or so i can understand

Login to post a reply

Server time is: 2026-07-26 05:03:33
Your offset time is: 2026-07-26 05:03:33