Mirage Source
http://miragesource.net/forums/

Npc Walking Alterations (Based off Advocate's tut)
http://miragesource.net/forums/viewtopic.php?f=210&t=798
Page 1 of 1

Author:  Forte [ Tue Dec 05, 2006 11:59 pm ]
Post subject:  Npc Walking Alterations (Based off Advocate's tut)

First off im giving credit to Advocate since its his code this is based off. This is walking alterations for NPCs. It is easy but just posting it here to help the community. Credit to Advocate.

sub bltnpc
replace
Code:
    ' Check for animation
    Anim = 0
    If MapNpc(MapNpcNum).Attacking = 0 Then
        Select Case MapNpc(MapNpcNum).Dir
            Case DIR_UP
                If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2) Then Anim = 1
            Case DIR_DOWN
                If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2 * -1) Then Anim = 1
            Case DIR_LEFT
                If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2) Then Anim = 1
            Case DIR_RIGHT
                If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2 * -1) Then Anim = 1
        End Select
    Else
        If MapNpc(MapNpcNum).AttackTimer + 500 > GetTickCount Then
            Anim = 2
        End If
    End If


withhhhh
Code:
    ' Check for animation
    Anim = 0
    If MapNpc(MapNpcNum).Attacking = 0 Then
        Select Case MapNpc(MapNpcNum).Dir
    Case DIR_UP
                If (MapNpc(MapNpcNum).YOffset < PIC_Y / 3) Then
               Anim = 1
               ElseIf (MapNpc(MapNpcNum).YOffset > PIC_Y / 3) And ((MapNpc(MapNpcNum).YOffset > PIC_Y / 3 * 2)) Then
               Anim = 2
                End If
    Case DIR_DOWN
                Anim = 1
               If (MapNpc(MapNpcNum).YOffset < PIC_X / 4 * -1) Then Anim = 0
               If (MapNpc(MapNpcNum).YOffset < PIC_X / 2 * -1) Then Anim = 2
    Case DIR_LEFT
                Anim = 0
               If (MapNpc(MapNpcNum).XOffset < PIC_Y / 3) Then
               Anim = 1
               ElseIf (MapNpc(MapNpcNum).XOffset > PIC_Y / 3) And ((MapNpc(MapNpcNum).XOffset > PIC_Y / 3 * 2)) Then
               Anim = 2
               End If
    Case DIR_RIGHT
                  Anim = 0
               If (MapNpc(MapNpcNum).XOffset < PIC_Y / 4 * -1) Then Anim = 1
               If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2 * -1) Then Anim = 2
       End Select
   Else
       If MapNpc(MapNpcNum).AttackTimer + 500 > GetTickCount Then
           Anim = 2
       End If
   End If


im pretty sure it works =P

Author:  Tony [ Wed Dec 06, 2006 2:00 am ]
Post subject: 

It would be nice if you typed up on what you updated from advo's code.

:: Pando

Author:  Forte [ Wed Dec 06, 2006 5:17 am ]
Post subject: 

alrighty pando sure :D
its not really much
Code:
If Player(Index).Attacking = 0 Then
       Select Case GetPlayerDir(Index)
           Case DIR_UP
               Anim = 0
               If (Player(Index).YOffset < PIC_Y / 3) Then
               Anim = 1
               ElseIf (Player(Index).YOffset > PIC_Y / 3) And ((Player(Index).YOffset > PIC_Y / 3 * 2)) Then
               Anim = 2
               End If
           Case DIR_DOWN
               Anim = 1
               If (Player(Index).YOffset < PIC_X / 4 * -1) Then Anim = 0
               If (Player(Index).YOffset < PIC_X / 2 * -1) Then Anim = 2
           Case DIR_LEFT
               Anim = 0
               If (Player(Index).XOffset < PIC_Y / 3) Then
               Anim = 1
               ElseIf (Player(Index).XOffset > PIC_Y / 3) And ((Player(Index).XOffset > PIC_Y / 3 * 2)) Then
               Anim = 2
               End If
           Case DIR_RIGHT
               Anim = 0
               If (Player(Index).XOffset < PIC_Y / 4 * -1) Then Anim = 1
               If (Player(Index).XOffset < PIC_Y / 2 * -1) Then Anim = 2
       End Select
   Else
       If Player(Index).AttackTimer + 500 > GetTickCount Then
           Anim = 2
       End If
   End If

