Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Cheat Engine Map Editor

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Thu Mar 31, 2022 7:26 am    Post subject: Cheat Engine Map Editor Reply with quote

hi, sorry for my bad English,
I like to create a tileset map GUI editor using Cheat Engine Table Lua Script,
can someone give me a tutorial, link, guide, or (I am sorry if I am rude) the working code?
I don't need an extra-large map, 2x2 I enough

note:
I provide you with The super Mario NES tilemap and some tiles

thank you, have a nice day



brick_under.png
 Description:
Brick_under
 Filesize:  7.36 KB
 Viewed:  2281 Time(s)

brick_under.png



brick_surface.png
 Description:
Brick_Surface
 Filesize:  7.37 KB
 Viewed:  2281 Time(s)

brick_surface.png



Block_QM.png
 Description:
Block_QM
 Filesize:  7.46 KB
 Viewed:  2281 Time(s)

Block_QM.png



Block_empty.png
 Description:
Block_empty
 Filesize:  7.37 KB
 Viewed:  2280 Time(s)

Block_empty.png



3739446.jpg
 Description:
Main
 Filesize:  107.17 KB
 Viewed:  2281 Time(s)

3739446.jpg


Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1257

PostPosted: Thu Mar 31, 2022 9:20 am    Post subject: Reply with quote

Check this page to get started.
https://forum.cheatengine.org/viewtopic.php?t=610317

But a similar coding to your game may already exist. Wink
https://forum.cheatengine.org/viewtopic.php?p=5750093#5750093

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past


Last edited by AylinCE on Thu Mar 31, 2022 11:53 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Thu Mar 31, 2022 9:47 am    Post subject: Reply with quote

thank you for the reply AylinCE
I check both of your first links, but both of them do not explain any map editor or tileset,
this is a youtube video about tileset editor:
https://www.youtube.com/watch?v=2qKa9cXO2GE

anyway, your win-loss game is unplayable
when I open it force ask to update,
when updating the game, it CTD or closed by antivirus
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1257

PostPosted: Thu Mar 31, 2022 11:52 am    Post subject: Reply with quote

kucingkembar wrote:
thank you for the reply AylinCE
I check both of your first links, but both of them do not explain any map editor or tileset,
this is a youtube video about tileset editor:
https://www.youtube.com/watch?v=2qKa9cXO2GE


Templates (or maps) are just a tool with which you can write Lua code. Examples of this are (here) Cheat Engine and Cheat Engine Lua interpreter (Lua Script and Form designer).
In the links I gave, there are examples of game designers. By looking at them, you can edit existing codes according to your design.

kucingkembar wrote:
anyway, your win-loss game is unplayable
when I open it force ask to update,
when updating the game, it CTD or closed by antivirus


Yes this is my fault. Old codes and revamped Google Sites must have some bugs.
My "Version Check" code has been updated over time and will fix it when I have time.

All in all, these are all fun things we do with CE and Lua.
My advice is don't look for the editor here.

Or if you want to do this with CE; Start using CE Lua Script and CE Form Designer and if you get stuck with a code or design, ask here and look for solutions.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Thu Mar 31, 2022 11:34 pm    Post subject: Reply with quote

Thanks again AylinCE for the reply,
suddenly I remember the code I wrote in this forum a year ago, I edit it, and somehow I get some clue to make this program
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1257

PostPosted: Thu Mar 31, 2022 11:52 pm    Post subject: Reply with quote

I'd like to see the result when it's finished or stuck.
_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Fri Apr 01, 2022 9:17 pm    Post subject: Re: Cheat Engine Map Editor Reply with quote

kucingkembar wrote:
hi, sorry for my bad English,
I like to create a tileset map GUI editor using Cheat Engine Table Lua Script,
can someone give me a tutorial, link, guide, or (I am sorry if I am rude) the working code?
I don't need an extra-large map, 2x2 I enough


I did make like this using VB6 before.
Before continue to put some tile images on the map, the first question on my mind : if we try to make this using CE Lua script then "How to make grid map / data grid on the form?. Using paintboxs, panels, pictures, vector, etc?

I believe there are many free maps editor apps outside there.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Fri Apr 01, 2022 10:42 pm    Post subject: Reply with quote

@Corroder
I need to use the cheat engine because it edits memory as another cheat engine script does,
anyway nice to chat with you again

@AylinCE
sorry for the late reply, yesterday I have other activities
I do some code, the table is done, but as you said. it stuck,
the onMouseEnter and onMouseLeave somehow do not work,
this is the code without onMouseEnter or/and onMouseLeave:
Code:

MapTiles = {}
-- main form
if form1 then form1.Destroy() end
form1 = createForm()
form1.setSize(250, 250)
form1.Position = "poScreenCenter"

k = 0
-- 5x5 table
for i = 0 ,4, 1 do
   for j = 0 ,4, 1 do
       k = k + 1
       MapTiles[k] = createImage(form1)
       MapTiles[k].Picture.loadFromStream(findTableFile([[Block_QM.png]]).Stream)
       MapTiles[k].Height = 50
       MapTiles[k].width = 50
       MapTiles[k].top = i * MapTiles[k].Height
       MapTiles[k].left = j * MapTiles[k].width
       MapTiles[k].stretch = true
       MapTiles[k].ShowHint = true
       MapTiles[k].Hint = i + 1 .. ":" .. j + 1
   end
end
form1.Caption = k .. " tiles"


Last edited by kucingkembar on Sat Apr 02, 2022 8:15 am; edited 1 time in total
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1257

PostPosted: Sat Apr 02, 2022 6:26 am    Post subject: Reply with quote

While I don't know where the current code will lead, here is an example;
I downloaded and used "Block_QM" from the examples given above as an image.
(Check the image name.)

Code:
MapTiles = {}
-- main form
if form1 then form1.Destroy() end
form1 = createForm()
form1.setSize(250, 250)
form1.Position = "poScreenCenter"

k = 0
-- 5x5 table
for i = 0 ,4, 1 do
for j = 0 ,4, 1 do
k = k + 1
MapTiles[k] = createImage(form1)
MapTiles[k].Picture.loadFromStream(findTableFile([[block_qm_176.png]]).Stream)
MapTiles[k].Height = 50
MapTiles[k].width = 50
MapTiles[k].top = i * MapTiles[k].Height
MapTiles[k].left = j * MapTiles[k].width
MapTiles[k].stretch = true
MapTiles[k].ShowHint = true
MapTiles[k].Hint = i + 1 .. ":" .. j + 1
end
end
form1.Caption = k .. " tiles"

for i=1, tonumber(k) do
MapTiles[i].onMouseEnter=function() MapTiles[i].Picture="" end
 MapTiles[i].onMouseLeave=function()
  MapTiles[i].Picture.loadFromStream(findTableFile([[block_qm_176.png]]).Stream)
 end
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Sat Apr 02, 2022 6:47 am    Post subject: Reply with quote

AylinCE wrote:

Code:

for i=1, tonumber(k) do
MapTiles[i].onMouseEnter=function() MapTiles[i].Picture="" end
 MapTiles[i].onMouseLeave=function()
  MapTiles[i].Picture.loadFromStream(findTableFile([[block_qm_176.png]]).Stream)
 end
end


I looked at this code for 3 hours on google,
Stupid of me, I can't describe what should I type in google,
thank you thank you thank you

EDIT: I don't know why I can't post new reply
(you cannot double post yet)
I wait some hours, and still get that message, so I edit this reply of my code update

OK, this is my latest code:
Code:

-- create array for tile map
MapTiles = {}
Tiles = {"Block_empty.png","Block_QM.png","brick_surface.png","brick_under.png"}

----------------------- main form
if form1 then form1.Destroy() end
form1 = createForm()
form1.setSize(500, 250)
form1.Position = "poScreenCenter"
form1.Caption = "CE Map Editor Test"

---------------------- combo box
-- CB Tiles = Combo Box for Tiles
CBTiles = createComboBox(form1)
-- CB Items is for add now item of combo box
CBItems = combobox_getItems(CBTiles)
-- added items to combo box
for i=1, #Tiles do
    strings_add(CBItems,Tiles[i])
end
-- set Combo Box default to first items
CBTiles.setItemIndex(0)


---------------------- tile map
-- k is indexing, i for horixontal position, j for vertical one
k = 0
for i = 0 ,4, 1 do
   for j = 0 ,4, 1 do
       k = k + 1
       MapTiles[k] = createImage(form1)
       MapTiles[k].Picture.loadFromStream(findTableFile([[Block_QM.png]]).Stream)
       MapTiles[k].Height = 50
       MapTiles[k].width = 50
       MapTiles[k].top = i * MapTiles[k].Height
       MapTiles[k].left = 250 + (j * MapTiles[k].width)
       MapTiles[k].stretch = true
       MapTiles[k].ShowHint = true
       MapTiles[k].Hint = i + 1 .. ":" .. j + 1
   end
end
form1.Caption = k
-- change the tile map by click
for i=1, tonumber(k) do
    MapTiles[i].onClick=function() MapTiles[i].Picture.loadFromStream(findTableFile(Tiles[CBTiles.ItemIndex + 1]).Stream) end
end


now my problem is: how to get which "picture" on a certain tile,
for example : get picture tile at line 2 row 4
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1257

PostPosted: Sat Apr 02, 2022 12:57 pm    Post subject: Reply with quote

Here are some ideas to help make your lesson.
You can edit 3 pages at the same time using the progress bar and save the added pictures.
These lines of code will probably make your job easier.

Code:
-- create array for tile map
MapTiles = {}
Tiles = {"block_empty_912","block_qm_176","brick_surface_149","brick_under_763","--"}

----------------------- main form
if form1 then form1.Destroy() end
form1 = createForm()
form1.setSize(500, 280)
form1.Position = "poScreenCenter"
form1.Caption = "CE Map Editor Test"
form1.Popupmode=0;

