Project 'R'

Talk about making games.

Postby DilloDude » Fri Mar 03, 2006 11:40 am

So, how would that go in the script?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby makslane » Fri Mar 03, 2006 11:50 am

getclone("chest.1")->chestOpen
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby DilloDude » Sat Mar 04, 2006 12:24 am

Yay!It works!
Well, now that's sorted out, I can work on the next bit. I was wondering how I can display a map. It will be a while before I have enough space done to have it, but it's probably a good idea to decide how now. So, I press a key, it creates a 'map' actor and pauses the game. All very well. But what's the best way to show an icon with your location? I could, perhaps, have when you are transported into the next area, it sets a variable for icon location, and when the icon is created, change to that location? Something like that, probably, because the way it will be mapped out will not be acurate, so you can't use x=Char.x/20, or anything like that.

Also, I have an idea for my next enemy type. How can I get an actor to wait until you are close enough (easy using destance function) and then start circling round you staying at a certain distance, keep doing that for a while (probably a random timer) and then run toward you, dash back and circle round again? It isn't hard to do circling (path or angle+=1) but with path, it wouldn't start in the right place, and with angle, how would it keep you in the center?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Sat Mar 04, 2006 4:14 am

How can I find what the creator actor's name is? I want when a gold coin is created, if the creator is a GoldCoinChest, to set it's yvelocity to 1. And the same with a silver coin created by a SilverCoinChest.



EDIT: Never mind, I figured it out:
Code: Select all
if(strcmp(creator.name, "GoldCoinChest")==0)
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Mon Mar 06, 2006 1:53 am

For my enemy, here is what I've got so far. Wulv is the name of the enemy, Char is the name of the player:
on create actor-> Wulv
Code: Select all
ChangeAnimationDirection("Event Actor", STOPPED);//The animation is a rotation animation with frames of about 10 degrees, but footsteps alternating, so to get a good animation, the frame has to be changed often.
groundBased=1;//a variable I will use later, when a shockwave travels along the ground, destroying anything 'Ground based'.


on draw actor-> Wulv
Code: Select all
//circle Char if close enough
if(distance(x, y, Char.x, Char.y)<=110)
{
    if(bin==0)//bin is just an actor integer, to be used as a binary (true or false) variable. Each actor uses it dierently.
    {
        CreateTimer("Event Actor", "Rand", 5000);
        dir=2;//a variable used, in this case, to determine animation changing, as in the comment above.
        bin=1;
        ChangeParent("Event Actor", "Char");
        directional_velocity=3;
        angle=direction(x, y, Char.x, Char.y)+90;
    }
}
//stop circling when too far away.
else if (distance(x, y, Char.x, Char.y)>=140)
{
    ChangeParent("Event Actor", "no parent");
    directional_velocity=0;
    DestroyTimer("Rand");
    bin=0;
}

//activate different movement patterns
if(dir==0)
{
    wulvVar+=1;
    if(wulvVar>=10)
    {
        angle+=10;
        dir=1;
    }
}
else if(dir==1)
{
    wulvVar-=1;
    if(wulvVar<=0)
    {
        angle-=10;
        dir=0;
    }
}
else if(dir==2)
{
    angle+=1;
}
else if (dir==3)//for a collision, I will change circle direction.
{
    angle-=1;
}
 


//show direction
animpos = (angle/360.0)*nframes;

on timer->Rand->Wulv
Code: Select all
dir=1;//change movement pattern
angle=direction(x, y, Char.x, Char.y);//change direction

However, I am having problems with this script. I have copied this out of the script editor and added the comments.
Any help would be appreciated.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Tue Mar 07, 2006 2:32 am

Ok, why you're working on that, does anyone know how to do a 'complete collision'? I want it to send an action when the character is copletely colliding with another actor. For example, a character walks into a hole. He doesn't fall down it as soon as he hits it, but when all of him is hitting it.

Also, does anyone know how to stop the view actor from passing a wire frame region antil a certain event?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Fuzzy » Tue Mar 07, 2006 1:04 pm

DilloDude wrote:He doesn't fall down it as soon as he hits it, but when all of him is hitting it.


Two ways.
1. More complicated...
Check to see that the actor is colliding with the hole, and also not colliding with anything else.

2. less complicated...
Actors have their origins at the center fo the animation, so check the distance between the hole and the actor. If its zero, make him fall.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest