Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RMXP [Resolved] State Defense Script
[-]
Feb 05, 2010, 03:03pm
Zarox Online
German Ero-Sennin
******
Member
Posts: 219
Joined: Nov 2009
Post: #1
Question [Resolved] State Defense Script
Heya!
I searched a state defense script, maybe someone has one or knows where to find. That means:

If your char were for example in the state 'Poison Immunity' the state 'poison' wouldn't have any effect to him.

Hope ya understand Verycheery
Visit this user's website Find all posts by this user
[-]
Feb 05, 2010, 03:10pm
DerVVulfman Offline
Resident Werewolf
Management
Posts: 1,219
Joined: May 2009
Post: #2
RE: State Defense Script
I hate answering technical posts at work. I don't have RMXP up and I'm just basing my answers on memory alone.

So rather than setting your character to have a default high-resistance to poison, you are hoping to have a system that has two states counteract one another. If... you can change the character's resistance to poison rather than use a second state, that may be better.

Up is down, left is right and sideways is straight ahead.
- Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)


Content Hidden

Personal standpoint...
"I believe in giving people options, not 'forcing' only one script or system upon everyone. Adaption is key, not specialization. Overspecialize, and you breed in weakness."
Find all posts by this user
[-]
Feb 05, 2010, 03:32pm
Zarox Online
German Ero-Sennin
******
Member
Posts: 219
Joined: Nov 2009
Post: #3
RE: State Defense Script
yeah I think that would be complicated, also I think there is no command to change the class based state defense, or is there? If so, this could be evented, but I rather like to have a script than do it with events. If there is no chance for a script I would event it (if possible)^^
Visit this user's website Find all posts by this user
[-]
Feb 05, 2010, 03:42pm
Jaberwocky Online
Active
****
Member
Posts: 91
Joined: Oct 2009
Post: #4
RE: State Defense Script
Couldn't you just set the 'Poison Immunity' state to remove poison?
While I was mucking around with state handling, I think I remember seeing a check that prevents states from being added if the actor already had a state that removes it.
Of course, it would remove poison as well as prevent it, but it wouldn't require changing any code. Probably.