backPnl1=createPanel(form1)
backPnl1.Height=250 backPnl1.width=250 backPnl1.Left=0 backPnl1.Top=0

backPnl2=createPanel(form1)
backPnl2.Height=250 backPnl2.width=1500 backPnl2.Left=250 backPnl2.Top=0

back1 = createImage(backPnl2)
back1.Picture.loadFromStream(findTableFile([[background_162.jpg]]).Stream)
back1.Height=250 back1.width=500 back1.Left=0 back1.Top=0
back1.stretch=true

back2 = createImage(backPnl2)
back2.Picture.loadFromStream(findTableFile([[background_162.jpg]]).Stream)
back2.Height=250 back2.width=500 back2.Left=500 back2.Top=0
back2.stretch=true

back3 = createImage(backPnl2)
back3.Picture.loadFromStream(findTableFile([[background_162.jpg]]).Stream)
back3.Height=250 back3.width=500 back3.Left=1000 back3.Top=0
back3.stretch=true

memo1 = createMemo(backPnl1)
memo1.Left=5 memo1.Height=180 memo1.Top=35 memo1.Width=240
memo1.Color=16776960 memo1.Enabled=true --memo1.Font.Size=9
memo1.ScrollBars=ssAutoBoth memo1.Visible=true memo1.WordWrap=false

scroll=createTrackBar(form1)
scroll.Height=25 scroll.width=500 scroll.Left=5 scroll.Top=253
scroll.LineSize=5 scroll.Max=1000 scroll.Min=0
scroll.Position=0
scroll.OnChange=function()
backPnl2.SendToBack() backPnl1.BringToFront()
backPnl2.Left=250 - scroll.Position
end
---------------------- combo box
-- CB Tiles = Combo Box for Tiles
CBTiles = createComboBox(backPnl1)
CBTiles.Width=150
-- CB Items is for add now item of combo box
CBItems = combobox_getItems(CBTiles)
-- added items to combo box
for i=1, #Tiles do
    strings_add(CBItems,Tiles[i])
end
-- set Combo Box default to first items
CBTiles.setItemIndex(0)


---------------------- tile map
-- k is indexing, i for horixontal position, j for vertical one
k = 0
for i = 0 ,8, 1 do
   for j = 0 ,59, 1 do
       k = k + 1
       MapTiles[k] = createImage(backPnl2)
       MapTiles[k].Picture="" --.loadFromStream(findTableFile([[block_qm_176.png]]).Stream)
       MapTiles[k].Height = 25
       MapTiles[k].width = 25
       MapTiles[k].top = i * MapTiles[k].Height
       MapTiles[k].left = 0 + (j * MapTiles[k].width)
       MapTiles[k].stretch = true
       MapTiles[k].ShowHint = true
       MapTiles[k].Hint = i + 1 .. ":" .. j + 1
       MapTiles[k].Cursor= -21 --click test
       MapTiles[k].BringToFront()
   end
end
form1.Caption = k
-- change the tile map by click

function savePict(opsion,name,x,y,ht,wd,pic)
 --clear pic:
 newTbl={}
 if opsion==1 then
  sl=createStringList()
  sl.Text=memo1.Lines.Text
  find=sl.Count -1
   for i=0, sl.Count -1 do
    aa=sl[i]:match("(.-)=create")
     if aa~=name then
      newTbl[i+1]=sl[i]
     end
     if i==find then
      sl=nil
      memo1.Lines.Text=""
      for i,k in pairs(newTbl) do
       memo1.Lines.Add(k)
      end
     end
    end
   end
 if opsion==2 then
  aa2=name.."=createImage(form22) "..name..".Height="..ht.." "..name..".width="..wd.." "..name..".Left="..x.." "..name..".Top="..y.." "..name..".stretch=true "..name..".picture.loadFromStream(findTableFile("..pic..").Stream)"
  memo1.Lines.Add(aa2)
 end
end

for i=1, tonumber(k) do
  local name="pic"..i
  local pictr=CBTiles.Text .. ".png"
    MapTiles[i].onClick=function()
     if CBTiles.Text=="--" then
      MapTiles[i].Picture=""
      savePict(1,name,"","","","","")
      else
      MapTiles[i].Picture.loadFromStream(findTableFile(CBTiles.Text .. ".png").Stream)
      print(name)
      savePict(2,name,MapTiles[i].Left,MapTiles[i].Top,MapTiles[i].Height,MapTiles[i].width,pictr)
      end
    end
end



Ek1.PNG
 Description:
 Filesize:  92.07 KB
 Viewed:  2070 Time(s)

Ek1.PNG



_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Sat Apr 02, 2022 1:37 pm    Post subject: Reply with quote

thank you again AylinCE for the reply
I expect there is a command like: pictureimages.Picture.LoadedPictureName
but your code is better,
and the scroll code is very nice too,

I think the core code is done, Now I will do the memory editing and Some GUI interface layout

thank you again, your Code Really Help me,
keep healthy and have a nice day
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites