Mirage Source

Free ORPG making software.
It is currently Thu Mar 28, 2024 1:35 pm

All times are UTC


Forum rules


Make sure your tutorials are kept up to date with the latest MS4 releases.



Post new topic Reply to topic  [ 1595 posts ]  Go to page 1, 2, 3, 4, 5 ... 64  Next
Author Message
PostPosted: Sun Jan 25, 2009 4:41 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
If you're planning on doing a game right, you're most likely going to need some customizable tile attributes. This is where this comes handy... If you find any errors any code that would be a good addition, feel free to post them. I'm always up for some constructive criticism.

Download the form here: http://www.mediafire.com/file/ylgkhmzgy2g/frmScript.frm once the download is done, add it to your source.

SPOILER: (click to show)
Server Side
Find:
Code:
Public Const TILE_TYPE_KEYOPEN As Byte = 6


Under it add:
Code:
Public Const TILE_TYPE_SCRIPTED As Byte = 7


Then find:
Code:
Sub LeftGame(ByVal Index As Long)


Under it add:
Code:
Sub Scripted(ByVal scriptnum As Long, _
             Index As Long)

    Select Case scriptnum

        Case 0
            Call PlayerMsg(Index, "Test!", Blue)
            Exit Sub

        Case 1
            Call PlayerMsg(Index, "this is a Test!", Red)
            Exit Sub

        Case 2

            If GetPlayerAccess(Index) < 0 Then
                Call GlobalMsg("TESTESTESTTESTETSETSETSTE", BrightRed)
            End If

    End Select

End Sub


Then find:
Code:
Sub PlayerMove(ByVal Index As Long, _
               ByVal Dir As Long, _
               ByVal Movement As Long)
    Dim Packet As String
    Dim MapNum As Long
    Dim X As Long
    Dim Y As Long
    Dim Moved As Byte

    ' Check for subscript out of range
    If IsPlaying(Index) = False Or Dir < DIR_UP Or Dir > DIR_RIGHT Or Movement < 1 Or Movement > 2 Then
        Exit Sub
    End If
   
    Call SetPlayerDir(Index, Dir)
   
    Moved = NO


DIRECTLY under that add:
Code:
    If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_SCRIPTED Then
        Call Scripted(Val(Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data1), Index)
    End If


SPOILER: (click to show)
Client Side

Find:
Code:
                If frmMirage.optKeyOpen.Value Then
                    .Type = TILE_TYPE_KEYOPEN
                    .Data1 = KeyOpenEditorX
                    .Data2 = KeyOpenEditorY
                    .Data3 = 0
                End If


Under it add:
Code:
                If frmMirage.optscripted.Value Then
                    .Type = TILE_TYPE_SCRIPTED
                    .Data1 = ScriptNum
                    .Data2 = 0
                    .Data3 = 0
                End If


Then find:
Code:
                        Case TILE_TYPE_KEYOPEN
                            DrawText TexthDC, ((X * PIC_X) - 4) + (PIC_X * 0.5), ((Y * PIC_Y) - 7) + (PIC_Y * 0.5), "O", QBColor(White)


Under it add:
Code:
                        Case TILE_TYPE_SCRIPTED
                            DrawText TexthDC, ((X * PIC_X) - 4) + (PIC_X * 0.5), ((Y * PIC_Y) - 7) + (PIC_Y * 0.5), "SC", QBColor(Yellow)


Then find:
Code:
Public Const TILE_TYPE_KEYOPEN As Byte = 6


Under it add:
Code:
Public Const TILE_TYPE_SCRIPTED As Byte = 7


Now make an option button under the other tile attributes in the map editor, name it optscripted Double click it, and add this code in:
Code:
frmScript.Show vbModal

_________________
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  
 
PostPosted: Sun Jan 25, 2009 4:46 am 
Offline
Knowledgeable
User avatar

Joined: Sun Feb 10, 2008 7:40 pm
Posts: 200
Looks good, though I don't have the time to try it out ATM. Gonna have to do it tomorrow.

_________________
I is back!


Top
 Profile  
 
PostPosted: Sun Jan 25, 2009 5:48 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
not really a scripted tile

scripting a tile would suggest that I do not need to recompile upon deciding to script a tile.

_________________
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  
 
PostPosted: Sun Jan 25, 2009 5:50 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Lea wrote:
not really a scripted tile

scripting a tile would suggest that I do not need to recompile upon deciding to script a tile.


It's server side, so all you have to do is pause the server, and add one to the select case.

_________________
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  
 
PostPosted: Sun Jan 25, 2009 5:53 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
Because a live game will be run from inside the IDE.

_________________
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  
 
PostPosted: Sun Jan 25, 2009 5:57 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Lea wrote:
Because a live game will be run from inside the IDE.


Yeah, I didn't take into account, that you might compile your server. xDD

I might improve upon this, to make it editable from within the game itself.

_________________
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  
 
PostPosted: Sun Mar 01, 2009 5:22 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Thinking of turning this system into scriptable items/npcs

_________________
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  
 
PostPosted: Sun Mar 01, 2009 2:30 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
All been done before on the old Essence site.

Do something original and actually make them scriptable ;D

_________________
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  
 
PostPosted: Sun Mar 01, 2009 8:44 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Robin wrote:
All been done before on the old Essence site.

Do something original and actually make them scriptable ;D


Haha. I can give it a try.

_________________
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  
 
PostPosted: Fri Jul 24, 2009 1:05 pm 
Offline
Newbie

Joined: Sun May 03, 2009 9:01 am
Posts: 1
link dead :(


Top
 Profile  
 
PostPosted: Fri Jul 24, 2009 3:23 pm 
Offline
Knowledgeable

Joined: Sat Jul 08, 2006 8:24 am
Posts: 339
Pff, I even had scriptable items. Always fun to actually get cursed when using a cursed blade, rite?


Top
 Profile  
 
PostPosted: Fri Jul 24, 2009 6:06 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Fontor wrote:
link dead :(


If you look at the code, it shouldn't be THAT hard to construct your own form based off of it. It's quite simple really. However, if you TRY and still fail I'll go ahead and remake the form (I lost it as well)

_________________
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  
 
PostPosted: Wed Dec 01, 2021 8:29 am 
Online
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:43 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Econ


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:45 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
76.1


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:46 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bett


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:47 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bett


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:48 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Sydn


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:49 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Ravi


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:50 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Hand


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:51 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Jame


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:52 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Pala


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:53 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Were


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:55 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Paul


Top
 Profile  
 
PostPosted: Sat Jan 01, 2022 4:56 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Omeg


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

All times are UTC


Who is online

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