PH Map (Not a promise!)
#1
Posted 25 February 2008 - 04:48 PM
Now, here's what I expect to do;
First off is to attempt simply making a script that draws a line when the mouse is clicked. Next, I'll try to set up certain things, such as different colors, an eraser and Clear All function, stamps, and then place them all together in a master script that activates when you select the map (or equivalent) and press A. X and Y will switch through the features, while the mouse puts them where they belong.
On a side note though, can the mouse icon be replaced, and can the changes be saved in the DMap data?
#2
Posted 25 February 2008 - 04:59 PM
However, scripts don't run while you open the map I'm afraid.
#3
Posted 25 February 2008 - 10:03 PM
#6
Posted 26 February 2008 - 12:12 AM
Why can't scripts run while the maps are up? Shouldn't they input some sort of toggle option for that per screen?
#7
Posted 26 February 2008 - 02:34 AM
Yea, but... geez, that's unprofessional.
It's a work-around.
In many cases, ZScript can only do things that way.
Why can't scripts run while the maps are up? Shouldn't they input some sort of toggle option for that per screen?
Go ask DD.
I'd put money on 'post- 2.5'
#9
Posted 26 February 2008 - 03:54 PM
import "std.zh"
ffc script crayon{
//my first attempt. yay
void run (){
bool InputA;
int data = 645;
int cset = 8;
int InputMouseX;
int InputMouseY;
while (true){
float X = InputMouseX;
float Y = InputMouseY; //tracks mouse position
}
while (InputA == true && InputMouseX > 0 < 256 && InputMouseY > 0 < 229) {
void PutPixel( //is this function unfinished?
int layer = 5;
InputMouseY->int x;
InputMouseY->int y;
int color = 122;
int rx = 0;
int ry = 0;
int rangle = 0;
int opacity = 128;
)
}
}
}
#10
Posted 26 February 2008 - 04:27 PM
ffc script crayon{
void run(){
int x; int y;
int data = 645;
int cset = 8;
this->Data = data; this->CSet = cset;
while(true){
x = Link->InputMouseX; y = Link->InputMouseY;
this->X = x; this->Y = y;
if(Link->InputA && (x > 0 && x < 256) && (y > 0 && y < 229){
Screen->PutPixel(5,x, y, 122, 0, 0, 0, 128);
}
Waitframe();
}
}
}
Have a go with that.
Some of things you did were rather unusual, and I've corrected them.
If you don't understand anything that I've done I'm willing to explain it, but you seem capable of working it out for yourself.
Mind though, that 'putpixel' won't stay where it is.
It'll disapear when you stop pressing A.
If you declare 'while(true){}', nothing past those brackets will ever exeute.
If you declare a 'while' loop with no 'Waitframe', the system will freeze, as it will keep looping what's within that while and the rest of the system will never run.
Perhaps the easiest way to break ZC is like this:
Have a go using it, hehehe....
Edited by Joe123, 26 February 2008 - 04:30 PM.
#11
Posted 26 February 2008 - 05:00 PM
Also, the FFC for the mouse is off. I'm going to try to fix this...
Edited by Linkus, 26 February 2008 - 05:03 PM.
#12
Posted 26 February 2008 - 05:04 PM
'->' is called a pointer.
Look at the list of commands.
It's arranged into different sections, under various headers.
The sections use the pointers with their header, ie:
'InputA' is within the 'Link' section, so you use it via 'Link->InputA'.
#13
Posted 26 February 2008 - 05:20 PM
ffc script crayon{
void run(){
int x; int y;
int data = 656;
int cset = 7;
this->Data = data; this->CSet = cset;
while(true){
x = Link->InputMouseX - 32; y = Link->InputMouseY - 56; //-32 and -56 somewhat corrects mouse-to-FFC disposition.
this->X = x; this->Y = y;
if(Link->InputA){ //boundaries unnecessary for this section. Although, the FFC disappears when the mouse leaves the screen, since it is undefined. I'll attempt to remedy this by creating separate Screen->X and Screen->Y borders.
Screen->PutPixel(5,x, y, 2, 0, 0, 0, 128);
}
Waitframe();
}
}
}
Fixed the offset a bit. Now to keep the FFC from disappearing, which I'm sure I can fix. However, the PutPixel function still isn't working right, as the pixel is only moves with the FFC instead of staying put and placing another as it follows.
#14
Posted 26 February 2008 - 05:41 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users