Jump to content

prospeed


jpam
 Share

Recommended Posts

Hello.

I was looking at the demos for this UDF and DLL, and it REALLY WORKS GREAT!

:rolleyes: WOW. :shocked:WOWWOW. :shocked:WOW WOW WOW. I can't say anything else other than WOW.

However, the UDF or DLL (I'm not so sure which one) doesn't really work on my computer

I've downloaded the latest version of the DLL (on your first post) and put it in C:\WINDOWS\system32\Prospeed.dll

I've also downloaded the latest version of your superb UDF (as seen in your demos) and put it in

C:\Program Files\AutoIt3\Include\Prospeed.au3 and

C:\Program Files\AutoIt3\beta\Include\Prospeed.au3

However, when I put Lakes' bees example in SCiTE and try to run it,

C:\Testing\d.au3(25,49) : ERROR: Background() called with wrong number of args.

Background(@scriptdir & "\Hintergrund.jpg", 0, 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\beta\Include\Prospeed.au3(387,64) : REF: definition of Background().

Func Background($S_FILE, $S_POSX, $S_POSY, $N_WIDTH, $N_HEIGHT)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Testing\d.au3 - 1 error(s), 0 warning(s)

comes out through the error console. Ditto with Beta Run and Beta Compile.

Even if I press Continue Anyway (while compiling), the .exe will still give me the error.

Am I doing anything wrong?

Link to comment
Share on other sites

  • Replies 511
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

change this line;

Background(@scriptdir & "\Hintergrund.jpg", 0, 0)

to this;

Background(@scriptdir & "\Hintergrund.jpg", 0, 0, 800, 400)

they are the bitmap x and y size

its better to put the prospeed.dll in the scriptdir

Regards

jpam

Edited by jpam
Link to comment
Share on other sites

I've added two functions I need for my project:

#CS 
    MoveSpriteWithTable
    syntax : MoveSpriteWithTable($S_Alias, TABLE)
    Note :  $S_Alias = user defined string of the sprite created by function Sprite()
            TABLE = String with X- and Y-Positions in the format "X1 Y1 X2 Y2 etc.."
    Example: MoveSpriteWithTable($Sprite, "0 0 100 0 100 100 0 100") Would move $Sprite in a square
#CE
Func MoveSpriteWithTable($S_Alias, $S_DATA)
    $S_DATA = StringSplit($S_DATA, " ")
    Local $S_STRUCTs = ""
    For $i = 1 To $S_DATA[0]
        $S_STRUCTs &= "short;"
    Next
    $S_STRUCT = DllStructCreate($S_STRUCTs)
    For $i = 1 To $S_DATA[0]
        DllStructSetData($S_STRUCT, $i, $S_DATA[$i])
    Next
    MsgBox(0, "", DllStructGetPtr($S_STRUCT))
    DllCall($S_DLL, "long", "MoveSpriteWithTable", "long", $S_Alias, "long", DllStructGetPtr($S_STRUCT), "long", $S_DATA[0] /2, "long", 0, "long", 0, "long", 1)
    $S_STRUCT = 0
EndFunc

#CS 
    SpriteTableMode
    syntax : SpriteTableMode($S_Alias, MODE)
    Note :  $S_Alias = user defined string of the sprite created by function Sprite()
            Mode = 0 / 1
                0 = Loops a table
                1 = Loop off
#CE
Func SpriteTableMode($S_Alias, $S_Mode)
    DllCall($S_DLL, "long", "SpriteTableMode", "long", $S_Alias, "long", $S_Mode)
EndFunc

Maybe someone has a use for it :rambo:

Great work jpam! :rolleyes:

Link to comment
Share on other sites

@jpam

i just want to say again how GOOD is this work ... :rolleyes:

so here is the problem:

i need to know everytime when the mouse is over any sprite so i used MouseOverSprite(), but it keeps telling me errors :rambo: i looked at prospeed.au3 and i saw that the $S_Alias needs to be splited, with "-", but in the $S_Alias there just isnt any "dashes", sooo .... idk what to do. any opinions?

#include <GUIConstants.au3>
#include <Prospeed.au3>
Opt("MouseCoordMode",0)

$GUI = GUICreate("Pro - x = ",400,400,-1,-1)
; start
$POSX = 0
$POSY = 0
$g = 0
Dim $Bee3[80]

$SprOfX     = 0
$SprOfY     = 0
$SpWid      = 24
$SpHgt      = 18
$SpFrms     = 4
$SpStFrm    = 1
$SpFrmSpd   = 6
$SpPosX     = -30
$Sprite2    = @scriptdir & "\Sprites.gif"
$SprSpdX = 3
$SprSpdY = 4
; end
$contextmenu = GUICtrlCreateContextMenu()

$addline = GUICtrlCreateMenuitem("Add new bee", $contextmenu)
GUISetState()

$Sprite1 = @scriptdir & "\Sprites.gif"

$back = BackgroundScroll(@scriptdir & "\satellite-image-of-netherlands.jpg", 0, 0, 60, 0)
$width  = GetBmpWidth($back)
$Height = GetBmpHeight($back)

$sp = sprite($Sprite1, 0, 0, 24, 18, 1, 1, 6, -50, 150)

While 1
    $msg = GUIGetMsg()
    $pos = MouseGetPos()
    GetBackgroundInfos()
    $title = WinGetTitle("Pro - ", "")
    WinSetTitle($title, "", "Pro - " &  $pos[0] & "   " & $pos[1])
    $mouse = MouseButton()
    If $msg = $GUI_EVENT_CLOSE then
        Exit
    EndIf
    If $msg = $addline then
        $g = $g + 1
    ;MsgBox(0, "", "bee!")
$Bee3[$g] = sprite($Sprite2,$pos[0], $pos[1], $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $pos[0] + 50, $pos[1] + 50)
SetSpriteSpeed($Bee3[$g], $SprSpdX, $SprSpdY)
SetmovingRectangle($Bee3[$g], $pos[0], $pos[1], $pos[0], $pos[1])

SetSpriteAnimMove($Bee3, 0, 0, 0)

        
    EndIf
For $i = 1 to $g
    $check = MouseOverSprite($Bee3[$g])
    if $check <> 0 then
        Msgbox(0, "", "mouse is over bee " & $i)
    Endif
next
    If $pos[0] >= 350 Then
        Select
        Case $pos[0] >= 400
            Scroll_Stop()
            Case $Offset_X < $width-400
                Scroll_Left(4)
            Case $Offset_X >= $width-400
                Scroll_Stop()
        EndSelect
    EndIf   
    If $pos[0] <= 50 Then
        Select
        Case $pos[0] <= 0
            Scroll_Stop()
            Case $Offset_X > 0
                Scroll_Right(-4)
            Case $Offset_X <= 0 
                Scroll_Stop()
        EndSelect
    EndIf
    If $pos[1] >= 350 Then
        Select
        Case $pos[1] >= 416
            Scroll_Stop()
            Case $Offset_Y < $Height-400
                Scroll_down(4)
            case $Offset_Y >= $Height-400
                Scroll_Stop()
        EndSelect
    EndIf   
    If $pos[1] <= 50 Then
        Select
        Case $pos[1] <= 0
            Scroll_Stop()
            Case $Offset_Y > 0
                Scroll_up(-4)
            case $Offset_Y <= 0
                Scroll_Stop()
        EndSelect
    EndIf
    If $pos[0] < 350 And $pos[0] > 50 Then
        If $pos[1] < 350 And $pos[1] > 50 Then
            Scroll_Stop()   
        EndIf
    EndIf
    Sleep(5)
WEnd

Func _exit()
    Exit
EndFunc

Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??[u]Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)[/u]

Link to comment
Share on other sites

@ cheatera

in this scroll demo i use a empty sprite !

if you want a visible sprite in your example change this

line 29

$Sprite = @scriptdir & "\Sprites.gif"

add this line after line 29

$Sprite1 = loadsprite($Sprite)

make sure the background pic is in your scriptdir

@ StNick

Thanks for finishing "move sprite with table" function

i'll will add it to the next update

Kind Regards

jpam

Edited by jpam
Link to comment
Share on other sites

@jpam: thx for the fast answer my inet conection is not so good so i enter here not so often... nvm so i dont use

$Sprite1 = @scriptdir & "\Sprites.gif"

i just started to work on that script with the backgrouns scroll and didnt delete the other source... what i mean is that when i click on "add bee" on the menu it must put one bee at $pos[0] and $pos[1]. the var $bee is "dimed" so the user can add not more than 80 (81 with 0) bees. in the main loop as u see there is check for $i = 1 to $g (number of bees been added) and checks id $bee[$g] is under the mouse

For $i = 1 to $g
    $check = MouseOverSprite($Bee3[$g])
    if $check <> 0 then
        Msgbox(0, "", "mouse is over bee " & $i)
    Endif
next

so what i mean that $g gets $g+1 everytime user clicks "add bee" and it checks every sec., is any bee (presented with $g) under mouse pos, but everytime i mouseover one sprite it tells me error. atm im not on my own pc but next time i'll send u pic of the error.

again: BEAUTIFUL UDF and DLL!!!!! VEEEEEERY nice WORK :whistle:))