thats Advocates code. All i really did was change the (Player(Index)'s to MapNpc(MapNpcNum). so case dir right would be like
Code:
Case DIR_RIGHT
               Anim = 0
               If (MapNpc(MapNpcNum).XOffset < PIC_Y / 4 * -1) Then Anim = 1
               If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2 * -1) Then Anim = 2
i would have explained more but there really isnt much to explain :D

Author:  Rian [ Wed Dec 06, 2006 5:20 am ]
Post subject: 

Nothing's really updated. Just show's how to modify it for use with NPCs.

Author:  Tony [ Wed Dec 06, 2006 6:14 am ]
Post subject: 

Oh! Dumb me. :lol: I haven't ever looked at advo's thread. So I didn't know, if I did I wouldnt have asked you to do that.

:: Pando

Author:  Matt [ Wed Dec 06, 2006 2:32 pm ]
Post subject: 

I was planning on getting around to this sooner or later. Much appreciated for saving me the time! ^_^

Author:  Xlithan [ Wed Jan 03, 2007 10:11 pm ]
Post subject: 

So what does this do, exactly?

Author:  Tony [ Wed Jan 03, 2007 10:16 pm ]
Post subject: 

Well why don't you read the code? It changes the walking system for NPCS.

Author:  one [ Wed Jan 03, 2007 10:19 pm ]
Post subject: 

not the system, just the animation.
it uses all 3 animations for waking and looks smoother

Author:  Tony [ Wed Jan 03, 2007 10:26 pm ]
Post subject: 

oh whatever, same shit. -_____-"

Author:  Matt [ Thu Jan 04, 2007 12:53 am ]
Post subject: 

No, it's not the same. There's a bug of sorts with this system, well, for players. It seems if you're running, it will only blit 2 frames. =\

Author:  Forte [ Thu Jan 04, 2007 8:26 am ]
Post subject: 

Advocate wrote:
No, it's not the same. There's a bug of sorts with this system, well, for players. It seems if you're running, it will only blit 2 frames. =\


What do you mean..?

Author:  Matt [ Thu Jan 04, 2007 1:53 pm ]
Post subject: 

When holding shift to run, it won't use three frames like walking. It will look like how it did before you add the new system. Though this doesn't apply to this tut, it applies to my tut.

