Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 7 posts ] 
    Tigir:Er
  Thu Dec 08, 2016 11:29 am
Member

Sewer Rat
Ummmm.... hello, Im new here.
I've a Mining script from an unkown author. But its scripted very Very VERY poorly.
It allowes to create a mining scenario. You can give certain events a mining tag via names like mine2 and assign them with items that can be farmed.
When our hero mines a picture will appear that displays as a background. (line 123 bitmap = RPG::Cache.picture("MiningBackground"))
The problem is, that the background picture is only determinable once and for all, so it will be displayed for all locations. But my locations look differnt of course. LOL.
However, I want the background picture to be able to be determined several times. I want to assign different MiningBackGround locations for different locations.
If its up to me. I would bound the MiningBackGround picture to the map id of the mapss. But I dont know how

Expand to see the code.


Last edited by Tigir:Er on Wed Dec 21, 2016 6:58 pm, edited 1 time in total.

Top Top
Profile      
 

    Tigir:Er
  Wed Dec 21, 2016 6:54 pm
Member

Sewer Rat
Bump


Top Top
Profile      
 

    Ellie
  Wed Dec 21, 2016 11:10 pm
User avatar
Staff

Omnipresent Merchant
change:

bitmap = RPG::Cache.picture("MiningBackground"))

to

bitmap = RPG::Cache.picture("MiningBackground_" + $game_map.map_id))

I think that should work. Then save your pictures as MiningBackground_1, MiningBackground_2, etc.


Top Top
Profile      
 

    Tigir:Er
  Thu Dec 22, 2016 6:50 am
Member

Sewer Rat
If I do exactly as you say, I get a Synthax Error just when I try to start the game on line 123.
However, in your version above I think you have put too many "(" because you have 2 of them, in the script its only 1. I mean on the end.
So I've also tried using bitmap = RPG::Cache.picture("MiningBackground_" + $game_map.map_id)
but when I try to mine with that I get a error on the same line (123( with the message being cannot convert fixnum into string.
Both dont work. Btw. I think the "+" in your code should not have a space before it. But im not sure.
Still, thanks for replying.


Top Top
Profile      
 

    Ellie
  Thu Dec 22, 2016 4:20 pm
User avatar
Staff

Omnipresent Merchant
Sorry. Try

bitmap = RPG::Cache.picture("MiningBackground_" + $game_map.map_id.to_s)


Top Top
Profile      
 

    Tigir:Er
  Thu Dec 22, 2016 6:37 pm
Member

Sewer Rat
Worked, but I've a question left.
Can you tell me how the item assignment for the each mining levels work? I really dont know how to it. Its not explained very well.


Expand to see the code.


This is the assignment code, but I really dont know how it works.
And the number 149 you can see is just a I tem that I chose.
Thanks btw.


Top Top
Profile      
 

    Ellie
  Fri Dec 23, 2016 12:03 am
User avatar
Staff

Omnipresent Merchant
Hmm, it looks like you fill it with the items that you should be able to mine when you are that mining level, and they can be duplicated.

So,

@items = [[0, 0, 0], # this is level 1
#Level one mines have a 5/8 chance of getting item id 1, 2/8 for item id 2, and 1/8 for item id 3
[0, 0, 0], # this is level 2
[0, 0, 0], # this is level 3
[0, 0, 0], # this is level 4
[0, 0, 0], # this is level 5
[0, 0, 0]] # this is level 6


In each of those blocks, [0, 0, 0], you put the items you can mine at that level.

So let's say gold is really rare, coal is uncommon, and stone is really common. If gold is item 1, coal is item 2, and stone is item 3, you would do:

[1, 2, 2, 2, 3, 3, 3, 3, 3, 3]


That would make you have a good chance of getting 3, a smaller chance of getting 2, and a really rare chance of getting 1.


I think.


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


Who is online

Users browsing this forum: No 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

cron
We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group