[Image: rkv4oh.png]
Find all posts by this user
[-]
Feb 05, 2010, 04:10pm
Zarox Online
German Ero-Sennin
******
Member
Posts: 219
Joined: Nov 2009
Post: #5
RE: State Defense Script
yeah you're right, seems to work :D ty so much^^
but another question: I searched to make a state change the elemental attack, so for example state beastslayer would make your elemental attack Anti-Beast. Is this also possible like that? Or is there a script?
Visit this user's website Find all posts by this user
[-]
Feb 06, 2010, 08:18am
fgsfds Online
Rule 1&2! >:(
****
Member
Posts: 98
Joined: Nov 2009
Post: #6
RE: State Defense Script
Quote:#
# ステート変化を防止するステート
#  ©2007 TYPE74RX-T
#
#==============================================================================
# ★ 再定義ポイント
#------------------------------------------------------------------------------
# class Game_Battler
# def add_state
#==============================================================================

module RPG
class State
alias rx_rgssb18_initialize initialize
def initialize
# メソッドを呼び戻す
rx_rgssb18_initialize
# ★ ステート防御用ステートかどうかの判定
@rx_resist_state = false
end
#--------------------------------------------------------------------------
# ★ ステート防御用ステートかどうかの判定
#--------------------------------------------------------------------------
def rx_resist_state
if @name.include?("-s")
@rx_resist_state = true
return @rx_resist_state
end
return @rx_resist_state
end
#--------------------------------------------------------------------------
# ★ 特殊設定用文字列を取り除いた名前を取得
#--------------------------------------------------------------------------
def name
new_name = @name.split(/[\s\-]+/)
return new_name[0]
end
end
end

#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
#  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ
# スのスーパークラスとして使用されます。
#==============================================================================

class Game_Battler
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias rx_rgssb18_initialize initialize
def initialize
# メソッドを呼び戻す
rx_rgssb18_initialize
# ★ ステート防御情報
@rx_resist_states = []
end
#--------------------------------------------------------------------------
# ★ ステート防御情報
#--------------------------------------------------------------------------
def rx_resist_states
return @rx_resist_states
end
#--------------------------------------------------------------------------
# ● ステートの付加
# state_id : ステート ID
# force : 強制付加フラグ (オートステートの処理で使用)
#--------------------------------------------------------------------------
def add_state(state_id, force = false)
# 無効なステートの場合
if $data_states[state_id] == nil
# メソッド終了
return
end
# 強制付加ではない場合
unless force
# 既存のステートのループ
for i in @states
# 新しいステートが既存のステートのステート変化 (-) に含まれており、
# そのステートが新しいステートのステート変化 (-) には含まれない場合
# (ex : 戦闘不能のときに毒を付加しようとした場合)
if $data_states[i].minus_state_set.include?(state_id) and
not $data_states[state_id].minus_state_set.include?(i)
# メソッド終了
return
end
end
end
# このステートが付加されていない場合
unless state?(state_id)
# ステート ID を @states 配列に追加
@states.push(state_id)
# オプション [HP 0 の状態とみなす] が有効の場合
if $data_states[state_id].zero_hp
# HP を 0 に変更
@hp = 0
end
# 全ステートのループ
for i in 1...$data_states.size
# ステート変化 (+) 処理
if $data_states[state_id].plus_state_set.include?(i)
#++++++++++++++++++++++++++++★改造事項++++++++++++++++++++++++++++
# ステート防御するステートなら
if $data_states[state_id].rx_resist_state
# ステート防御情報をステート防御配列に追加
@rx_resist_states.push(i)
else
add_state(i)
end
end
# ステート変化 (-) 処理
if $data_states[state_id].minus_state_set.include?(i)
# ステート防御するステートなら
if $data_states[state_id].rx_resist_state
# ステート防御情報をステート防御配列に追加
@rx_resist_states.push(i)
else
remove_state(i)
end
end
#++++++++++++++++++++++++++★改造ここまで++++++++++++++++++++++++++
end
# レーティングの大きい順 (同値の場合は制約の強い順) に並び替え
@states.sort! do |a, b|
state_a = $data_states[a]
state_b = $data_states[b]
if state_a.rating > state_b.rating
-1
elsif state_a.rating < state_b.rating
+1
elsif state_a.restriction > state_b.restriction
-1
elsif state_a.restriction < state_b.restriction
+1
else
a <=> b
end
end
end
# 強制付加の場合
if force
# 自然解除の最低ターン数を -1 (無効) に設定
@states_turn[state_id] = -1
end
# 強制付加ではない場合
unless @states_turn[state_id] == -1
# 自然解除の最低ターン数を設定
@states_turn[state_id] = $data_states[state_id].hold_turn
end
# 行動不能の場合
unless movable?
# アクションをクリア
@current_action.clear
end
# HP および SP の最大値チェック
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# ● ステートの解除
# state_id : ステート ID
# force : 強制解除フラグ (オートステートの処理で使用)
#--------------------------------------------------------------------------
alias rx_rgssb18_remove_state remove_state
def remove_state(state_id, force = false)
# メソッドを呼び戻す
rx_rgssb18_remove_state(state_id, force)
# ★ ステート防御するステートならステート防御情報を
#  ステート防御配列から削除
if $data_states[state_id].rx_resist_state
for i in $data_states[state_id].plus_state_set
@rx_resist_states.delete(i)
end
end
end
end

#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
# の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● ステート防御判定
# state_id : ステート ID
#--------------------------------------------------------------------------
alias rx_rgssb18_state_guard? state_guard?
def state_guard?(state_id)
# ★ ステート防御配列に指定のステート ID が含まれていれば
if @rx_resist_states.include?(state_id)
return true
end
# メソッドを呼び戻す
rx_rgssb18_state_guard?(state_id)
end
end
Find all posts by this user
[-]
Feb 06, 2010, 08:45am
Zarox Online
German Ero-Sennin
******
Member
Posts: 219
Joined: Nov 2009
Post: #7
RE: State Defense Script
Ty but I already got it :D now there is just this new request

==>

Zarox Wrote:I searched to make a state change the elemental attack, so for example state beastslayer would make your elemental attack Anti-Beast. Is this also possible like that? Or is there a script?
Visit this user's website Find all posts by this user
[-]
Feb 06, 2010, 10:01pm
fgsfds Online
Rule 1&2! >:(
****
Member
Posts: 98
Joined: Nov 2009
Post: #8
RE: State Defense Script
In a lazy way, I use multi slot script, then use a equipment that is considered a personal to a character i.e. cannot be removed, after that, around certain level or if a character has a passive, you can do a parallel check and it will add elemental check to it, but I dunno, that's how I'd work my way around it, you can try this script. However, you can probably make it null, but there's other ways, and there's always multiple solution around certain things on RPG Makers.

Quote:=begin
#=============================================================================
# Absorb, Null, and Weak Armors
#=============================================================================
# Bearcat
# Version 1.01
# 8.16.07
#=============================================================================
This script allows you to make armors and states that absorb, nullify, or
make the wearer weak to elemental damage. To set up an an armor or state,
put the armor id and the element id in the appropriate hash in Absorb_Setup.

There is no need to modify anything other than the hashes in Absorb_Setup.

Free use, modification, and distribution permitted (commercial projects
included) so long as credit is given to me, Bearcat.
==============================================================================
=end
module Absorb_Setup
#--------------------------------------------------------------------------
# * Absorb Armors
# syntax armor_id => [element1, element2...]
#--------------------------------------------------------------------------
Absorb_Armors = {
33 => [1]
}
#--------------------------------------------------------------------------
# * Null Armors
# syntax armor_id => [element1, element2...]
#--------------------------------------------------------------------------
Null_Armors = {
33 => [2]
}
#--------------------------------------------------------------------------
# * Weak Armors
# syntax armor_id => [element1, element2...]
#--------------------------------------------------------------------------
Weak_Armors = {
33 => [3]
}
#--------------------------------------------------------------------------
# * Absorb States
# syntax state_id => [element1, element2...]
#--------------------------------------------------------------------------
Absorb_States = {
17 => [1]
}
#--------------------------------------------------------------------------
# * Null States
# syntax state_id => [element1, element2...]
#--------------------------------------------------------------------------
Null_States = {
17 => [2]
}
#--------------------------------------------------------------------------
# * Weak States
# syntax state_id => [element1, element2...]
#--------------------------------------------------------------------------
Weak_States = {
17 => [3]
}
#--------------------------------------------------------------------------
# * Defaults DO NOT CHANGE
#--------------------------------------------------------------------------
Absorb_Armors.default = []
Null_Armors.default = []
Weak_Armors.default = []
Absorb_States.default = []
Null_States.default = []
Weak_States.default = []
end
Find all posts by this user
[-]
Feb 09, 2010, 06:55am
Kain Nobel Offline
Staff
Staff
Posts: 21
Joined: May 2009
Post: #9
RE: State Defense Script
Better yet, check this one out and tell me if it works for ya... I found it on the ol' test bed, and I don't recall ever posting it but there ya go!

The setup is explained in the FAQ, but I'll make an example just incase...

Example setup

Unfortunately, this is actor/enemy based, not class based, but it should help. Let me know if you have any questions or issues.
Find all posts by this user
[-]
Feb 09, 2010, 04:27pm
Zarox Online
German Ero-Sennin
******
Member
Posts: 219
Joined: Nov 2009
Post: #10
RE: State Defense Script
ok thy, this can be closed :D Maybe I will use it, try to implement it :D
Visit this user's website Find all posts by this user
Thread Closed 


User(s) browsing this thread:
1 Guest(s)

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Resolved] Damage SFX Script Mirby 4 101 Feb 25, 2010 06:38pm
Last Post: Mirby
  [Resolved]Elemental Attack/Defense through states Zarox 3 116 Feb 17, 2010 02:43pm
Last Post: Zarox
  [Resolved] MessageBack Tester Script/Tool? PK8 1 144 Jun 27, 2009 12:19am
Last Post: PK8
  [Resolved] Individual Battle Commands, I need to modify the script Apocrifis 5 192 Mar 31, 2009 06:37pm
Last Post: DerVVulfman
  [Resolved] Make RTAB Compliant? Single/All Target Switching Script Edit? fenwick 1 120 Feb 18, 2009 04:58pm
Last Post: DerVVulfman

Forum Jump: