hardest scripits to explain

Started by Shalaren, March 06, 2011, 09:48:54 pm

Previous topic - Next topic

Shalaren

ok first script is General HP,EXP, AND SP
what do I mean? all party members allways but allways will have the same exp and the same lvl.
whether they go off or back in the team, and the HP and SP is a one bar shared by all party members, which means that if one dies, all party memebrs die. besically in a hud what it shows you is the Stats of you! the controller! a party member gets demaged, besically all party members do as they share the same HP bar, i think this kinda explains it, i dont want the possibility of 1 member dies and 2 other still alive, they all should have the same HP!

Member 1 HP:200
Member 2 HP:200
Member 3 HP:200
General HP:200
Member 1 Gtes demaged by 20 dmg

Member 1 HP:180
Member 2 HP:180
Member 3 HP:180
General HP:180

hope you get my point, if not ill explain more.


Puzzle skill for Blizz Abs
events that can be only activated when a skill is used on them!
events that you put in their name "\Puz[frames]" if it has that, it can only be activated when a specific skill is used on the event, (like an enemy)
The frames is the frames is being loaded as the character uses the skill on the event EXAMPLE

a bar loading as he uses the skill, other characters can still be in combat, as he is "unlocking" the door.
when the target screen appears, with that certain skill, you can only target the "\Puz" events.
this is like for special seals that a skill named "seal breaker" is being used on.

ForeverZer0

Make sure I got this right. You want the party to die if one member has HP of 0, even if the others are at full?
All you would need there is a call a common event for the KO state to kill the rest of the party, or end the game, whatever you need to do.

If you want everyones HP to stay the same, so that they damage/heal evenly, just change everyones HP to reflect the average. This can be accomplished with a slight mod to the hp=(hp) method in Game_Battler.


class Game_Battler

  alias average_hp hp=
  def hp=(hp)
    average_hp(hp)
    if self.is_a?(Game_Battler)
      unless self.dead?
        avg = 0
        $game_party.actors.each {|actor| avg += actor.hp }
        avg /= $game_party.actors.size
        $game_party.actors.each {|actor| actor.hp = avg }
      else
        # WHATEVER YOU WANT TO HAPPEN WHEN SOMEONE DIES GOES HERE
      end
    end
  end
end

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Shalaren

Quote from: ForeverZer0 on March 06, 2011, 10:05:56 pm
Make sure I got this right. You want the party to die if one member has HP of 0, even if the others are at full?
All you would need there is a call a common event for the KO state to kill the rest of the party, or end the game, whatever you need to do.

If you want everyones HP to stay the same, so that they damage/heal evenly, just change everyones HP to reflect the average. This can be accomplished with a slight mod to the hp=(hp) method in Game_Battler.


class Game_Battler

  alias average_hp hp=
  def hp=(hp)
    average_hp(hp)
    if self.is_a?(Game_Battler)
      unless self.dead?
        avg = 0
        $game_party.actors.each {|actor| avg += actor.hp }
        avg /= $game_party.actors.size
        $game_party.actors.each {|actor| actor.hp = avg }
      else
        # WHATEVER YOU WANT TO HAPPEN WHEN SOMEONE DIES GOES HERE
      end
    end
  end
end



no its not what I want, S: it was an example.
if 1 party member is demages, all are, they all share the same hp. instead of haveing each their own hp. the whole party has a party hp. so if one is demaged, the demage goes to the party's hp.
but not just HP,.. but SP, lvl and exp too

WhiteRose

@F0: I don't that's quite was he was trying to say. Basically, as far as I understand it, he's thinking of the party as a single entity, sharing HP, XP and level.

Shalaren

Quote from: WhiteRose on March 06, 2011, 10:17:57 pm
@F0: I don't that's quite was he was trying to say. Basically, as far as I understand it, he's thinking of the party as a single entity, sharing HP, XP and level.

exactly

ForeverZer0

March 06, 2011, 10:23:41 pm #5 Last Edit: March 06, 2011, 10:24:56 pm by ForeverZer0
Hold on a sec.

EDIT: You want stats such as strength, evasion, inteligence, etc. the same too?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Wizered67

As for events activated by skills, if you make it an enemy that can't do anything, you can put Trigger:Skill in a comment to make the event execute when the skill is sued. Check the manual for more details.

Shalaren

March 06, 2011, 10:33:57 pm #7 Last Edit: March 06, 2011, 10:36:56 pm by Shalaren
Quote from: ForeverZer0 on March 06, 2011, 10:23:41 pm
Hold on a sec.

EDIT: You want stats such as strength, evasion, inteligence, etc. the same too?


No!
if a character with better defence gets hit, then the party suffers a lower demage, thats the beuty of it o:
they only share exp, lvls, hp and sp. one used so much skills he ran out of sp, technically the whole part ran out of sp then.

Quote from: Wizered67 on March 06, 2011, 10:29:33 pm
As for events activated by skills, if you make it an enemy that can't do anything, you can put Trigger:Skill in a comment to make the event execute when the skill is sued. Check the manual for more details.

I actually tried that, but you missed the loading part of the request...

ForeverZer0

I just thought of something (after I was about done writing a you a quick script edit).
Can't you just create a dummy actor in the database, and always just use its stats for everybody?

I can still give you the script edits I wrote, but they basically accomplish the same end.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Shalaren

Quote from: ForeverZer0 on March 06, 2011, 10:57:39 pm
I just thought of something (after I was about done writing a you a quick script edit).
Can't you just create a dummy actor in the database, and always just use its stats for everybody?

I can still give you the script edits I wrote, but they basically accomplish the same end.


no because it kinda messes everything up, ill remind you im using blizz-abs and it shows on the main character, and on his features, (and some more scripits I made) doing that is just a big mess that wont work for me S:

ForeverZer0

Okay, one last question.

What I have now will make it so you have basically all the same stats, but for $game_player: hp, mp, maxhp, maxsp, exp, level, etc, etc.

They will return the total of all party members, but maintains each actor's actual stats under the scenes, which means you that you will have to for example alter your health bar to reference the $game_player method.
I probably could actually just create a global pool of the stats, that won;t require manual edits, but I can almost guaranteed that you are going to run into bugs down the road if not right away.

Here's what I got:
Spoiler: ShowHide

class Game_Party
 
  # Set up a dummy actor in the database with the appropriate experience curve
  # that you would like to use. Set the ID of this actor to the constant below.
  DUMMY_ACTOR_ID = 12
 
  def exp
    return $game_actors[DUMMY_ACTOR_ID].exp
  end
 
  def level
    return $game_actors[DUMMY_ACTOR_ID].level
  end
   
  def hp
    total = 0
    @actors.each {|actor| total += actor.hp }
    return total
  end
 
  def sp
    total = 0
    @actors.each {|actor| total += actor.sp }
    return total
  end
 
  def maxhp
    total = 0
    @actors.each {|actor| total += actor.maxhp }
    return total
  end
 
  def maxsp
    total = 0
    @actors.each {|actor| total += actor.maxsp }
    return total
  end
 
  def dead?
    return @actors.any? {|actor| actor.dead? }
  end
 
  def exp=(exp)
    $game_actors[DUMMY_ACTOR_ID].exp = exp
  end
 
  def exp_s
    dummy = $game_actors[DUMMY_ACTOR_ID]
    return dummy.exp_list[dummy.level+1] > 0 ? dummy.exp.to_s : "-------"
  end

  def next_exp_s
    dummy = $game_actors[DUMMY_ACTOR_ID]
    return dummy.exp_list[dummy.level+1] > 0 ? dummy.exp_list[dummy.level+1].to_s : "-------"
  end

  def next_rest_exp_s
    dummy = $game_actors[DUMMY_ACTOR_ID]
    return dummy.exp_list[dummy.level+1] > 0 ?
      (dummy.exp_list[dummy.level+1] - dummy.exp).to_s : "-------"
  end
end

class Game_Actor
  attr_reader :exp_list
end


Just follow the little instruction at the top. You will need to edit parts in your scripts to reference the following:


  • $game_party.exp

  • $game_party.exp=

  • $game_party.level

  • $game_party.exp_s

  • $game_party.next_exp_s

  • $game_party.next_rest_exp_s

  • $game_party..level

  • $game_party.hp

  • $game_party.sp

  • $game_party.maxhp

  • $game_party.maxsp

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Shalaren

March 06, 2011, 11:16:23 pm #11 Last Edit: March 06, 2011, 11:17:58 pm by Shalaren
Quote from: ForeverZer0 on March 06, 2011, 11:09:54 pm
Okay, one last question.

What I have now will make it so you have basically all the same stats, but for $game_player: hp, mp, maxhp, maxsp, exp, level, etc, etc.

They will return the total of all party members, but maintains each actor's actual stats under the scenes, which means you that you will have to for example alter your health bar to reference the $game_player method.
I probably could actually just create a global pool of the stats, that won;t require manual edits, but I can almost guaranteed that you are going to run into bugs down the road if not right away.

Here's what I got:
Spoiler: ShowHide

