I have working in it 1hour, but the idea maybe isnt that bad. Im trying to create some sort of scripting 'language' for the call script command that maks the things more easy and quick. For that i plan to use:
-Use of sortcuts to the game information
-Use of event commands with scripts
-Create new functions for this system
Im posting this for feedback from scripters.,ideas,wrong,bad,utopia,etc. Anyway is fun.
We can make everything, and its very quick to do. Here a example:
def cure_all
for actor in $game_party.actors
actor.recover_all
end
end
This is the easy way of doing it.
def cure(id=0)
if id == 0
for actor in $game_party.actors
actor.recover_all
end
else
$game_actors[id].recover_all
end
end
I think that knowing that all database ids start with 1, will be nice to treat a 0 like a "for all". And maybe make this the default values.
Also i think that will be nice to make that each method have a shorter one:
cure- c o cu
cure_all -cu_a
def gold=(value)
$game_party.gold += value
end
def gold
return $game_party.gold
end
Maybe when setting variables values we can make that a value of 0 sets it to 0. If not, to reduce the gold to 0 you have to call gold=-99999.
Another idea is if the use of = in method names is correct or not. Its more slow,that for sure.
A example call script.
gold=500 # This add 500 gold
(a 1).name = 'Wilfred' # (a 1) is like $game_actors[1]
for a in actors # actors is an alias of $game_party.actors
a.hp+=20
end
get_number(1) # This is like a input number command.
In the same way that cure and cure all:
def hp_mod(hp, id=0)
if id == 0
for actor in $game_party.actors
actor+=hp
end
else
$game_actors[id]+=hp
end
end
That can be aliased like mhp or hp. The problem here may be if you want
to make that trully all actors get the bonus. Maybe make that with a id=-1?
Also a nice idea for ids arguments will be to be arrays...
-Use of sortcuts to the game information
-Use of event commands with scripts
-Create new functions for this system
Im posting this for feedback from scripters.,ideas,wrong,bad,utopia,etc. Anyway is fun.
We can make everything, and its very quick to do. Here a example:
def cure_all
for actor in $game_party.actors
actor.recover_all
end
end
This is the easy way of doing it.
def cure(id=0)
if id == 0
for actor in $game_party.actors
actor.recover_all
end
else
$game_actors[id].recover_all
end
end
I think that knowing that all database ids start with 1, will be nice to treat a 0 like a "for all". And maybe make this the default values.
Also i think that will be nice to make that each method have a shorter one:
cure- c o cu
cure_all -cu_a
def gold=(value)
$game_party.gold += value
end
def gold
return $game_party.gold
end
Maybe when setting variables values we can make that a value of 0 sets it to 0. If not, to reduce the gold to 0 you have to call gold=-99999.
Another idea is if the use of = in method names is correct or not. Its more slow,that for sure.
A example call script.
gold=500 # This add 500 gold
(a 1).name = 'Wilfred' # (a 1) is like $game_actors[1]
for a in actors # actors is an alias of $game_party.actors
a.hp+=20
end
get_number(1) # This is like a input number command.
In the same way that cure and cure all:
def hp_mod(hp, id=0)
if id == 0
for actor in $game_party.actors
actor+=hp
end
else
$game_actors[id]+=hp
end
end
That can be aliased like mhp or hp. The problem here may be if you want
to make that trully all actors get the bonus. Maybe make that with a id=-1?
Also a nice idea for ids arguments will be to be arrays...
Code:
class Interpreter
def gold=(value)
$game_party.gold += value
end
def gold
return $game_party.gold
end
def g(value)
$game_party.gold += value
end
def vg
return $game_party.gold
end
def actor(id)
return $game_actors[id]
end
def a(id)
return $game_actors[id]
end
def actors
return $game_actors.party.actors
end
def as(id)
return $game_actors.party.actors
end
def steps
return $game_actors.party.steps
end
def st
return $game_actors.party.steps
end
def cure_all
for actor in $game_party.actors
actor.recover_all
end
end
def cure(id=0)
if id == 0
for actor in $game_party.actors
actor.recover_all
end
else
$game_actors[id].recover_all
end
end
def variable(id)
return $game_variables[id]
end
def v(id)
return $game_variables[id]
end
def switch(id)
return $game_switches[id]
end
def sw(id)
return $game_switches[id]
end
def get_number(variable, digits=2)
@parameters[0] = variable
@parameters[1] = digits
command_103
end
def gnum(variable, digits=2)
@parameters[0] = variable
@parameters[1] = digits
command_103
end
def wait(frames)
@wait_count = frames * 2
command_106
end
def hp_mod(hp, id=0)
if id == 0
for actor in $game_party.actors
actor+=hp
end
else
$game_actors[id]+=hp
end
end
end
class Game_Party
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :actors # actors
attr_accessor :gold # amount of gold
attr_reader :steps # number of steps
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Create actor array
@actors = []
# Initialize amount of gold and steps
@gold = 0
@steps = 0
# Create amount in possession hash for items, weapons, and armor
@items = {}
@weapons = {}
@armors = {}
end
end