Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 156 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
iqbal_0k
  Fri Jul 25, 2008 9:27 am
User avatar
Member

Location: Front of your monitor
oh thank you very much seph, i'll credit you in my project


Top Top
 Profile  
 

rey meustrus
  Fri Jul 25, 2008 11:02 pm
Master of Dark Magic
User avatar
Sponsor
Somehow I get the feeling he should have been credited already for authoring MACL, along with all the other contributors?  But that's not why I'm here...

I was just thinking about splitting up MACL into its many parts.  If it's a scripting tool, and most people get scripts by downloading demos and taking the scripts out of them, surely the authors of scripts must be capable of installing only the parts they need, putting them in the demo, and instructing their users to copy all of the scripts in the demo including the specific parts of MACL that they included?  Maybe this has been discussed or thought about before, and decided against because it apparently didn't work too well for the SDK, but the MACL is just so much damn bigger than SDK.

_________________
Image


Top Top
 Profile  
 

SephirothSpawn
  Sat Jul 26, 2008 5:29 am
Support/RGSS Bitch
User avatar
Retired Staff

Location: Kansas City, Mo
I am actually working on a tool for this. I may include it in next month's update if I finish it.

Basically, you put each script you have in your project into a txt file when your game is done. Then it reads through your scripts, checks method and class names. Whatever isn't used is deleted, and after running a module method, it creates a new MACL.txt file that you can replace with your MACL script.

I am still working out some kinks on it, but if all goes well, it'll be in the next edition. :)

_________________
I want to review your script!
I am always looking for scripts to look over and offer my advice on people's coding. If you want your script reviewed and to further develop your scripting skills, just put a [Review] tag in your topic. I will always post in any scripting topic marked [Review] offering whatever advice I can give.

Image


Top Top
 Profile  
 

rey meustrus
  Sat Jul 26, 2008 6:14 am
Master of Dark Magic
User avatar
Sponsor
That sounds quite awesome.  You obviously beat me to it :)

_________________
Image


Top Top
 Profile  
 

SephirothSpawn
  Sat Jul 26, 2008 7:35 am
Support/RGSS Bitch
User avatar
Retired Staff

Location: Kansas City, Mo
When I noticed we had 16,000 lines and it took a little while longer than normal to load because of it (might just be my slow computer), I knew I had to do something.

_________________
I want to review your script!
I am always looking for scripts to look over and offer my advice on people's coding. If you want your script reviewed and to further develop your scripting skills, just put a [Review] tag in your topic. I will always post in any scripting topic marked [Review] offering whatever advice I can give.

Image


Top Top
 Profile  
 

iqbal_0k
  Sat Jul 26, 2008 9:29 am
User avatar
Member

Location: Front of your monitor
mewsterus wrote:
Somehow I get the feeling he should have been credited already for authoring MACL, along with all the other contributors?  But that's not why I'm here...

No, i'am not used a whole script it depend on users use it or no,t i'am including tricster method (Flip_Horizontal). i know i'am not good speaking english lol, but i know the rules of crediting and i'am crediting seph and tricks for their efforts


Last edited by iqbal_0k on Sat Jul 26, 2008 9:33 am, edited 1 time in total.

Top Top
 Profile  
 

Kain Nobel
  Thu Jul 31, 2008 10:09 am
No Rest for the Wicked!
User avatar
Member