class Game_Party
 
 # Set up a dummy actor in the database with the appropriate experience curve
 # that you would like to use. Set the ID of this actor to the constant below.
 DUMMY_ACTOR_ID = 12
 
 def exp
   return $game_actors[DUMMY_ACTOR_ID].exp
 end
 
 def level
   return $game_actors[DUMMY_ACTOR_ID].level
 end
   
 def hp
   total = 0
   @actors.each {|actor| total += actor.hp }
   return total
 end
 
 def sp
   total = 0
   @actors.each {|actor| total += actor.sp }
   return total
 end
 
 def maxhp
   total = 0
   @actors.each {|actor| total += actor.maxhp }
   return total
 end
 
 def maxsp
   total = 0
   @actors.each {|actor| total += actor.maxsp }
   return total
 end
 
 def dead?
   return @actors.any? {|actor| actor.dead? }
 end
 
 def exp=(exp)
   $game_actors[DUMMY_ACTOR_ID].exp = exp
 end
 
 def exp_s
   dummy = $game_actors[DUMMY_ACTOR_ID]
   return dummy.exp_list[dummy.level+1] > 0 ? dummy.exp.to_s : "-------"
 end

 def next_exp_s
   dummy = $game_actors[DUMMY_ACTOR_ID]
   return dummy.exp_list[dummy.level+1] > 0 ? dummy.exp_list[dummy.level+1].to_s : "-------"
 end

 def next_rest_exp_s
   dummy = $game_actors[DUMMY_ACTOR_ID]
   return dummy.exp_list[dummy.level+1] > 0 ?
     (dummy.exp_list[dummy.level+1] - dummy.exp).to_s : "-------"
 end
end

class Game_Actor
 attr_reader :exp_list
end


Just follow the little instruction at the top. You will need to edit parts in your scripts to reference the following:


  • $game_party.exp

  • $game_party.exp=

  • $game_party.level

  • $game_party.exp_s

  • $game_party.next_exp_s

  • $game_party.next_rest_exp_s

  • $game_party..level

  • $game_party.hp

  • $game_party.sp

  • $game_party.maxhp

  • $game_party.maxsp



im not sure I understand your question, but Ill just provide you with a small explenation o-o
lets say i have three characters and 1 enemy, so in battle it shows, me 100% hp, enemy 100%
in other words me includes all party members as 1, but just 3 members.
now lets say I have a mage, warrior, and archer, if the archer gets hit, he'll recieve lets say 200 demage,
besically its as all party recieved 200 demage since they share the hp. but if the warrior was hit, because his stats of defence are higher, hell only recieve 100 demgae, which all party recieve as then again, they share the HP.
besically they only shar HP, SP, LVL, and EXP, but no the other stats.. as for the other stats, they all have their own...
now, if you add a member ot the party, hell automatically have the same exp, and lvl as other party members..
and i want to remind you, hp changes as they lvl, so I guess the basic would be character ID 1. as that would be the hp ill be setting the party to share. (thats just a suggestion)

ForeverZer0

That scriptlet I gave you will do that. You need to just reference the hp/maxhp, sp/maxsp, etc. youself in the your script.
If player one gets hit, he actually takes damage, based off his own stats, but the damage is also taken from the party's total health.

If a player dies, $game_party.dead? will return true. All the calls you will need are there, but I can't implement them into your custom game, obviously. If you have it a HUD or something that you want to show the party health, you will need to make the alterations to check the $game_party.hp instead of the individual character's hp, and so on and so forth.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Shalaren

no it doesnt do what I excpected S:, ok heres a way.
all party members are based on the main character, the one your playing with, the one the hud shows, which is ID:1
when other party member kills, only ID:1 gets the exp, but when he lvls, all party memebrs lvl S:. thats what im trying to do,
that his Hp, Sp, lvl, and EXP belong to the whole party, not just some dummy character that wont even show int he hud. S:
man its really hard to explain. everything is based on character #1, if he dies. all party dies, but if he doesnt they cant die, since they all share the same hp as him. if they get demaged, he gets demaged not them. because they share the hp woth him. if he lvls, all party lvls, because they share the same exp. its like your playing only with 1 character, only that he has 3 parts to him. 3 parts that go around in caterpiller.
well thanks anyway for trying.

ForeverZer0

I understand exactly what you need, and what I provided are the methods to do it with. You will need to apply them yourself, though, like I said. There is no way any small scriplet that maintains any type of compatibility will do it without you having to make a couple of edits.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Shalaren

I Appreciate you're help, but im no scripter S:, I can spend all day on it and not figure it out, im no good with coding.
I tried playing around with it and trying to make it so when 1 gets demaged besically they all will. as if you change the party leader, they all will have the same amout of hp, etc. but for all I tried, the one get's demaged, is the only one with less hp.
Thanks though.