Mirage Source

Free ORPG making software.
It is currently Thu Apr 25, 2024 6:57 pm

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: 32*64 NPC's Full Tut
PostPosted: Sat Oct 14, 2006 5:21 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Tutorial by: DarkX
Code tested on: MSE

Ok I was looking over all the things that were missing on that version that William posted, which I guess was made by Sign, not really sure, but I wanted people to have the whole idea before they add it, here's my version of the tutorial.

Ok this is all client side, let's start with this:
Code:
        ' Blit out the npcs
        For i = 1 To MAX_MAP_NPCS
             Call BltNpc(i)
        Next i

It should be duplicated, (copy it and paste it right beneath the first one)
It should look like this:
Code:
        ' Blit out the npcs top
        For i = 1 To MAX_MAP_NPCS
             Call BltNpcTop(i)
        Next i

Next we should move along to find " Public sub BltNPC(Byvl MapNpcNum as long) "
copy the entire sub. Then paste it below the first one and rename it, " Public sub BltNpcTop(byval MapNpcNum as long) "

In bltNpcTop; replace This:
Code:
    ' Check if its out of bounds because of the offset
    If y < 0 Then
        y = 0
        With rec
             .top = .top + (y * -1)
        End With
    End If

With this:
Code:
    ' Check if its out of bounds because of the offset
    y = y - 32
    If y < 0 And y > -32 Then
        With rec
              .top = .top - y
              y = 0
        End With
    End If

Tim to move along; let's work on the rest go into sub BltNpc; and replace This:
Code:
    With rec
        .top = Npc(MapNpc(MapNpcNum).Num).Sprite * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = (MapNpc(MapNpcNum).Dir * 3 + Anim) * PIC_X
        .Right = .Left + PIC_X
    End With

With This:
Code:
    With rec
        .top = Npc(MapNpc(MapNpcNum).Num).Sprite * PIC_Y + PIC_Y
        .Bottom = .top + PIC_Y
        .Left = (MapNpc(MapNpcNum).Dir * 3 + Anim) * PIC_X
        .Right = .Left + PIC_X
    End With

Keep it moving theres more to see, go into BltNpcTop and replace This
Code:
    With rec
        .top = Npc(MapNpc(MapNpcNum).Num).Sprite * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = (MapNpc(MapNpcNum).Dir * 3 + Anim) * PIC_X
        .Right = .Left + PIC_X
    End With

With this:
Code:
    With rec
        .top = Npc(MapNpc(MapNpcNum).Num).Sprite * PIC_Y * 2
        .Bottom = .top + PIC_Y
        .Left = (MapNpc(MapNpcNum).Dir * 3 + Anim) * PIC_X
        .Right = .Left + PIC_X
    End With


Now that's still not all of it.
Go into sub BltMapNpcName and replace This:
Code:
TextY = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - CLng(PIC_Y / 2) - 4

With this:
Code:
TextY = MapNpc(Index).Y * PIC_Y + MapNpc(Index).YOffset - 50 '(or-4 -  pic_y - pic_y/2)

Again Still not all of it; there's a little more be patient. Ok go into frmNpcEditor and click picSprite
Make it's width 480
And it's height 960
And finally the LAST part.
In modGameLogic find Sub NPCEditorBltSprite
Once you've found it, replace the whole sub with this:
Code:
Public Sub NpcEditorBltSprite()
    Call BitBlt(frmNpcEditor.picSprite.hdc, 0, 0, PIC_X, PIC_Y * 2, frmNpcEditor.picSprites.hdc, 3 * PIC_X, frmNpcEditor.scrlSprite.Value * PIC_Y * 2, SRCCOPY)
End Sub


Or just put this: *2 :After every PIC_Y.

And that's the complete tutorial; have fun with it.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 05, 2006 3:36 pm 
Offline
Regular
User avatar

