Jump to content

Photo

sign post script add-on request


  • Please log in to reply
24 replies to this topic

#1 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 27 February 2008 - 06:32 PM

For the sign post script, I would just like it so in the arguments you an choose which direction you have to face to speak to the person. For example, if a person is facing left, you can only speak to them from the left.

In the D1 box:

0=north
1=east
2=south
3=west
4=every direction

Thanks!

#2 Joe123

Joe123

    Retired

  • Members

Posted 27 February 2008 - 07:00 PM

You want this on the signpost script and not the NPC script?

Why?

#3 CastChaos

CastChaos

    Deified

  • Members

Posted 27 February 2008 - 07:07 PM

QUOTE(Joe123 @ Feb 28 2008, 01:00 AM) View Post

You want this on the signpost script and not the NPC script?

Why?

I bet it's because it's stupid to read a sign from side or from back... but it would be great for NPCs, too...

#4 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 27 February 2008 - 07:23 PM

QUOTE(Joe123 @ Feb 27 2008, 06:00 PM) View Post

You want this on the signpost script and not the NPC script?

Why?


I want this script because... Because... Well, I was going to say because I already have NPCs set up as eyeballs, but now that I think about it, I will use the NPC script. Could you post it here? I don't know where to find it.

#5 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 27 February 2008 - 11:50 PM

QUOTE(ZebraStallion @ Feb 27 2008, 04:23 PM) View Post

I want this script because... Because... Well, I was going to say because I already have NPCs set up as eyeballs, but now that I think about it, I will use the NPC script. Could you post it here? I don't know where to find it.

You can find many scripts at AGN's script showcase forum: http://www.armageddo...play.php?f=1159

Here is the script itself:

CODE
ffc script real_npc {
    void run(int m, int s, int f, int d, int def_dir) {
        int d_x;
        int d_y;
        int a_x;
        int a_y;
        int orig_d = this->Data;
        
        if(d == 0) d = 48;
        
        
        while(true) {
            d_x = this->X - Link->X;
            d_y = this->Y - Link->Y;
            a_x = Abs(d_x);
            a_y = Abs(d_y);
            
            if(f != 0) {
                if(a_x < d && a_y < d) {
                    if(a_x <= a_y) {
                        if(d_y >= 0) {
                            this->Data = orig_d + DIR_UP;
                        } else {
                            this->Data = orig_d + DIR_DOWN;
                        }
                    } else {
                        if(d_x >= 0) {
                            this->Data = orig_d + DIR_LEFT;
                        } else {
                            this->Data = orig_d + DIR_RIGHT;
                        }
                    }
                } else {
                    this->Data = orig_d + def_dir;
                }
            }
            
            if(Link->InputA && a_x < 24 && a_y < 24) {
                if(s != 0) Game->PlaySound(s);
                Link->InputA = false;
                Screen->Message(m);
            }
            Waitframe();
        }
    }
}


Instructions:

Takes 5 parameters (!!):

0: The message. Same as the sign post.
1: S sound to play when activated.
2: Whether to have the NPC turn to face Link when he's near. See below for details. (0 is off, anything else is on)
3: If #2 is on, how close Link must be for the NPC to turn, in pixels (+ 16, because that's how wide Link is) (default is 48)
4: If #2 is on, which direction is the "default" direction, when Link is far away (0 - Up, 1 - Down, 2 - Left, 3 - Right)

To have an NPC that faces Link, you must put the combos for each direction in a certain order: Up, Down, Left, Right, AND! You must set the FFC to the UP facing combo. If you do that, you'll be fine.

Tips:

Like the Sign post, you should put a solid combo on the same square as the NPC, so Link can't move through it.
If you use the facing feature, then you must use the FFC as a sprite, you can't have it invisible on top of an NPC combo. If you're just using a plain NPC, then it doesn't matter which you do.
It works best with the "Messages freeze all action" and "Messages disappear" rules.

Edited by russadwan, 27 February 2008 - 11:51 PM.


#6 Joe123

Joe123

    Retired

  • Members

Posted 28 February 2008 - 12:03 PM

CODE
ffc script real_npc{
    void run(int m, int s, int f, int d, int def_dir){
        int d_x;
        int d_y;
        int a_x;
        int a_y;
        int orig_d = this->Data;
        bool play;
        
        if(d == 0) d = 48;
        
        
        while(true){
        play = false;
            d_x = this->X - Link->X;
            d_y = this->Y - Link->Y;
            a_x = Abs(d_x);
            a_y = Abs(d_y);
            
            if(f != 0){
                if(a_x < d && a_y < d){
                    if(a_x <= a_y){
                        if(d_y >= 0) this->Data = orig_d + DIR_UP;
                        else this->Data = orig_d + DIR_DOWN;
                    }else{
                        if(d_x >= 0) this->Data = orig_d + DIR_LEFT;
                        else this->Data = orig_d + DIR_RIGHT;
                    }
                }else{
                    this->Data = orig_d + def_dir;
                }
            }
            
            if(Link->InputA && a_x < 24 && a_y < 24){
                    if(d_y >= 0 && Link->Dir == 1) play = true;
                    else if(d_y <= 0 && Link->Dir == 0) play = true;
                    else if(d_x >= 0 && Link->Dir == 3) play = true;
                    else if(d_x <= 0 && Link->Dir == 2) play = true;
            }
            if(play){
                if(s != 0) Game->PlaySound(s);
                Link->InputA = false;
                Screen->Message(m);
            }
        Waitframe();
        }
    }
}


Give that one a try.

#7 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 28 February 2008 - 06:54 PM

What's the difference?

#8 Joe123

Joe123

    Retired

  • Members

Posted 28 February 2008 - 06:55 PM

I did what you asked for in the first post...

If Link is to the left of the person, he has to look right to talk to them, etc.

Should work like that anyway.

#9 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 28 February 2008 - 06:57 PM

Okay, thanks!

edit: where can I find the Minish Cap Hylian voices? They aren't at the helpthewretched site.

Edited by ZebraStallion, 28 February 2008 - 07:13 PM.


#10 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 28 February 2008 - 07:55 PM

QUOTE(ZebraStallion @ Feb 28 2008, 03:57 PM) View Post

Okay, thanks!

edit: where can I find the Minish Cap Hylian voices? They aren't at the helpthewretched site.

If they aren't there, you probably won't find them anywhere.

#11 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 28 February 2008 - 09:21 PM

Joe123 used them in the "new quest intro video" on youtube. icon_confused.gif

#12 Joe123

Joe123

    Retired

  • Members

Posted 29 February 2008 - 02:39 AM

They are on that site, that's where I found them.

#13 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 29 February 2008 - 07:08 PM

Yeah, I thought I saw them there before too. But now they aren't there...

#14 Joe123

Joe123

    Retired

  • Members

Posted 29 February 2008 - 07:16 PM

Interesting.
I probably still have them around somewhere.

Does the script work by the way?

#15 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 29 February 2008 - 07:17 PM

Oh, yeah, it does. icon_biggrin.gif Could you post the sounds here?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users