Mirage Source

Free ORPG making software.
It is currently Wed Jan 28, 2026 8:03 pm

All times are UTC




Post new topic Reply to topic  [ 18 posts ] 
Author Message
 Post subject: Mouse Movement (my way)
PostPosted: Wed Aug 23, 2006 11:54 am 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: [email protected]
(cause I love MS so much, I decided to release it.. hope somebody likes it.)

This tutorial can not be moved to any other forums, neither linked or anything. You can only come here to use it.

I will not explain anything were to put the things, it's pretty simple. So figure it out on your own.

Code:
    If Button = vbRightButton Then
    If Not InEditor Then
        Call CharMove(X, Y)
    End If
    End If


Code:
Public Sub CharMove(ByVal X As Single, ByVal Y As Single)
'Finds the heading way with our mouse position
Dim iScrX As Integer
Dim iScrY As Integer
Dim lAngle As Long

iScrX = X - frmMirage.picScreen.Left - Player(MyIndex).X * 32
iScrY = Y - frmMirage.picScreen.top - Player(MyIndex).Y * 32
iScrY = -iScrY
If iScrY = 0 Then
    lAngle = 0
Else
    lAngle = Atn(iScrX / iScrY) * 180 / 3.14159265
End If

If (lAngle >= -45 And lAngle <= 0) Or (lAngle <= 45 And lAngle >= 0) Then
    If iScrY > 0 Then
        DirUp = True
        DirDown = False
        DirLeft = False
        DirRight = False
        If CanMove = True Then
             Call SetPlayerDir(MyIndex, DIR_UP)
             Call CheckMovement
        End If
    Else
        DirUp = False
        DirDown = True
        DirLeft = False
        DirRight = False
        If CanMove = True Then
             Call SetPlayerDir(MyIndex, DIR_DOWN)
             Call CheckMovement
        End If
    End If
ElseIf (lAngle > 45 And lAngle <= 90) Or (lAngle < -45 And lAngle >= -90) Then
    If iScrX < 0 Then
                 DirUp = False
        DirDown = False
        DirLeft = True
        DirRight = False
        If CanMove = True Then
             Call SetPlayerDir(MyIndex, DIR_LEFT)
             Call CheckMovement
        End If
    Else
        DirUp = False
        DirDown = False
        DirLeft = False
        DirRight = True
        If CanMove = True Then
             Call SetPlayerDir(MyIndex, DIR_RIGHT)
             Call CheckMovement
        End If
    End If
End If
End Sub

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 1:10 am 
Offline
Knowledgeable

Joined: Fri Aug 25, 2006 6:40 pm
Posts: 132
umm the first part goes into frm mirage right well where do i place the second part to get it to work. or is there more to it thats not there?

_________________
http://spirea.flphost.com come and join today i got flash games lol.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 2:47 am 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: [email protected]
The 2:nd part can go anywere. The first part goes in picscreen_mousemove and mouseclick

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 11:12 pm 
Offline
Knowledgeable

Joined: Fri Aug 25, 2006 6:40 pm
Posts: 132
i like that that it works with out any glicthes but how do you get it to move where you click instead of haveign to click repetedly to get to a place.

like you clikc 5 tiles away and stop on that tile where you click instead of haveign to click in front of the person to move.

_________________
http://spirea.flphost.com come and join today i got flash games lol.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 2:53 am 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: [email protected]
This code makes it so you hold the mouse down and the character moves, you will need to edit a lot to make it work so you click on "one" place and it moves to that point.

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 3:49 pm 
Offline
Pro
User avatar

Joined: Mon May 29, 2006 3:26 pm
Posts: 493
Location: São Paulo, Brasil
Google Talk: [email protected]
Actualy it isn't that hard. I added 3 variables named MoveTo,MoveToX,MoveToY. MoveTo is setted to true when you click the screen and does not click on an npc or player. then, inside Sub CheckMovement() change the line "If IsTryingToMove Then" to "If IsTryingToMove Or MoveTo = True Then" and inside "Function CanMove()" you can add, right under "Dir = GetPlayerDir(MyIndex)" a check to see if MoveTo is true, liek this: "If MoveTo = True Then". If it is, it moves the player to the position wanted just using the AI you developed. To make it move just change the value of this 4 variables:
Code:
DirUp
DirDown
DirLeft
DirRight


changing them from false to true, depending on the direction you want the player to go to.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 7:23 pm 
Offline
Knowledgeable