Joined: Sun Aug 27, 2006 5:36 pm
Posts: 53
nice, but the npc top is sill under the playersprite :(


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 05, 2006 3:37 pm 
Offline
Regular

Joined: Fri Aug 25, 2006 8:39 pm
Posts: 66
Yeah, I'm not sure how to fix that, I've been working on this fixing it since he posted the tut


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 05, 2006 3:42 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
I was looking over my code and it blt's correctly for me, it blts the players head over the npc's... Though I have to work on the part where it blts your feet over the npc's head.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 03, 2006 6:25 am 
Offline
Knowledgeable
User avatar

Joined: Sun Dec 03, 2006 6:18 am
Posts: 228
Location: NJ, United States
Sorry for bringing back this old tut guys,but im Quake. Im new to VB and Mirage. I was testing out this tutorial and i thought i could help DarkX a bit. I hope you dont get offended if you think im trying to make my way look better im only trying to help :D

Well, I placed
Code:
        ' Blit out the npcs top
        For i = 1 To MAX_MAP_NPCS
             Call BltNpcTop(i)
        Next i


AFTER
Code:
    ' Blit out players
        For i = 1 To MAX_PLAYERS
              If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                  Call BltPlayer(i)
              End If
        Next i


By doing this, it makes the NPC tops over the players.

Now for some reason this bit of code didnt work well for me
Code:
 With rec
        .top = Npc(MapNpc(MapNpcNum).Num).Sprite * PIC_Y * 2
        .Bottom = .top + PIC_Y
        .Left = (MapNpc(MapNpcNum).Dir * 3 + Anim) * PIC_X
        .Right = .Left + PIC_X
    End With


So i just removed the * 2 after PIC_Y and it worked. I dont actually know what i did lol but it works. BTW nice tut i used it


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 12:06 am 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Not sure if I was the only one that got this error, but my NPc's kept showing up like this if the sprite number was odd:

Image

So I simply went into Sub NPCEditorOk() and changed this line:

Code:
Npc(EditorIndex).Sprite = frmNpcEditor.scrlSprite.Value * 2


And in Sub NPCEditorInit()

Code:
frmNpcEditor.scrlSprite.Value = Npc(EditorIndex).Sprite / 2


(At first I thought I need to double the editor's scroll value, but that wasn't the case.)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 7:36 am 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
What font is that? And you better tell meh!

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 1:26 pm 
Looks like Arial.


Top
  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 7:18 pm 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Tahomaz0rz


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 3:06 am 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
Rezeyu wrote:
Tahomaz0rz


Whats the exacts?! Tahoma Bold, size?

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 3:10 am 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Code:
' Font variables
Public Const FONT_NAME = "tahoma"
Public Const FONT_SIZE = 18


No other variables changed. Except stroked.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 3:11 am 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
Why the hell is your shit so smooth?

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 3:14 am 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Umm.. I dunno.

When I added the stroked text, I sued Elysium's tut because I couldn't find the one I used from Mirage on my original source.

(I think it was lost from the backups)


Then I went into a tut request about text outline and I think I actually used YOUR modification to the code..

Code:
    Call TextOut(hdc, x + 1, y + 0, Text, Len(Text))
    Call TextOut(hdc, x + 0, y + 1, Text, Len(Text))
    Call TextOut(hdc, x + 1, y + 1, Text, Len(Text))
    Call TextOut(hdc, x - 1, y - 0, Text, Len(Text))
    Call TextOut(hdc, x - 0, y - 1, Text, Len(Text))
    Call TextOut(hdc, x - 1, y - 1, Text, Len(Text))


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 3:19 am 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
I'm positive thats not it o.o

I guess its gfx card concerns?

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 4:11 am 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Mehbeh..

I'm running on a 256MB ATI Radeon X1300 Pro, I needed a 256g= Meg card to run Vista.


<Has Home Premium, and Aero was demanding>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 9:51 pm 
Try chaning your resolution to like 16 Bit, see if that helps :o


Top
  
 
 Post subject: Re: 32*64 NPC's Full Tut
PostPosted: Sun Dec 16, 2007 10:45 am 
Offline
Regular

Joined: Sun Nov 04, 2007 2:47 pm
Posts: 40
Hello, i have a bug, look that :
Image

Can I help me please ?

Thanks you in advance.


Top
 Profile  
 
 Post subject: Re: 32*64 NPC's Full Tut
PostPosted: Sun Dec 16, 2007 3:13 pm 
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
If you loop from the top left of the map to the bottom right, the back sprite will show below the front

_________________
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: 32*64 NPC's Full Tut
PostPosted: Tue Feb 19, 2008 1:56 pm 
Offline
Knowledgeable
User avatar

Joined: Tue Feb 06, 2007 9:50 pm
Posts: 180
Location: Bergenfield, New Jersey, US
Sorry for necroing but I just had to put up the bug fix.

Refer to: Image

This can easily be fixed by moving the:
Code:
        ' Blit out the npcs top
        For i = 1 To MAX_MAP_NPCS
            Call BltNpcTop(i)
        Next i



Under:
Code:
        ' Blit out players
        For i = 1 To MAX_PLAYERS
            If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                Call BltPlayer(i)
            End If
        Next i



Making it look like:
Code:
        ' Blit out the npcs
        For i = 1 To MAX_MAP_NPCS
            Call BltNpc(i)
        Next i
       
        ' Blit out players
        For i = 1 To MAX_PLAYERS
            If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                Call BltPlayer(i)
            End If
        Next i
       
        ' Blit out the npcs top
        For i = 1 To MAX_MAP_NPCS
            Call BltNpcTop(i)
        Next i
       
        ' Blit out players top
        For i = 1 To MAX_PLAYERS
              If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                  Call BltPlayerTop(i)
              End If
        Next i


Solved.


Top
 Profile  
 
 Post subject: Re: 32*64 NPC's Full Tut
PostPosted: Thu Jul 24, 2008 6:01 am 
Offline
Newbie

Joined: Sun Jul 20, 2008 6:52 am
Posts: 2
That bug fix doesn't work for me.. I tried this out and I still get the doubled sprite.. Instead of getting the "top" sprite?


Top
 Profile  
 
 Post subject: Re: 32*64 NPC's Full Tut
PostPosted: Thu Jul 24, 2008 9:40 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
somewhere up above one of the guys posted a fix replace the * with a /

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject: Re: 32*64 NPC's Full Tut
PostPosted: Mon Aug 11, 2008 2:31 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Why do you need an algorithm?

Code:
For y = 0 to max_mapy
For i = 1 to HighIndex
If getplayery(i) = y then
bltplayer
end if
next
next


Something like that should work.

_________________
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: 32*64 NPC's Full Tut
PostPosted: Tue Nov 02, 2021 7:50 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 487102
Econ203.5BettDEFIPropSideSidnDreaVisiFyodAlfrToccDekoStriTendPaveTescRondMajeWindBlayXVIIroad
IoseMartVeroHowaWindKeraTeanAllaWateWillGeorRambWestSupeSpecBaroRodnTAXIBradJeanHaveBabbWell
GrimCityTranSansBichLineWindTroyQWERNokishinRossFutuJackPetePrakXIIILakaClowXVIIXIIIMarkEreb
SapoMonsJameEmmaApolDuetClicHenrIvanFrohWrigMicrEdwaZoneSwarJameFOTOFamiMiyoZoneCallBIOSRusi
DomiEricLapiBobbZoneZoneCantAlbeZoneWiFiZoneZoneZonediamZoneChetXVIIEdgaZoneSonyHampXVIIJame
ZoneXVIIBradPoweSpecKronVestCataBookMagnHangTimoCharESACChicWingMistBeflMystDennHechMedlIris
EvreEducEducMariBatuBoomRollDeicWindWindCrayValeChouCafeWhisHarrLizaSantwwwmSofiAgatRobeTick
actiPampRobeXVIIVIIIErneEsaiGiusInclMemoPeteThisBogdTillXVIIJammViktRussGoldInteMoveProlWinx
ThisTaxaMichWilsJerePianLangwwwrMIRANineChosJeweReadRobeBuilVariDawnIncrDigiLynyMariPowePowe
PoweBIOSSugaNeveChriSpliRennWillPartMusiMariWillRajetuchkasJamePubb


Top
 Profile  
 
 Post subject: Re: 32*64 NPC's Full Tut
PostPosted: Fri Feb 18, 2022 1:10 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 487102
Econ191.5BettLaboRadiCaliWillDennCepeGeorAndrXVIITaenSympXVIIchrysimpDormZyliGoodVIIITerrJack
SonaTimoTescLiebWindSupeGezaContShauXVIIAndrDeepIntrBylyJeweEdouJennAkseJaneWindDownStevLabo
BarrAnurSimsCedrSorrWongSimsMercopusChrimiliAndrBarbDaviDolbAnthVictArbeOetkSallAdioGaudRowb
RamaPushRajnSalvJeffRichSelaThomBrenBramGeorDrWeLobsZoneFuxiGreeWhatZyciZoneZoneCuddJohnFuxi
diamMornArtsGorgZoneZoneWaylRobeZoneAudiZoneZoneZoneZoneZoneJohnHeinZoneZoneTranXVIIOtakLock
ZoneXXIIBronHarmMeriKronVestCataBookLambSnooPhilPostPolazhenMBXXMistSQuiKenwLionRigaBritTang
RocoHappEducexclAliaLoveWarhWindJeweWindSilwRedmChouEscaWhisArthJackNASAWindKosmSileHumpXVII
wwwcNapoXVIITituHolgSinfPhylTheoNegrCharBenoTimeCoeuWorlBetwJeffPhilCOBRDonaInteJaniGateBrat
PetrsupeXVIIMichMediReadBookEthePaulTimeMillLIVEKoldAmazMarcRedeEmerWindJennChirWillHarmHarm
HarmGeieLikePhilBonnTellwwwnBookKaurJasmNeueValeScottuchkasBonnAstr


Top
 Profile  
 
 Post subject: Re: 32*64 NPC's Full Tut
PostPosted: Tue Mar 15, 2022 8:43 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 487102
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоmagnetotelluricfield.ruинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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:  
cron
Powered by phpBB® Forum Software © phpBB Group