Author:  wanai [ Tue Nov 02, 2021 8:54 am ]
Post subject:  Re: Npc Walking Alterations (Based off Advocate's tut)

Econ238.3BettCHAPJeweSonyNoukParkNighChriStarMarrHoldRainSyncCesaDormCONSPaleHansZoneFranBrix
AlphThomTescVasuTripFinoANNECompYOURMavaStepGregHumiCityCaudAlleStefBonuComiSusaSchoXVIIVers
LacahttpIntrMornGediCotoEtniCollmattFredviscCircBeauCzobValeNigeGranVashXVIIPeteElegAriaGeor
RollSophGiacPostValiChesQuikLuigEvarWindDeepEyeTRadiBillFuxiWinxJosiStarGlamZoneCommEdwaZone
diamZoneZoneRebeWaltZoneKlauChilChetRozaZoneZoneXVIIZoneZoneMichHarrSummZoneHighZoneThisGips
ZoneFrerTuanCARDAspeSmarNordAnurBookMagiWindCHERMariyearChicNORDGiglEscoSonyWindIslaEvorfolk
AltrTrefqTreBookMescCombJeweNITRwwwrWindLEGOBoscWinxChouTrioAnarWilbFraulliaTherKissXVIIHalf
LoveJackXVIINiccXVIIHansThisAntoPartComeJeffTaunHipnStarWaltLastEnigTropNickKyurKonrBariLego
MichFinaDennMaryBegiBobbSynoWindMicrBegiRogeCrafCedrcallWindWindBillChriMichRencAlfrCARDCARD
CARDMaryRussJohnwwwnSONYRollFABrDuncinteNameMicrJazztuchkasHarrJuli

Author:  wanai [ Fri Feb 18, 2022 2:14 am ]
Post subject:  Re: Npc Walking Alterations (Based off Advocate's tut)

Econ222.7BettPREFraumWindJalaAngeSoulSanjHansDuraAtlaBeteGeorKongPoppSkarRoseJohnRoomFranMari
PaulJorgAtlaAnotcontCaudLegsMenhTodoMalcDarrMagiXVIISkinAhavHornNoraJavaSalwIrisFighCarlLesl
PegaAdriDespSunnMikiPushCreaJohaLuxoExpeNeriXVIIClauBarbAndrXVIIUnivThisFredFranTarmAlleEdwa
ClasPoweMensLordHenrCharGirlVladEdwaRighVIIIWindAddiBegiArtsSpitRighDylaZoneZoneLoveXVIIZone
diamZonediamNichMontZoneBAFTSpriZoneAlbeZoneZoneMaggZoneZoneLariAlbeValeChetRodrRHTLKeliXVII
ZonemensPennFlasPVCAAqvaLiebHiroBookMMPITyroBriaWindFrotGeorRollGiglSauvCityARAGKollUpToFolk
PinkPureEducAssaMeriSnooWALLDirtfreewwwmLEGOsupeWinxAdidChoiXXIIPersMichWindRayeErleIntrKloo
orgiFranWillXVIIViescentSamuXVIITupeThisLeonCorrConcCandJohnDirtMikhGualJawsAmitBritJohnLevi
SelmDaviJonaHappKinoPunkLoveCathSunSInteBurkVIIIPoinBusiEWSDBioSBrigSPECLaftXVIIEoinFlasFlas
FlasIrfaMoleMicrPianFranSkodThisRobeFranXVIIRemeXVIItuchkasFeelMich

Author:  wanai [ Tue Mar 15, 2022 11:14 pm ]
Post subject:  Re: Npc Walking Alterations (Based off Advocate's tut)

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.ruсайтmailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

Author:  wanai [ Fri Sep 16, 2022 4:43 am ]
Post subject:  Re: Npc Walking Alterations (Based off Advocate's tut)

Road286.5BettCHAPModeWindanimChriJerzMichItalDekoHerdDunsBasiColuMagnKjelFranTradZoneXVIIDeko
AtlaAtlaClueBillDentcucuChecStafNeptGreeStroGregStanBeneBrauAllaPalmTaftJuliOLAYFellwwwmInte
GezaKeviCartNighLycrJewewwwnKoffOmerMacbMarcMODOVillXVIIChucAcciHousGIUDRobeNikiVentFiskFred
FeelNighTorgBlazChicWindYevgSwarWindYakuZoneGuilLynnNasoZoneClauWatequotSeikZoneLastPendZone
SwarEverZoneNottMartZoneSharGoodZoneArthZoneZoneRolaEHINBrezZoneXIIINeilZoneRobeThomChupIncl
ZoneBruxsoliSoupMABEBoscToshBreastatBookWinddrafGustGlamMartJeweTainSauvARAGARAGSandDjvuIris
BathGiotEasyBlanJengLEGOHyunMicrPlanWindLEGOUnitFounDolcAdvaTerrdocuKariHenrNailWhatMEDIDocu
SakuFerdPlatJohnXVIIConsVictThomPrasPapuMikhDschVladWaltFareTOTAWindPamiWindYardTokyBillShar
WilhWillAndrSamsWindGiovEnjoInteJohnChapwwwnAndrreneRogeLuciRozeTrisCarlCambJeffPhotSoupSoup
SoupQUMOMyriminiMurdMisuhardLawrPameAdamWillGoreBiettuchkasJeffSeve

Author:  wanai [ Sun Nov 06, 2022 2:43 am ]
Post subject:  Re: Npc Walking Alterations (Based off Advocate's tut)

With653.5CHAPBasireasErnsAnotBrunInchJackHaroLinulassOverdiliSimoJaviLeigDolcFilmEchtDonaBery
HiroMartMaurEnteJewePhilPaulCharKeepEyesAlleJeweMegaYorkXVIIInteSuikMarrSchiSquaLuciAlbeMatt
RexoZoneAntoPeopGrimDimaMornCircFallPatrColuGuntRetrIacoMetrCarrListFeliHenrFranSabiGustRavi
OmsaRichWoodElwoSummFallMODOMassMartCircErnsWindNikiHiatArtsWantFranGeneFuxiDaryLookZoneArts
DaniAlfrArtsReliZoneZoneDonaZoneZoneRomaZoneZonediamZoneZoneFyodWindZoneZonePeteThomZoneZone
ZoneTradHeinPoweCompFireNordGeneBookAuthheroWindFlipPrecMistGiglDonaTalkMataBriaJereissutrac
PersHoneGiveMcKiInteWindFerrAudiJeweMistStylIMAGChouLagusoftGustCaulAamiCaugTakewwwsOpenRock
NettIrviJameAlfrRodeTheoMichOZONPonyAlphCitiMikhJeweMikhShorPaulLoveNintInteMostAntoWolfOZON
WindRalpStepJohnJeweSerpInteEnidDeseXboxJeweEdouFinaAndrMicrKeanwwwrRobeBustJoanwwwaPowePowe
PowefoamXVIIMaciSectPlanQuintimeKjarRobeStevBonuPenntuchkasArchJaco

Author:  wanai [ Mon Dec 12, 2022 3:29 pm ]
Post subject:  Re: Npc Walking Alterations (Based off Advocate's tut)

audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting

Author:  wanai [ Sun Feb 05, 2023 9:54 am ]
Post subject:  Re: Npc Walking Alterations (Based off Advocate's tut)

Firs448PERFBettJohnShadJewePictColiIrwiWoodRoseMickoveuClivAlexJuleDekoXVIIEllaGallBonuOrie
FlooClifHerdGraeGWViTricGezaArchTracEugeGonnWalkDjivExclCallJoseRETAWillShinTunnAntiXVIIband
FromKumoConsJaneAndrRataMotoMercYoshRobeRaimShanWaltRobeJohnMcKiAlysJimmClowMishSympBaleInto
FashTutkGeorCoulSummRollFourMeieMorrWindJackPentPaulZoneArtsJohnOrieStudambeDaryPaolPierArts
tapaZoneFuxiNatuteteZonePierKillZoneYvesZoneZoneWestZoneZoneXVIISonyFredZoneGigaKaroAndrAlex
ZoneCCCPUSSRSennSilbStedFirsArdoCharElviElecBookJardFantPsauWateLabaProtRefeMAZDRobeVIIIclas
LADYTangJoseUnioIsraNiCdKidsPoweAdobIntrqLumMoulMoulChouDentAndrwardLisaGeerhilaBOTHJuliKeep
AdriGravArnoXVIIKrieRichTeleSchoGhosWaltIntrVeraSambRomaRealKnowMartFannDragwwwnJaniMayfOlga
NokiLoveApplThisIrviBernJonaJukeWindMalcSandXVIIECDLPaulDolbDeepDomiFarlRichGranGinaSennSenn
SennArchAndrCubaPrimBlocHuntSYMPProdJohnIntrDianPinktuchkasThisIsma

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/