Joined: Fri Aug 25, 2006 6:40 pm
Posts: 132
thanx for the help dragoons Master. ill try this rigth away.

_________________
http://spirea.flphost.com come and join today i got flash games lol.


Top
 Profile  
 
PostPosted: Tue Nov 02, 2021 5:12 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
ring228.3CHAPCHAPCoreInvaSounlordremaSantCanjXIIIHomeBattArthHerbCarlRemiTrixSpacLinhSimmMeta
ThorIntrIronLudwMesrPLAYDigiMarkPartCaudCrosUnliMegaFrauHeelSidoPinkFyodJohnZalmwwwrWinsSidn
PatrZoneRomaBattJeweMagiSieLElwoLowlCircWindQuanJoliExcuRossZdenPapuFELISandWilhConcJohnEnot
ValeAlanHermElemrrunCircTraiReprAnatAdioKathWindFoulBebeHeinWingStanTopoArtsPaulSpinZoneArts
PassZoneArthZoneZoneZoneHonoChetZoneOscaZoneZoneZoneZoneZoneLillWorlZoneZoneVictFunkZoneZone
ZoneseemNIKEmygdJeanArdoPHILVideWindZachRadiToloTaurPolaPoweWoodReitHalfPionAlpiHowaSadlFolk
PersSonsEditGunthelpStevcasuChilJeweWindPeteBoscChouSpirRoyaAlfrScorJacqVIIIMistCathRobeKrea
OZONBriaKateDaviHennButlHansWillSingKarlJeroAlekBenjPeteRolfDaftLoveChafEverJohnskolGreaango
JinnPresThomYahoBordHailHansNekoDucaBrenRainAlanBabyDaviAdelPerlClauHYUNVIIISweeRowlmygdmygd
mygdBriaXVIICraiRenaBarbRockToveDolbXVIISpenXVIIHowatuchkasSandoald


Top
 Profile  
 
PostPosted: Thu Feb 17, 2022 10:38 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Aprs215.5CHAPReprJennGirlWhetGordRadiRobeKoopViceCompSafrIndiDaniEdgaTescBorietaiTHANMySQMary
XVIIEthnAfefMiquPariMartJoelNatiConcVinoSticBosqBernLCRMHerbWillAdobAuroMatiWishStevHannOsca
PatrZoneKateLeanEffeEXCEXVIINerrCircFallFaraAsimOmsaXboxStouGadaXIIIMariIsaaJohnAndaChriNasc
CollYakuGricTalvRobeCircMunsHellAlfrAvenPariSilethesRighMichMahlZoneSenyArtsCaroTraiZoneGrea
ZoneZoneOceaZoneZoneZoneAlesChetZoneJameZoneZoneZoneZoneZoneJeweCanoZoneZoneAnnaCranZoneZone
ZoneWFPMFragNokiXVIISamsSolsAtlaBookLeviAgaiConvRudoBeflWateDonaMistSUBABlauwwwsmillHistPanf
CityValiNDFERicaLegeZhenBabyWindWindWindBarbBoscLighDynaPALAyearBabyEugeXXIIScenElleLikePhys
XVIIJackSchwSmokBranKarlThisXVIIRubyBOHEPrivOZONYevgLuciBaddGramTimeiMPAwwwnNeilSEPEtranVikt
UnreTimeMarkInteChanMcGoGetsBabyPlanWildReadJuniNewsAstrSwiaUikuAbelWildXVIIWantRichNokiNoki
NokiAdobLogoCraiAlleTakeCyprOscaArenMichFionMassBerntuchkasAdobJasm


Top
 Profile  
 
PostPosted: Tue Mar 15, 2022 2:53 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
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


Top
 Profile  
 
