Page 1 of 2

how do you shoot people

PostPosted: Sun Jul 13, 2008 7:24 pm
by pdude1
Ok the last question I need to know for now is how to make it so you can shoot people. i need to know how to shoot it left and right. both ways.

Re: how do you shoot people

PostPosted: Sun Jul 13, 2008 11:44 pm
by segwego12
As far as I know, GE has changed the C+ language so make two bullet actors that go left and right. That is how to do it according to 1.3.9

Re: how do you shoot people

PostPosted: Mon Jul 14, 2008 9:09 pm
by Thanx
I dunno how understandable that was for pdude1, but incase there'd be any misunderstandings, or confusion, I'll explain in a bit more details...
Make an actor, which you'll probably want to call bullet. Give it the apropriete action. In its Collision event with the enemy actor, you kill the enemy - in any way you want, there've been posts about that already...
Make the actor, so that it isn't created at startup.
I know you'll have the action for when you use the control for shooting. In the onkey or whatever action: Tell GE to create an actor, bullet, with the bullet animation, plus you'll have to experiment on where the actor should be created compared to the player, to make it seem like it's comming out of the gun...
In the OnCreateActor of the bullet actor, use a script editor, check which animation the player's using.
if(playeractor.animindex == somenumber)
{
xvelocity = 5;
}
else
{
if(playeractor.animindex == anothernumber)
{
xvelocity = -5
}
animindex is a number which tells you which animation an actor is using. the first has 0...
use 5 for right, -5 to go left, change the number to make it faster/slower!
Experiment, and everything will turn out the way you want! :wink:

Re: how do you shoot people

PostPosted: Mon Jul 14, 2008 10:22 pm
by segwego12
That might not work on 1.3.9, it dosent for me. is there a sript for 1.3.9?

Re: how do you shoot people

PostPosted: Mon Jul 14, 2008 11:21 pm
by Thanx
why wouldn't it work? That's plain C code...
What goes wrong? Maybe I can help...

Re: how do you shoot people

PostPosted: Tue Jul 15, 2008 3:37 am
by segwego12
I don't know why but I have to use C+ instead of C. Maybe makslane should learn how to make his own coding language and make his own coding language called Game Editor script.

Re: how do you shoot people

PostPosted: Tue Jul 15, 2008 8:48 am
by DST
segwego12 wrote:I don't know why but I have to use C+ instead of C. Maybe makslane should learn how to make his own coding language and make his own coding language called Game Editor script.


That statement is wrong on so many levels.

Why would makslane want to create a new language? So everyone can learn a new language that will be useful for only one program? In fact, using an established language is one of the best features of GE, compared to the others.

You can't pick your language. Ge uses C. You have to use C when using GE.

You should think a little harder before making your posts.

Re: how do you shoot people

PostPosted: Tue Jul 15, 2008 11:47 am
by segwego12
All an exend to my idea: IdeaMaybe he can make it easier than c like x = x + 5; can change to rightd=5; instead and x = x - 5; can change to leftd=5; I can understand that better. still, People who don't wanta switch ca have the otption to use C (Prefrences).

Re: how do you shoot people

PostPosted: Tue Jul 15, 2008 1:36 pm
by segwego12
makslane just said thank you for your suggestions to me about the new coding language.

Re: how do you shoot people

PostPosted: Tue Jul 15, 2008 2:55 pm
by Thanx
That may be more understandable, but at the same time C is a quite simple language though, and is used in many different places.
Advantages of GE script would be:
Easy to understand by far
If done in such a way, it may be quite powerful (that statement has its doubts)
Disadvantages:
Only used by 1 program, otherwise useless
If you're interested in learning other authoring systems, then it would give the wrong bases to start from

C advantages:
Used on multiple platforms
has many compilers
powerful
constantly being developed (C++, C#)
Relatively simple
C disadvantages:
For some beginners it requires a little more thinking than as much they want to think...

Based on that: what would you vote for? The language with the better learning curve, but probably less powerful and useless?
Or the language with the slightly worse learning curve, but most powerful, and useful?

I think most people would choose C.

Re: how do you shoot people

PostPosted: Tue Jul 15, 2008 3:26 pm
by segwego12
Maybe as I said in my new Coding language topic, I also there should be a c mode where you can switch from ge to c code.

Re: how do you shoot people

PostPosted: Tue Jul 15, 2008 3:27 pm
by segwego12
segwego12 wrote:All an exend to my idea: IdeaMaybe he can make it easier than c like x = x + 5; can change to rightd=5; instead and x = x - 5; can change to leftd=5; I can understand that better. still, People who don't wanta switch ca have the otption to use C (Prefrences).

That is some of the code.

Re: how do you shoot people

PostPosted: Wed Jul 16, 2008 12:14 am
by DST
rightd=5; vs x+=5; and leftd=5; vs. x-=5;which seems better? Anyone?

Re: how do you shoot people

PostPosted: Wed Jul 16, 2008 3:22 am
by segwego12
This is just one of his plans to kick me out of the forums.

Re: how do you shoot people

PostPosted: Wed Jul 16, 2008 8:58 am
by Thanx
easy man, we're not trying to throw you off the forums, DST showed a suggesting question...

I don't like new languages that are useless, I think the C version of x-=5 is simpler, and shorter...