The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: foadbot on July 31, 2008, 02:18:56 AM

Title: [Request] - More descrptive / random battle messages
Post by: foadbot on July 31, 2008, 02:18:56 AM
descriptive battle messages
7/30/08




Summary
A script that enables more descriptive damage messages based on the amount of damage an actor or enemy has taken
Looking for something more descriptive than "ActorDamage     = "%s took %s damage!"" and have the ability to add more than one description when someone / something takes damage

A script that can randomly pick from several options like the examples below
"%s took %s damage!"
"%s was stabbed for %s damage!"
"%s was bludgeoned for %s damage!"
"%s face was smashed in for %s damage!"
"%s screams in horror as they are pulverized for %s damage!"

edit - descriptions would be based on the weapon type being used

knife - stab / cut
hammer - crushed / bludgeoned
axe - chopped / cleaved

and so on...


Features Desired

Mockups
none

Games its been in




Did you search?
Yes

Where did you search?

What did you search for?

If anyone can help with this or provide any hints about how to accomplish this, it would be appreciated!
Title: Re: [Request] - More descrptive / random battle messages
Post by: modern algebra on July 31, 2008, 03:02:20 AM
Would you really want it to be randomly picked? It'd be weird to swing an axe or something and have it say bludgeoned.
Title: Re: [Request] - More descrptive / random battle messages
Post by: Leventhan on July 31, 2008, 03:07:34 AM
Would be useful for roguelikes and text-based games.
Title: Re: [Request] - More descrptive / random battle messages
Post by: Arclight on July 31, 2008, 05:46:13 AM
About

     This is my first script edit so its not a complete copy/paste type script.  (yet)  Right now its more of a
     mini-tutorial.

     What game variables does this works on? Basicly you can use the method below for any regular combat
     message plus some non-combat messages. It does not work on skill or item messages yet. I'll find an edit
     for that too but probably several days down the road.

     Thanks for the idea though... i was wanting something like this to hack on for awhile. :)

How to edit the script

     So here is what you do:

1. Goto Tools Menu > Script Editor > Vocab > Line 29. Looks like this:

     Emerge          = "%s emerged!

2. Change that line to:

     Emerge = ["%s emerged!",
                      "%s appeared!",
                      "%s is in your face!"]

3. Remember the number of items in the list. in this example there are 3.

4. Right Click and do a 'Find' on 'Emerge'

5. There will be two items in the list. The first is the 'variable' you just edited and the second is the 'function'
     that uses that variable. Double Click Scene_Battle (532):

6. Edit line 532 of Scene_Battle from

      text = sprintf(Vocab::Emerge, name)

to

      text = sprintf(Vocab::Emerge[rand(3)], name)

So rand(3) got added, this stands for, random integer between 1 and the number you put. no zero.


Hope this did the trick... i may add notes to this after awhile but... if anyone else wants to take a better crack at it don't wait for me.  o.-


::: side note, i'll probably move my post here to its own page in a few days :::
Title: Re: [Request] - More descrptive / random battle messages
Post by: modern algebra on July 31, 2008, 06:37:33 PM
So, not really random at all, or do you want to have a number of phrases for each weapon type.

I think arclight has some good ideas for this script anyway, so I'll let him at it.

And... don't double post. Or triple post for that matter. Edit your posts instead.
Title: Re: [Request] - More descrptive / random battle messages
Post by: foadbot on July 31, 2008, 07:17:37 PM
Quote from: modern algebra on July 31, 2008, 06:37:33 PM
So, not really random at all, or do you want to have a number of phrases for each weapon type.

I think arclight has some good ideas for this script anyway, so I'll let him at it.

And... don't double post. Or triple post for that matter. Edit your posts instead.

Will do, sorry
Title: Re: [Request] - More descrptive / random battle messages
Post by: foadbot on August 01, 2008, 12:35:35 AM
Ok, so i tried adding 3 different damage descriptions that to Actordamage in VOCAB and then adding [rand(3)] to scene_battle

text = sprintf(Vocab::ActorDamage[rand(3)], target.name, target.hp_damage)

when I initiate a battle, as soon as it is supposed to report damage it crashes with

Script 'Scene_Battle' line 1066: TypeError Occured.

cannot convert Fixnum into String


Any ideas?


edit: Ugh i forgot to put a comma after each of the descriptions. Now working, thanks!
Title: Re: [Request] - More descrptive / random battle messages
Post by: Arclight on August 07, 2008, 06:35:10 AM
Topic Moved

http://rmrk.net/index.php/topic,28810.0.html