ps: hope to understand what is my problem and solve it :lmao:

Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??[u]Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)[/u]

Link to comment
Share on other sites

  • 2 weeks later...

How do you create your sprite images?

Link to comment
Share on other sites

  • 1 month later...

Hello jpam,

I've tried different variations of stuff, but I can't seem to get an image appear on the sprite, I always get a black box. The sprite is placed & sized correctly, however the picture does not seem to display.. What's wrong?

Background(@scriptdir & "\backround.bmp", 1, 0, 497, 430)
$Sprite1    = @ScriptDir & "\F1Note.bmp"
$SprOfX     = 0
$SprOfY     = 0
$SpWid      = 90
$SpHgt      = 60
$SpFrms     = 4
$SpStFrm    = 10
$SpFrmSpd   = 1
$SpPosX     = 50
$Sprite1 = loadsprite($Sprite1)
$Sprite = sprite($Sprite,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,40)
$SprSpdX = 0
$SprSpdY = 1
SetSpriteSpeed($Sprite, $SprSpdX, $SprSpdY)
moveSprite($Sprite, 50, 509)

Thanks,

Kurt

EDIT: Also, is there a way to retrieve the sprite coordinates? - Found it.. GetSpriteInfos

Edited by _Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

mybe when you change;

$Sprite1 = @ScriptDir & "\F1Note.bmp"

$Sprite1 = loadsprite($Sprite1)

$Sprite = sprite($Sprite,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,40)

to;

$Spr1 = @ScriptDir & "\F1Note.bmp"

$Sprite1 = loadsprite($Spr1)

$Sprite = sprite($Sprite1,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,40)

Link to comment
Share on other sites

That doesn't seem to be working either :) Thanks for the effort though.

I don't know why it isn't displaying..

#include <Prospeed.au3>

GUICreate("test", 500, 500)
GUISetState()

Background(@scriptdir & "\backround.bmp", 1, 0, 497, 430)
$Spr1    = @ScriptDir & "\F1Note.bmp"
$SprOfX     = 0
$SprOfY     = 0
$SpWid      = 90
$SpHgt      = 60
$SpFrms     = 4
$SpStFrm    = 10
$SpFrmSpd   = 1
$SpPosX     = 50
$Sprite1 = loadsprite($Spr1)
$Sprite = sprite($Sprite1,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,40)
$SprSpdX = 0
$SprSpdY = 5

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
WEnd

This isn't working for some reason.. Prospeed.dll & prospeed.au3 are in my @scriptdir. I also tried having another prospeed.au3 in my Include folder.

Ooh, and also, even in your Beees.au3 example, I'm not getting the displayed picture (the bees aren't displaying)..

I will add 2 attachments for the 2 picture files of the example script above.

Thanks,

Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

#include <Prospeed.au3>

GUICreate("test", 500, 500)
GUISetState()

Background(@scriptdir & "\backround.bmp", 1, 0, 497, 430)

$Spr1    = @ScriptDir & "\F1Note.bmp"
$Sprite1 = loadsprite($Spr1)

;$sprite = Sprite($Sprite1, $S_offsetX, $S_offsetY, WIDTH, HEIGHT, FRAMES, START_FRAME, FRAME_SPEED, posX, posY)
$sprite = sprite($Sprite1, 0, 0, 94, 95, 1, 1, 0, 40, 40)

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
WEnd

Edited by jpam
Link to comment
Share on other sites

  • 3 weeks later...

im getting:

Fatal Error

AVector []: Out of Bounds.

What sould I do ?? I realy want to see what it is Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

  • 1 month later...

@Dellairion

please post example code with the gif image

so i can look @ it

@AlmarM

Fatal Error

AVector []: Out of Bounds.

means: prospeed.dll is not in the scriptdir

Edited by jpam
Link to comment
Share on other sites

Some more questions where i couldn't find answers for...

How can i resize a sprite without manually editing the size of the image itself?

(It's to resize the character in the thing i'm trying to create.)

And how can i add something like a tekst message on a sprite?

(I'm trying to create something like a textballoon above the characters head.)

Thnx,

Dellairion

Edited by Dellairion
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...