Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 4:57 pm

All times are UTC




Post new topic Reply to topic  [ 270 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next
Author Message
 Post subject: Automation Error...
PostPosted: Sun Feb 01, 2009 10:11 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Trying to render the guild name over players head, and it doesn't seem to want to work.

Image

Code:
TexthDC = DDS_BackBuffer.GetDC ' Lock the backbuffer so we can draw text and names


Code:
        For i = 1 To PlayersOnMapHighIndex
            Call DrawPlayerGuild(PlayersOnMap(i))
        Next


Code:
Sub DrawPlayerGuild(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
   
    ' Check guild rank level to determine color
    If GetPlayerPK(Index) = NO Then
        Select Case Player(Index).GuildRank
            Case 0
                Color = QBColor(Brown)
            Case 1
                Color = QBColor(DarkGrey)
            Case 2
                Color = QBColor(Cyan)
            Case 3
                Color = QBColor(Blue)
            Case 4
                Color = QBColor(Pink)
        End Select
    Else
        Color = QBColor(BrightRed)
    End If

    ' Determine location for text
    TextX = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + (PIC_X \ 2) - ((Len(GetPlayerName(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (PIC_Y \ 2) - 2
   
    ' Draw name
    Call DrawText(TexthDC, TextX, TextY, GetPlayerGuild(Index), Color)
End Sub

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Sun Feb 01, 2009 10:16 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Make sure you unlock the DC after you've rendered the text.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Sun Feb 01, 2009 10:32 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
I've tried to put
Code:
    ' Release DC
    Call DDS_BackBuffer.ReleaseDC(TexthDC)


Everywhere. :(

Doesn't work

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Sun Feb 01, 2009 10:43 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Rather than making an entire new loop, just put;

Code:
Call DrawPlayerGuild(PlayersOnMap(i))


Under the call for DrawPlayerName.

Then, tell me what line it errors on.

Remove any extra DC locks or unlocks you added.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Sun Feb 01, 2009 11:05 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
It errors on the same line.

Code:
ErrorHandle:
   
    If Err.Number = 91 Then
        Sleep 100
        Call ReInitDD
        Err.Clear
        Exit Sub
    End If
   
    TexthDC = DDS_BackBuffer.GetDC ' Lock the backbuffer so we can draw text and names
   
    Call DrawText(TexthDC, 10, 15, "Error Rendering Graphics - Unhandled Error", QBColor(BrightRed))
    Call DrawText(TexthDC, 10, 28, "Error Number : " & Err.Number & " - " & Err.Description, QBColor(BrightCyan))

    GoTo Continue
           
End Sub


On
Code:
TexthDC = DDS_BackBuffer.GetDC ' Lock the backbuffer so we can draw text and names

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Mon Feb 02, 2009 3:05 am 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
is it already locked?

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Mon Feb 02, 2009 3:40 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Lea wrote:
is it already locked?


I believe so.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Mon Feb 02, 2009 4:52 am 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
locking a locked surface would cause an automation error.

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Mon Feb 02, 2009 12:02 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Robin wrote:
Rather than making an entire new loop, just put;

Code:
Call DrawPlayerGuild(PlayersOnMap(i))


Under the call for DrawPlayerName.

Then, tell me what line it errors on.

Remove any extra DC locks or unlocks you added.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Mon Feb 02, 2009 2:11 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Robin wrote:
Robin wrote:
Rather than making an entire new loop, just put;

Code:
Call DrawPlayerGuild(PlayersOnMap(i))


Under the call for DrawPlayerName.

Then, tell me what line it errors on.

Remove any extra DC locks or unlocks you added.


I did. There are only two DC Unlocks in my whole project. And three locks.... I'm assuming that's it?

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Mon Feb 02, 2009 2:16 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
I set an unlock bfore a new lock and I get this:
Code:
    Call DrawText(TexthDC, 10, 15, "Error Rendering Graphics - Unhandled Error", QBColor(BrightRed))
    Call DrawText(TexthDC, 10, 28, "Error Number : " & Err.Number & " - " & Err.Description, QBColor(BrightCyan))
(They appear on the screen)

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Mon Feb 02, 2009 2:47 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Nean wrote:
I set an unlock bfore a new lock and I get this:
Code:
    Call DrawText(TexthDC, 10, 15, "Error Rendering Graphics - Unhandled Error", QBColor(BrightRed))
    Call DrawText(TexthDC, 10, 28, "Error Number : " & Err.Number & " - " & Err.Description, QBColor(BrightCyan))
(They appear on the screen)


STOP MAKING NEW LOCKS AND UNLOCKS

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Mon Feb 02, 2009 11:02 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Robin wrote:
Nean wrote:
I set an unlock bfore a new lock and I get this:
Code:
    Call DrawText(TexthDC, 10, 15, "Error Rendering Graphics - Unhandled Error", QBColor(BrightRed))
    Call DrawText(TexthDC, 10, 28, "Error Number : " & Err.Number & " - " & Err.Description, QBColor(BrightCyan))
(They appear on the screen)


STOP MAKING NEW LOCKS AND UNLOCKS


Awww :(

Okay. I stopped.

I'll probably try this from a new source. xDD

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 1:44 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Alright so I got it to work... Sorta. No errors, but this is what I get when it draws my "guild"

Image

Code:
        If GetPlayerGuild(i) <> vbNullString Then
            For i = 1 To PlayersOnMapHighIndex
                Call DrawPlayerGuild(PlayersOnMap(i))
            Next i
        End If


Code:
Public Sub DrawPlayerGuild(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
   
    ' Check access level to determine color
    If GetPlayerPK(Index) = NO Then
        Select Case GetPlayerAccess(Index)
            Case 0
                Color = QBColor(Brown)
            Case 1
                Color = QBColor(DarkGrey)
            Case 2
                Color = QBColor(Cyan)
            Case 3
                Color = QBColor(Blue)
            Case 4
                Color = QBColor(Pink)
        End Select
    Else
        Color = QBColor(BrightRed)
    End If

    ' Determine location for text
    TextX = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + (PIC_X \ 2) - ((Len(GetPlayerGuild(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (PIC_Y \ 2) - 16
   
    ' Draw name
    Call DrawText(TexthDC, TextX, TextY, GetPlayerGuild(Index), Color)
End Sub

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 2:11 am 
The packet isn't parsing the guild.


Top
  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 2:20 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Matt wrote:
The packet isn't parsing the guild.



How do I do that? I thought I was doing it right, seeing as how i can do /info and it shows me my guild. :\

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 3:19 am 
In every instance of the playerdata packet, you need to add "getplayerguild(index)" to the end of it, then make the client receive it.


Top
  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 3:42 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Matt wrote:
In every instance of the playerdata packet, you need to add "getplayerguild(index)" to the end of it, then make the client receive it.


Much appreciated. I should've figured that one out.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 10:29 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Glad you got it working, but next time I tell you to do something, do it xD

So damn aggrivating.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 2:03 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Robin wrote:
Glad you got it working, but next time I tell you to do something, do it xD

So damn aggrivating.


No, I was. I honestly was. I'm not that stupid. It was just that I didn't change the write thing in the DrawPlayerGuild, so it was trying to draw two names, and that's what was screwing things up. It was when I did what you said, and it didn't work, that I started making more locks/unlocks. :D

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 4:45 pm 
Feel free to add me on GTalk if you need help in the future, Nean. It's easier to help you over a messenger, than to sift through all the insults on these forums.


Top
  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 4:54 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Matt wrote:
Feel free to add me on GTalk if you need help in the future, Nean. It's easier to help you over a messenger, than to sift through all the insults on these forums.


Yeah, go ahead and add me too.

Matt smells.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Feb 03, 2009 5:22 pm 
It's the weed and alcohol. I can't help it.


Top
  
 
 Post subject: Re: Automation Error...
PostPosted: Wed Feb 04, 2009 12:03 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Alright, I'll add you guys. =]

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Automation Error...
PostPosted: Tue Dec 14, 2021 1:14 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489512
audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffuserhttp://semiasphalticflux.rusemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchuckинфоtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimate.rutemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 270 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group