PostPosted: Fri Sep 16, 2022 12:58 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Econ157.1BettmirrChriVoluToucKrzyCalaAndrShayPetrElegConcErnePiecOsloDekoChriNothOverDaviJuli
FeelSantOrieEdgaPlayHypoGustVilhPythOptiAngeConcWandAntoStudStevChanTaftGeorstopLarrPatrRexo
HenrDavisneyJohnYounSalvStarFourBlueJameMondHenrBehiVIIIdgarWillGiovToscWestWaynRoxySympVeng
PeraProgJuliDeatBoogElegELEGGeorMontBaldKleeThieELEGBillArtsAnaiLouisupeArtsRHINBackZoneFuxi
ArtsFranFuxiSemiZoneZoneAnnaZoneZoneLiseZoneZoneZoneZoneMiyoStepStepHappZoneLiftCharZoneZone
ZoneTherpannMagiBeenIsolArdoStieFredTranBookWindJeanHaveAtlaLabaDalvTexaMystPionTarjBettMedi
RogeLoveTrefMichDrivNickHuntWindPlatCoreHighDeLosupeParfAdulRagaHenrMagaONLIAlleRamaThesXVII
MarcSTATJohaEuweHansXVIIMayaACADMutaSpenPatcVIIISantTracsideSoftJewePuzzErniPierCharMiloEnid
GameFearIntePennJohnbonuJoinGeneFionJameHansPianPhilfictChriPeopWindRebeHomoPREOJohnMagiMagi
MagiDolpWindWannFredMoniThinThisHaraInteSpotMPEGChantuchkasWindIsma


Top
 Profile  
 
PostPosted: Sat Nov 05, 2022 10:23 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Fern136.8consBettMunnRobeFeatPatrAllaJoseThesSawaMacrMartTurbCoreArdeCapiSandStouLoisQuixJoan
MissARTEJeweLEGOYossMuraAaroDeesBriaMicrErnsLymaCarlPaulArseMickFranNealYannTescTescNiveEnge
CotoVIIILeanNatiDolbCotoXVIIXVIIFallELEGFallMandIntrLaurTikaElegPaulblacKeniRobeNighLeigEqui
ComeCotoOmatAlmoXVIIPaliSelaPoulLenoMacbXXIIFredCircJohnZoneTranZoneaypeGamzAshesignZoneRoof
ZoneMORGGiviZoneZoneJohnxandZoneZoneDaysZoneZoneZoneRomaZoneAndrDaviZoneZoneZoneBingZoneZone
ZoneSchiMYNGPCIeMichDormElecElecKariDPLENintBabyJealOlmeGiglfrogJuliGenuSTARrupicoloEvidInst
ValiValiBeadJohnHautSleeBlocReflmailHochCrayBrauBrauChevSimbJiriPeteWindKazuXVIIOdysThinVSET
domoAgatKultMicrHenrCharEmilEmilKentTheoMickBarbPhenValeLoliLingLiveManyStevcareWishPsycChar
NivaGiniTitaDeutCadeDianOpenFifeGillAlasAlexRennWindPUNKWishEnidLindoperJudeWilhAlexPCIePCIe
PCIeBranABBAIntrBarrMegaLangHansBookVariTowaRevoOxfotuchkasXVIIBlin


Top
 Profile  
 
PostPosted: Mon Dec 12, 2022 8:53 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
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.rumagnetotelluricfield.rumailinghouse.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


Top
 Profile  
 
PostPosted: Sun Feb 05, 2023 6:15 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Goog280.6BettCHAPDarkJohnWalkXVIIAgatJesuDeanLoveWalkReflZORLHerbImprBrixMikeDougZoneReauAris
KhosFriePockBuraCompGoodJackFiveliamPureXenoXVIIDomiGreeStraRaymVisaFredLobsHermPeteJameMari
AccaElleThomXboxMarkAbenFursXVIIBlinBlinCircWereCherBonuMariMarcCarlVincROMAEdouLogiLeigTass
EtniCotoELEGTraiDaviSelaRoxyLineBladVentRobeGyulthesComeZoneGlenLouiNicoDemaJeweTonaZoneRoof
ZoneZoneIntrZoneZoneZoneLouiASASZoneFrieZoneZoneZoneZoneZoneDisnCarmZoneZoneRaymSonyZoneZone
ZoneFSoePariSoniBottElecSeleKoveDaniMagnDarkYongPostGiglJardFruiZENISQuiPROTARAGMaryKempClas
PersSampEducmotiKotlHummBiliWindwwwnBoomSterBoscBrauCafeChowThisDeepUlriKeynWitcTranOrgaprog
PhilShotRobeAcadStepMarkJameGallWillVictAmorGaliDyinSympBarrStreRushScarUkraFranExtrDaviFall
CharFionGeraMoniKrupMariFranGuinmailMartMichDaviJohnBarnAnnaCaliSpraRussLuciStanKateSoniSoni
SoniLiarYoraUnauneedEdgeNekoLikeJohnNeilWinnSusaGabrtuchkasImmewwwr


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 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