Jump to content

Photo

Cursor Script


  • Please log in to reply
4 replies to this topic

#1 Linkus

Linkus

    .

  • Members
  • Real Name:Adam

Posted 26 February 2008 - 10:21 PM

The below is a following of an attempt to recreate the PH map, which didn't go too well. After Joe123 took some time to clean up my broken attempt, I took a step further and updated it to have borders where the FFC wouldn't go off-screen and it'd be lost for the remainder of the screen, along with repairing the FFC-to-cursor offset.

Here's the code. You will have to use A and B, since right and left click doesn't register, and it should be ready to import a dynamic array function into it.
CODE

import "std.zh"
// other imports go here.
ffc script cursor{    
    void run(){
    int x; int y;        
    int data = 0; // Cursor icon
    int cset = 0; // Cset of cursor

    this->Data = data; this->CSet = cset;
    while(true){
            this->X = x; this->Y = y;
            x = Link->InputMouseX - 38; y = Link->InputMouseY - 62;
            // borders below keeps FFC on screen. -38(x) and -62(y) above corrects mouse-to-FFC offset.
            if((Link->InputMouseX >= 256)){
                x = 240;
            }
            if((Link->InputMouseX < 32)){
                x = 0;
            }
            if((Link->InputMouseY > 216)){
                y = 152;
            }  
            if((Link->InputMouseY < 56)){
                y = 0;
            }
            // place any "if" or "while" statements here.
             Waitframe();
        }
    }
}

Credit goes to Joe123 and me. Have fun!

#2 Aslion

Aslion

    End Fascism

  • Members
  • Real Name:Ryan
  • Location:Plug One's spectacles

Posted 26 February 2008 - 10:42 PM

So, does this just activate the A and B buttons when used? I could get some great puzzle ideas with this, perhaps.

#3 Linkus

Linkus

    .

  • Members
  • Real Name:Adam

Posted 26 February 2008 - 10:43 PM

No, you will have to script them in. This is only tracking the movement of the mouse over the screen with a FFC.

#4 Aslion

Aslion

    End Fascism

  • Members
  • Real Name:Ryan
  • Location:Plug One's spectacles

Posted 26 February 2008 - 10:47 PM

Huh, this really makes me want to make a shooter of sorts.
Good job on the script, it's pretty fun icon_razz.gif

#5 Joe123

Joe123

    Retired

  • Members

Posted 27 February 2008 - 02:53 AM

QUOTE(Linkus @ Feb 27 2008, 03:21 AM) View Post
and it should be ready to import a dynamic array function into it.


When I said about that part of the script not being particularily plausable without arrays, I said that because we have no array function.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users