PDA

View Full Version : MessageTip no longer working?



paulwilliamwoods
05-12-2020, 11:11 PM
I've been trying to write various scripts and I couldn't for the life of me figure out what I was doing wrong with MessageTip, and NoteBox. So I got a script from the website - the one that draws circles - and it still doesn't work.

I get this error:
98991

Any idea what's happening here?

I'm also having trouble with intarrays. I get told my subscript is the wrong one - 'bad array subscript'. Any idea what I'm doing wrong here? The purpose of the script is to display a grid of different paint strokes, altering one property slightly across and one down, so I can see which settings, roughly, I want for my next stroke by looking at the grid.



//================================================== =========================
//================================================== =========================
// ArtRage Script File.
//================================================== =========================
//================================================== =========================


//================================================== =========================
// Version Block - Script version and ArtRage version:
//================================================== =========================

<Version>
ArtRage Version: ArtRage 6
ArtRage Build: 6.1.2
Professional Edition: Yes
Script Version: 1
</Version>


//================================================== =========================
// Header block - Info about the painting/person who generated this script:
//================================================== =========================

<Header>
// === Project data
Painting Name: "Untitled-2"
Painting Width: PaintingWidth();
Painting Height: PaintingHeight();
Painting DPI: 300
Mask Edge Map Width: PaintingWidth();
Mask Edge Map Height: PaintingHeight();
// === Author data
Author Name: ""
Script Name: "Test1"
Comment: ""
Script Type: ""
Script Feature Flags: 0x000000001
</Header>


//================================================== =========================
// Script data follows:
//================================================== =========================

<Events>
Wait: 0.000s EvType: Command CommandID: CID_ClearSpecificLayer ParamType: uint32 Value: { 0 }


void VerticalStroke(real x, real y, int length) {
<StrokeEvent>
<StrokeHeader>
<EventPt> Wait: 0.000s Loc: (x, y) Pr: 1 Ti: 1 Ro: 0 Fw: 1 Bt: 1 Rv: NO Iv: NO </EventPt>
<Recorded> Yes </Recorded>
<RandSeed> 0x000000000, 0x000000025 </RandSeed>
</StrokeHeader>

Wait: 0.020s Loc: (x, y+length) Pr: 1 Ti: 1 Ro: 0 Fw: 1 Bt: 1 Rv: NO Iv: NO
Wait: 0.139s Loc: (x, y+length+3) Pr: 1 Ti: 1 Ro: 0 Fw: 1 Bt: 1 Rv: YES Iv: NO
Wait: 0.020s Loc: (x+0.001, y+length+2) Pr: 1 Ti: 1 Ro: 0 Fw: 1 Bt: 1 Rv: NO Iv: NO
</StrokeEvent>
}

real brushsize = CurrentToolSetting(0x0B2D05E64);
int height = PaintingHeight();
int width = PaintingWidth();
real step=brushsize*150.0;

real depth=0.0;
real thinness=0.0;
real numberacross=(width-2*step)/step;
real numberdown = (height-2*step)/step;

// Set thinners and depth to zero
Wait: 0.001s EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E35 (Thinners), 0 };
Wait: 0.001s EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x000026148 (Depth), 0 };

// Find a size for a block which will house one stroke
int blockwidth = brushsize*100 + 50*brushsize;
int blockheight = 100 + 50;

// Establish a grid
intarray gridh;
intarray gridv;
int gridhsize = width/blockwidth;
int gridvsize = height/blockheight;

gridh.SetSize(gridhsize);
gridv.SetSize(gridvsize);

// Fill the grid with coordinates of strokes
for(int x=1; x<=gridhsize; x++)
{
gridh[x]=x*blockwidth+blockwidth/2;
}
for(int y=1; y<=gridvsize; y++)
{
gridv[y]=y*blockheight+blockheight/2;
}

// The grid painting engine
for(int y=1; y<=gridvsize; y++)
{
for(int x=1; x<=gridhsize; x++)
{
depth=x/gridhsize;
Wait: 0.000s EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x000026148 (Depth), depth };
VerticalStroke(gridh[x],gridv[y], blockheight-50);

}
thinness=y/gridvsize;
Wait: 0.000s EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E35 (Thinners), thinness };
}

paulwilliamwoods
05-14-2020, 03:32 AM
I still don't know why MessageTip isn't working but the intarray problem was solved when I realised I was trying to access beyond the end of the zero-referenced array. We can be thankful that didn't work!