2 questions...

Game Editor comments and discussion.

2 questions...

Postby petre » Mon Jul 28, 2008 11:46 pm

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.
petre
 
Posts: 4
Joined: Mon Jul 28, 2008 8:10 pm
Score: 0 Give a positive score

Re: 2 questions...

Postby feral » Tue Jul 29, 2008 12:03 am

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 ?
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: 2 questions...

Postby petre » Tue Jul 29, 2008 12:33 am

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.
petre
 
Posts: 4
Joined: Mon Jul 28, 2008 8:10 pm
Score: 0 Give a positive score

Re: 2 questions...

Postby feral » Tue Jul 29, 2008 4:12 am

sounds like you simply want the basic "gravity style" curve ?

like the attached example ??

ballpath.zip
(5.68 KiB) Downloaded 105 times

press space to go
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: 2 questions...

Postby petre » Wed Jul 30, 2008 2:02 am

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?
petre
 
Posts: 4
Joined: Mon Jul 28, 2008 8:10 pm
Score: 0 Give a positive score

Re: 2 questions...

Postby feral » Wed Jul 30, 2008 3:22 am

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
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: 2 questions...

Postby petre » Tue Aug 05, 2008 10:06 pm

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?
Last edited by petre on Tue Aug 05, 2008 11:15 pm, edited 1 time in total.
petre
 
Posts: 4
Joined: Mon Jul 28, 2008 8:10 pm
Score: 0 Give a positive score

Re: 2 questions...

Postby speckford123 » Tue Aug 05, 2008 11:08 pm

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
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

Re: 2 questions...

Postby speckford123 » Tue Aug 05, 2008 11:11 pm

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
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

Re: 2 questions...

Postby feral » Tue Aug 05, 2008 11:55 pm

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
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron