Page 1 of 1

2 questions...

PostPosted: Mon Jul 28, 2008 11:46 pm
by petre
just tried this editor out today, and i have a couple quick questions that i didnt see answered in the help docs...

1. What is the proper syntax for something like this:

If A and B then X else if A or B then Y else Z

2. If I have an actor moving on a path, is there any way to change the speed it is moving along the path?

thanks in advance.

Re: 2 questions...

PostPosted: Tue Jul 29, 2008 12:03 am
by feral
petre wrote:If A and B then X else if A or B then Y else Z

if (A && B)
{
//code for X
}
else if (A||B)
{
//code for Y
}
else
{
//code for Z
}

petre wrote:2. If I have an actor moving on a path, is there any way to change the speed it is moving along the path?


sadly, no.. the speed cannot be changed in game, and can only be set on the paths creation.

there are other ways to do paths tho, (not using paths), some are complex, depends on your needs. what sort of shaped path are you working on ?

Re: 2 questions...

PostPosted: Tue Jul 29, 2008 12:33 am
by petre
feral wrote:there are other ways to do paths tho, (not using paths), some are complex, depends on your needs. what sort of shaped path are you working on ?


just simple single curve paths, almost like throwing a ball in the air, i want it faster when the path is more straight, and slow down near the center of the curve, then speed up again afterwards.

Re: 2 questions...

PostPosted: Tue Jul 29, 2008 4:12 am
by feral
sounds like you simply want the basic "gravity style" curve ?

like the attached example ??

ballpath.zip
(5.68 KiB) Downloaded 104 times

press space to go

Re: 2 questions...

PostPosted: Wed Jul 30, 2008 2:02 am
by petre
yeah, that works. thanks.

i got one more question though. if i have an interger variable, how would i convert the number to a string i can display?

Re: 2 questions...

PostPosted: Wed Jul 30, 2008 3:22 am
by feral
petre wrote:i got one more question though. if i have an interger variable, how would i convert the number to a string i can display?


the easiest way is to create a text actor then assign the integer to the textNumber variable

eg:
textActor.textNumber=int_variable

Re: 2 questions...

PostPosted: Tue Aug 05, 2008 10:06 pm
by petre
more questions!

i want a bullet actor to move directly towards a player actor, not following the player around, just flying on a straight path towards the player initially. i tried using moveto, and it works except the bullet stops when it gets to the spot where the player was when it was fired. i want it to keep going till it goes offscreen. how would i do that? is there a way to just calculate an angle of direction from point a to point b?

and another...is there any way to rotate actors (the animations)?

and now im having a problem...when i make a change to something and then go into game mode, the change that i made isnt there. ive even saved, exited and restarted GE, and it will still have the pre-change game when i go into game mode. why is this?

Re: 2 questions...

PostPosted: Tue Aug 05, 2008 11:08 pm
by speckford123
petre wrote:more questions!

i want a bullet actor to move directly towards a player actor, not following the player around, just flying on a straight path towards the player initially. i tried using moveto, and it works except the bullet stops when it gets to the spot where the player was when it was fired. i want it to keep going till it goes offscreen. how would i do that? is there a way to just calculate an angle of direction from point a to point b?


you can use directional velocity
in create actor of the bullet put in

angle=direction(x, y, player.x, player.y);directional_velocity=3; //put in your target where player is and your own speed

Re: 2 questions...

PostPosted: Tue Aug 05, 2008 11:11 pm
by speckford123
petre wrote:and another...is there any way to rotate actors (the animations)?

no, theres no way to rotate the animations.......yet....
only manually in a paint program and having pictures of every rotation angle

Re: 2 questions...

PostPosted: Tue Aug 05, 2008 11:55 pm
by feral
petre wrote:and another...is there any way to rotate actors (the animations)?

try my sprite rotation programe to create prerotated sprites.. it's not finished yet, but works ok... so you may need to read through the posts to find out its current limitations.

see viewtopic.php?f=4&t=5869