Location: #hbgames
I've got the whole MACL and 45 of my own scripts in my project and don't suffer from too much lag, except sometimes during $scene changes (although there is one compatibility error I haven't hunted down yet). However, dividing it up into its own library and calling sections with a require would probably be alot nicer.

I've added some methods to my copy of the MACL, you might want to add these in for everybody. They're simple little methods, but they do make life a little easier. I've got 4 simple additions, enjoy :thumb:

MACL Section : RGSS.Map

[code=$game_map.this_event]
  #-----------------------------------------------------------------------------
  # * Name      : This Event
  #   Info      : Simply returns event on, or event directly in front of you
  #   Author    : Kain Nobel
  #   Call Info : None
  #-----------------------------------------------------------------------------
  def this_event
    x, y, d = $game_player.x, $game_player.y, $game_player.direction
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    for event in @events.values
      return event.id if event.x == x     && event.y == y
      return event.id if event.x == new_x && event.y == new_y
    end
  end[/code]

[code=$game_map.last_event]
  #-------------------------------------------------------------------------
  # * Name      : Last event
  #   Info      : Simply returns the last event in $game_map.events array
  #   Author    : Kain Nobel
  #   Call Info : None
  #-------------------------------------------------------------------------
  def last_event
    return @events[-1].id unless @events.empty?
  end[/code]

[code=$game_map.event_count]
  #-------------------------------------------------------------------------
  # * Name      : Event Count
  #   Info      : Simply counts how many events are on the $game_map
  #   Author    : Kain Nobel
  #   Call Info : None
  #-------------------------------------------------------------------------
  def event_count
    return @events.empty? ? 0 : @events.size
  end[/code]

MACL Section : Event_Spawner

And for the event spawner, I made a quick shortcut command to do call scripts. Instead of typing in...

Expand to see the code.


You just type...

Expand to see the code.


[code=Call Script]
  #--------------------------------------------------------------------------
  # * Add Call Script
  #--------------------------------------------------------------------------
  def self.call_script(parameters = [], indent = 0)
    # Creates New Event Command
    event_command = RPG::EventCommand.new
    # Sets code, Parameters & Indent
    event_command.code = 355
    event_command.parameters = parameters
    event_command.indent = indent
    # Adds Call Script to page list
    self.get_current_page.list.insert(-2, event_command)
  end[/code]

As silly as it sounds, I want you to create an MInterpreter.call_script() for me, I really do need it for a user-defined module in my Vehicle system. I don't know how the Interpreter handles call script strings and converts them into actual code and evaluates them and all that, so I figured I'd just ask you to do it.

_________________

You can find any scripts I've submitted within the past year upto the date specified above. If you happen to find something else that is either not on the list or just doesn't have a URL that I had posted officially or otherwise, please PM me the link and I'll be sure to add it to the list.


Last edited by Kain Nobel on Thu Jul 31, 2008 10:15 am, edited 1 time in total.

Top Top
 Profile  
 

SephirothSpawn
  Thu Jul 31, 2008 6:54 pm
Support/RGSS Bitch
User avatar
Retired Staff

Location: Kansas City, Mo
Ha. I beat ya to the this_event function a few days ago. But Instead I have
tile_front
tile_right
tile_left
tile_behind
event_front
event_right
event_left
event_behind

Great minds think alike I guess.

Your last_event methods is flawed. @events is a Hash, not an array. Not only that, it is going to return the same thing as your event_count. I'll put the event_count function in there though.

Ok. I guess I can go with both of your call_script suggestions.

_________________
I want to review your script!
I am always looking for scripts to look over and offer my advice on people's coding. If you want your script reviewed and to further develop your scripting skills, just put a [Review] tag in your topic. I will always post in any scripting topic marked [Review] offering whatever advice I can give.

Image


Top Top
 Profile  
 

rey meustrus
  Fri Aug 08, 2008 3:18 am
Master of Dark Magic
User avatar
Sponsor
I just noticed something...in the Screenshot module, it references a need for Screenshot.dll.  Since it doesn't seem to be named as a Windows registered library, I assume it's something I need to download, but there isn't a demo and I can't seem to find the file.

EDIT: Something I just thought of that would be interesting is a sort of checksum for save files and data files to assure they aren't hacked.  The files themselves would store a set of indeces (or a certain external checksum file would hold indeces for all the data files) that aren't in themselves checksums.  They would index a table of possible checksums, the values distributed randomly, like a random number table.  Each one would take certain specific bits from the file to compile a checksum instead of the entire file.  There are probably better ways to do it, as I've never put together any sort of data integrity algorithms before, but this is just my idea for the time being...stop me if somebody's already written something for this purpose...

EDIT2: And I figured out why my player sprite was not displaying correctly.  It had nothing to do with pixel movement.  It was because some modifications I've been making to Game_Battler have resulted in the player erroneously being .dead? and the recent Game_Character modifications in MACL used that to remove the player sprite.  This was all going wrong not because the player was actually dead, but because I used a '=' accidentally instead of a '==' 0_0

_________________
Image


Last edited by rey meustrus on Fri Aug 08, 2008 9:23 pm, edited 1 time in total.

Top Top
 Profile  
 

Charlie Fleed
  Sun Aug 10, 2008 2:33 pm
Survivor of Planet Fleed
User avatar
Member

Location: Italy
Today I got the idea of shortcuts for the command window. I don't know if there is anything like that already in the MACL.
Basically you can set two commands to be the shortcuts when you press the LEFT and RIGHT key (you usually have only one column, so they are unused). Here is how i implemented this. Feel free to revise the code if necessary and include it if you like the idea.

The class is Window_Command.
Changes to existing code:
Expand to see the code.

New methods:
Expand to see the code.

_________________
Image Image Image Image Image Image


Last edited by Anonymous on Sun Aug 10, 2008 4:56 pm, edited 1 time in total.

Top Top
 Profile  
 

Kain Nobel
  Sun Aug 10, 2008 4:05 pm
No Rest for the Wicked!
User avatar
Member

Location: #hbgames
What exactly is that supposed to do, Charlie Lee?

_________________

You can find any scripts I've submitted within the past year upto the date specified above. If you happen to find something else that is either not on the list or just doesn't have a URL that I had posted officially or otherwise, please PM me the link and I'll be sure to add it to the list.


Top Top
 Profile  
 

Charlie Fleed
  Sun Aug 10, 2008 4:27 pm
Survivor of Planet Fleed
User avatar
Member

Location: Italy
I'll be more clear: you usually have a window with a list of commands and browse through the list with UP and DOWN. With this add-on you can set two commands to be selected with RIGHT and LEFT, respectively. Say, you press LEFT and the cursor moves directly to the specified command.

I use this in my CTB in such a way that LEFT automatically selects the Guard/Defend command:
Expand to see the code.

_________________
Image Image Image Image Image Image


Last edited by Anonymous on Sun Aug 10, 2008 4:29 pm, edited 1 time in total.

Top Top
 Profile  
 

rey meustrus
  Sun Aug 10, 2008 4:50 pm
Master of Dark Magic
User avatar
Sponsor
I would think that Window_Command.update would be better served by having the super at the end of your additions.  Then you wouldn't have to update_help and update_cursor_rect (which ends up calling them twice!).  The right and left commands in Window_Selectable only work if @column_max >= 2 anyway.

_________________
Image


Top Top
 Profile  
 

Charlie Fleed
  Sun Aug 10, 2008 5:01 pm
Survivor of Planet Fleed
User avatar
Member

Location: Italy
I agree. Updated. (EDIT: ah, my copy and paste fever...  :tongue2:)
The user is supposed to use this feature with 1-column command windows only. Otherwise I could put the code in the update method inside an "if @column_max==1" block.

_________________
Image Image Image Image Image Image


Last edited by Anonymous on Mon Aug 11, 2008 9:37 pm, edited 1 time in total.

Top Top
 Profile  
 

rey meustrus
  Sun Aug 10, 2008 9:20 pm
Master of Dark Magic
User avatar
Sponsor
Since Window_Command is basically hard coded as a 1-column window, that doesn't seem very necessary.

_________________
Image


Top Top
 Profile  
 

Kain Nobel
  Wed Aug 13, 2008 5:23 pm
No Rest for the Wicked!
User avatar
Member

Location: #hbgames
That and you have Window_HorizCommand too, but thats another story.

I do see what you're saying now though, I was thinking of adding a columns thing to my Window_Commands too, but they'd be slidable columns, where the one command slides off and the other command slides in when you push Right/Left (while the other commands remain where they are.) If thats what you're talking about, and you're doing it, keep doing it, we could use it if it turns out good.

Here is my contributions for the day...

RGSS.Window Quick Positions - Quick FAQ


RGSS.Window Quick Positions - Script


RGSS.Window Quick Positions - Example Screenshot


RGSS.Window Quick Positions - Test


RGSS.Party $game_party.gain_all(type, quantity) - Scriptlet


RGSS.Party $game_party.gain_all(type, quantity) - Quick FAQ


RGSS.Map $game_map.exists?(id)


RGSS.Map $game_map.map_name(-id) - Snippet


I made these simple additions for fun, hopefully you'll find them useful! :thumb:

_________________

You can find any scripts I've submitted within the past year upto the date specified above. If you happen to find something else that is either not on the list or just doesn't have a URL that I had posted officially or otherwise, please PM me the link and I'll be sure to add it to the list.


Last edited by Kain Nobel on Thu Aug 14, 2008 1:50 pm, edited 1 time in total.

Top Top
 Profile  
 

rey meustrus
  Thu Aug 14, 2008 9:15 pm
Master of Dark Magic
User avatar
Sponsor
It's possible to write your gain_all and lose_all functions so much more simply using Ruby's syntax.  For example, instead of writing:
Expand to see the code.

You could write:
Expand to see the code.

Instead of:
Expand to see the code.

You could write:
Expand to see the code.


Aside from that, I'd say the lose_all function could be pretty useful, especially if it could store the items that you lost in an array and return them to the party later.

_________________
Image


Top Top
 Profile  
 

hanmac
  Fri Aug 15, 2008 7:46 am
Member
better than
Expand to see the code.

could be
Expand to see the code.


Expand to see the code.


better and faster:
Expand to see the code.


info: it exist a string iternal for 3 length

_________________
every thing is true, if true has a specific value.


Last edited by hanmac on Fri Aug 15, 2008 7:52 am, edited 1 time in total.

Top Top
 Profile  
 

rey meustrus
  Sat Aug 16, 2008 8:02 pm
Master of Dark Magic
User avatar
Sponsor
That's even better.  I'm just excited about using .each do statements myself, since I've only started working with them in my recent bout of scripting ;)

_________________
Image


Top Top
 Profile  
 

Kain Nobel
  Sun Aug 17, 2008 3:45 pm
No Rest for the Wicked!
User avatar
Member

Location: #hbgames
Glad to see everybody teaming together to clean up my code!

I noticed you changed...
[code=Old Code]@map_name = load_data("Data/MapInfos.rxdata") [/code]
to...
[code=New Code]@map_name ||= load_data("Data/MapInfos.rxdata") [/code]
What is that supposed to do? o.O

Here, I updated RGSS.Party with your suggestions, and added something for easily obtaining any average stat from the game party's actors. Here's a simple example.

Expand to see the code.



RGSS.Party - Quick Update


Please note, at least one of the letters in the string must be a cap when calling the arg though, or it'll return 0.

$game_party.average('SP') #=> 1442
$game_party.average('Sp') #=> 1442
$game_party.average('sp') #=> 0

_________________

You can find any scripts I've submitted within the past year upto the date specified above. If you happen to find something else that is either not on the list or just doesn't have a URL that I had posted officially or otherwise, please PM me the link and I'll be sure to add it to the list.


Last edited by Kain Nobel on Sun Aug 17, 2008 4:12 pm, edited 1 time in total.

Top Top
 Profile  
 

Yeyinde
  Sun Aug 17, 2008 4:02 pm
Rubber Shark
User avatar
Sponsor

Location: Beautiful British Columbia
||= means it will only set the variable if the variable returns false or nil.

_________________
Squeak!


Top Top
 Profile  
 

Kain Nobel
  Sun Aug 17, 2008 4:35 pm
No Rest for the Wicked!
User avatar
Member

Location: #hbgames
Then its not needed, because map name is supposed to be a string. Thanks for clearing that up.

_________________

You can find any scripts I've submitted within the past year upto the date specified above. If you happen to find something else that is either not on the list or just doesn't have a URL that I had posted officially or otherwise, please PM me the link and I'll be sure to add it to the list.


Top Top
 Profile  
 

rey meustrus
  Mon Aug 18, 2008 4:57 am
Master of Dark Magic
User avatar
Sponsor
You'll also notice that he changed the variable name to @map_info.  That would be a proper name for the variable, as it is not indeed a string but an RPG::MapInfo object, for which @map_info[id].name is a String.  As the data only needs to be loaded once, loading it every time you call the name function is resource intensive.

_________________
Image


Top Top
 Profile  
 

Kain Nobel
  Fri Aug 29, 2008 5:36 pm
No Rest for the Wicked!
User avatar
Member

Location: #hbgames
Some advanced stuff for people who use a 8 direction movement script, or who want to make scripts based off 8 directional movement. Also, I added $game_map.no_tile?(x, y) which checks if tile on layer 1, 2, 3 are all tile id 0.

Also (I did this specifically for my jump script so you can't jump into the background), I aliased Game_Character passable? so that you can't move through a spot in which there is absolutely no tile in place. This is optional, feel free to remove it if you want. Besides, something about being able to normally walk on 'blank' tiles always bugged me, thats why I did it damnit!

Content Hidden

_________________

You can find any scripts I've submitted within the past year upto the date specified above. If you happen to find something else that is either not on the list or just doesn't have a URL that I had posted officially or otherwise, please PM me the link and I'll be sure to add it to the list.


Last edited by Kain Nobel on Sat Aug 30, 2008 7:54 pm, edited 1 time in total.

Top Top
 Profile  
 

SephirothSpawn
  Wed Sep 03, 2008 1:51 am
Support/RGSS Bitch
User avatar
Retired Staff

Location: Kansas City, Mo
Sorry about my absence guys. Life just has been busy. Anyways, I will be working on this for the next few days and getting it updated by friday or saturday.

Quote:
I just noticed something...in the Screenshot module, it references a need for Screenshot.dll.  Since it doesn't seem to be named as a Windows registered library, I assume it's something I need to download, but there isn't a demo and I can't seem to find the file.

EDIT: Something I just thought of that would be interesting is a sort of checksum for save files and data files to assure they aren't hacked.  The files themselves would store a set of indeces (or a certain external checksum file would hold indeces for all the data files) that aren't in themselves checksums.  They would index a table of possible checksums, the values distributed randomly, like a random number table.  Each one would take certain specific bits from the file to compile a checksum instead of the entire file.  There are probably better ways to do it, as I've never put together any sort of data integrity algorithms before, but this is just my idea for the time being...stop me if somebody's already written something for this purpose...

EDIT2: And I figured out why my player sprite was not displaying correctly.  It had nothing to do with pixel movement.  It was because some modifications I've been making to Game_Battler have resulted in the player erroneously being .dead? and the recent Game_Character modifications in MACL used that to remove the player sprite.  This was all going wrong not because the player was actually dead, but because I used a '=' accidentally instead of a '==' 0_0

Yeah, I forgot to include the screenshot.dll. I'll add that in the next update. Nice idea for the checksum. I'll do some research and see if I can't throw something in the update. What exactly was the problem with the MACL and your script?

@Charlie Lee: Not a bad idea. I might modify that to make it more dynamic and customizable.
Expand to see the code.


How's that work?

@Kain Nobel: I'll take a look at those methods and add them in (I may modify them slightly to make them more efficient and customizable, like I do everything lol).

_________________
I want to review your script!
I am always looking for scripts to look over and offer my advice on people's coding. If you want your script reviewed and to further develop your scripting skills, just put a [Review] tag in your topic. I will always post in any scripting topic marked [Review] offering whatever advice I can give.

Image


Top Top
 Profile  
 

rey meustrus
  Wed Sep 03, 2008 5:55 pm
Master of Dark Magic
User avatar
Sponsor
The "problem" I had with MACL was that it now contains a script that attaches a battler to Game_Player, and it removes the sprite if battler.dead? The real problem was that when I rewrote the dead? method (to use my four hp values instead of the one), one of the expressions used a "var = 0" instead of a "var == 0".  Entirely my fault.

_________________
Image


Top Top
 Profile  
 

SephirothSpawn
  Thu Sep 04, 2008 2:03 am
Support/RGSS Bitch
User avatar
Retired Staff

Location: Kansas City, Mo
Ok. And yeah, I added the battler method there to make ABS and other systems similar simpler.

_________________
I want to review your script!
I am always looking for scripts to look over and offer my advice on people's coding. If you want your script reviewed and to further develop your scripting skills, just put a [Review] tag in your topic. I will always post in any scripting topic marked [Review] offering whatever advice I can give.

Image


Top Top
 Profile  
 

rey meustrus
  Tue Sep 09, 2008 12:26 am
Master of Dark Magic
User avatar
Sponsor
It's all good.  Interestingly enough, I attached a @battler to Game_Character in my own project too.  It's defined by Game_Player.setup_battler and Game_Event.setup_battler, while that method is not in Game_Character.  I'm sure you've done more on that than I have yet...

_________________
Image


Top Top
 Profile  
 

SephirothSpawn
  Tue Sep 09, 2008 7:20 am
Support/RGSS Bitch
User avatar
Retired Staff

Location: Kansas City, Mo
I didn't bother with a method to setup the battler. Care to share yours?

I did however change something that was slowing down everything drastically. I left a debug tool in there, that runs the refresh method every frame, vs. when the battler changes. It now only updates when the battler dies or changes. (Making a special battler= method, vs. attr_writer: battler).

_________________
I want to review your script!
I am always looking for scripts to look over and offer my advice on people's coding. If you want your script reviewed and to further develop your scripting skills, just put a [Review] tag in your topic. I will always post in any scripting topic marked [Review] offering whatever advice I can give.

Image


Top Top
 Profile  
 

Kain Nobel
  Tue Sep 09, 2008 6:04 pm
No Rest for the Wicked!
User avatar
Member

Location: #hbgames
Remember that weird error about the 'each' thing I kept getting? After simply deleting the last script, I found that was the culprit of the error. You should check that script over, its probably an easy fix I'm just too lazy to fix it. (It was the 'System.Window Sprites' or something of that nature)

Also, I tried replacing my personal Window move methods simply with the Moveable module, but it seems everytime a window reaches its destination, I get an error. Whats wrong with it?

Expand to see the code.


Not sure what's going on there, but you should look into that too before you release the next version if you haven't fixed them already.

SephirothSpawn wrote:
I did however change something that was slowing down everything drastically. I left a debug tool in there, that runs the refresh method every frame, vs. when the battler changes. It now only updates when the battler dies or changes. (Making a special battler= method, vs. attr_writer: battler).


Which script is causing the lag? I wanna delete it from my project until the next update.

_________________

You can find any scripts I've submitted within the past year upto the date specified above. If you happen to find something else that is either not on the list or just doesn't have a URL that I had posted officially or otherwise, please PM me the link and I'll be sure to add it to the list.


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


Who is online

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

Jump to:  
cron

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Hosted By: