Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Futendra on January 01, 2011, 09:40:14 am

Title: In sight script thing + HP Bar
Post by: Futendra on January 01, 2011, 09:40:14 am
In Sight
Well I saw on some games that there ae scenes like this:

Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 01, 2011, 11:52:40 am
This is what I got for the HP/SP Bar:

Spoiler: ShowHide
class Window_YourHUD < Window_Base
  def initialize
    super(0, 0, 640, 64)
    self.opacity = 0
    self.contents = Bitmap.new(640 - 32, 64 - 32)
    refresh
  end
  def refresh
    self.contents.clear
    reset_variables
    return if !@actor
    draw_actor_hp(@actor, 0, 0)
    draw_actor_sp(@actor, 300, 0)
  end
  def reset_variables
    @actor = $game_party.actors[0]
    @old_hp = @actor ? @actor.hp : 0
    @old_maxhp = @actor ? @actor.maxhp : 0
    @old_sp = @actor ? @actor.sp : 0
    @old_maxsp = @actor ? @actor.maxsp : 0
  end
  def update
    super
    refresh if (@actor = $game_party.actors[0] or
                @old_hp = @actor ? @actor.hp : 0 or
                @old_maxhp = @actor ? @actor.maxhp : 0 or
                @old_sp = @actor ? @actor.sp : 0 or
                @old_maxsp = @actor ? @actor.maxsp : 0)
  end
end
class Scene_Map
  alias yourhud_main main
  alias yourhud_update update
  def main
    @yourhud = Window_YourHUD.new
    yourhud_main
    @yourhud.dispose
  end
  def update
    @yourhud.update
    yourhud_update
  end
end


But I need 4 party members to show up, not one, how do I do this? NEWB TO RGSS RUBY
Title: Re: In sight script thing + HP Bar
Post by: Holyrapid on January 01, 2011, 01:25:52 pm
Are you using what battle system?
And as for the in sight, that's easy to event. Just take an events X and Y positions on the map, compare those to the players, and if the event is facing the player, if player is say five squares away, it will react.
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 01, 2011, 01:56:43 pm
Quote from: DesPKP on January 01, 2011, 01:25:52 pm
Are you using what battle system?
And as for the in sight, that's easy to event. Just take an events X and Y positions on the map, compare those to the players, and if the event is facing the player, if player is say five squares away, it will react.


RTP Battle system, so no ABS

And can you make a tut on that?
Title: Re: In sight script thing + HP Bar
Post by: The Niche on January 01, 2011, 07:52:55 pm
It's easy. Set two variables to the player's x and y positions, this is easy to do using the control variables command. Then, make a conditional branch checking if these variables are between certain numbers (the boundaries of the area you want your guards to be able to detect in)
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 02, 2011, 08:27:35 am
Quote from: The Niche on January 01, 2011, 07:52:55 pm
It's easy. Set two variables to the player's x and y positions, this is easy to do using the control variables command. Then, make a conditional branch checking if these variables are between certain numbers (the boundaries of the area you want your guards to be able to detect in)


but it must be moving around, so what do i do then??
Title: Re: In sight script thing + HP Bar
Post by: The Niche on January 02, 2011, 08:54:59 am
Quote from: Futendra on January 02, 2011, 08:27:35 am
Quote from: The Niche on January 01, 2011, 07:52:55 pm
It's easy. Set two variables to the player's x and y positions, this is easy to do using the control variables command. Then, make a conditional branch checking if these variables are between certain numbers (the boundaries of the area you want your guards to be able to detect in)


but it must be moving around, so what do i do then??



Ah, now that's a bit more difficult. This'll be a bit of work. So, make a label at the top of the event, then do the conditional branch thing. Then, if they haven't seen the player, put in the first step of the move route. Conditional branch again. Next step, etc. Have them return to the starting point and then jump to the label at the top of the event. Note: There's probably a better way to do this, I don't think Blizzard could have been bothered to do like seven maps with around seven moving guards each this way. So use this until someone comes up with a better way.
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 02, 2011, 09:03:29 am
Quote from: The Niche on January 02, 2011, 08:54:59 am
Quote from: Futendra on January 02, 2011, 08:27:35 am
Quote from: The Niche on January 01, 2011, 07:52:55 pm
It's easy. Set two variables to the player's x and y positions, this is easy to do using the control variables command. Then, make a conditional branch checking if these variables are between certain numbers (the boundaries of the area you want your guards to be able to detect in)


but it must be moving around, so what do i do then??



Ah, now that's a bit more difficult. This'll be a bit of work. So, make a label at the top of the event, then do the conditional branch thing. Then, if they haven't seen the player, put in the first step of the move route. Conditional branch again. Next step, etc. Have them return to the starting point and then jump to the label at the top of the event. Note: There's probably a better way to do this, I don't think Blizzard could have been bothered to do like seven maps with around seven moving guards each this way. So use this until someone comes up with a better way.

Can you make a demo??

Also, can you help me out with my HUD?
HUD For RTP, 4 party members, caterpillar, and an animated health bar (check main post)
Title: Re: In sight script thing + HP Bar
Post by: Holyrapid on January 02, 2011, 09:12:30 am
HUD can be found in Tons, as well as caterpillar. As for the health bar, though it can be found in tons as well, it's not animated. And i think that making animated bars would create lag, probably in such portions that it wouldn't be worth it...
Title: Re: In sight script thing + HP Bar
Post by: The Niche on January 02, 2011, 09:16:25 am
The demo, no, but all the commands you need are in the first two tabs of the event editor. Control variables, label, conditional branch, set move route and jump to label.

Basic diagram of the event, using an area of five tiles around the event, which is at (009,004) on the map.

Label: Label1 (Call this whatever you like I can't be bothered to come up with a name for it)
Control Variables: Player X == Player's map X
Control Variables: Player Y == Player's map Y
Conditional branch: Player X > 4
Conditional branch: Player X < 14
Conditional branch: Player Y > 0
Conditional branch: Player Y < 9
Set move route: This event, move left.
Control Variables: Player X == Player's map X
Control Variables: Player Y == Player's map Y
Conditional branch: Player X > 3
Conditional branch: Player X < 13
Conditional branch: Player Y > 0
Conditional branch: Player Y < 9
(Next step on the move route, adjust the variables again)
(Make the move route bring the event back to (009, 004) again)
Jump to label: Label1

As to the hud, listen to Des.
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 02, 2011, 10:03:48 am
Quote from: DesPKP on January 02, 2011, 09:12:30 am
HUD can be found in Tons, as well as caterpillar. As for the health bar, though it can be found in tons as well, it's not animated. And i think that making animated bars would create lag, probably in such portions that it wouldn't be worth it...


I meant I am using a caterpillar and I need a HUD with a health bar, with 4 party members, but in the beginning its only 1.
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 03, 2011, 01:04:05 pm
SOMEONE PLEASE HELP ME GET MY HUD DOWN :(

I NEED IT PRETTY URGENT AS PEOPLE WANT DEMO...
Title: Re: In sight script thing + HP Bar
Post by: WhiteRose on January 03, 2011, 05:49:24 pm
Quote from: Futendra on January 02, 2011, 10:03:48 am
Quote from: DesPKP on January 02, 2011, 09:12:30 am
HUD can be found in Tons, as well as caterpillar. As for the health bar, though it can be found in tons as well, it's not animated. And i think that making animated bars would create lag, probably in such portions that it wouldn't be worth it...


I meant I am using a caterpillar and I need a HUD with a health bar, with 4 party members, but in the beginning its only 1.


I believe you can change that in the configuration of that Add-on in Tons. In fact, I'm fairly certain of it. Also, when you post parts of scripts, using code tags will make it much easier for people to help you.
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 04, 2011, 04:22:38 am
Quote from: WhiteRose on January 03, 2011, 05:49:24 pm
Quote from: Futendra on January 02, 2011, 10:03:48 am
Quote from: DesPKP on January 02, 2011, 09:12:30 am
HUD can be found in Tons, as well as caterpillar. As for the health bar, though it can be found in tons as well, it's not animated. And i think that making animated bars would create lag, probably in such portions that it wouldn't be worth it...


I meant I am using a caterpillar and I need a HUD with a health bar, with 4 party members, but in the beginning its only 1.


I believe you can change that in the configuration of that Add-on in Tons. In fact, I'm fairly certain of it. Also, when you post parts of scripts, using code tags will make it much easier for people to help you.

I don't hve BLIZZABS! So will it work? I never got tons of add ons to work, ever...
Title: Re: In sight script thing + HP Bar
Post by: WhiteRose on January 04, 2011, 11:30:02 am
Tons and BABS aren't directly related at all. What part of Tons were you having trouble with? It's fairly simple - just enable each add-on you want to use at the top of its part (1, 2, or 3,) and then use the configuration before each Add-On in the script to tweak it to your liking.
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 04, 2011, 01:22:15 pm
Quote from: WhiteRose on January 04, 2011, 11:30:02 am
Tons and BABS aren't directly related at all. What part of Tons were you having trouble with? It's fairly simple - just enable each add-on you want to use at the top of its part (1, 2, or 3,) and then use the configuration before each Add-On in the script to tweak it to your liking.


I always get errors that he cant find blizz abs.......

Thats why I dont use it XD
Title: Re: In sight script thing + HP Bar
Post by: Starrodkirby86 on January 04, 2011, 02:20:24 pm
Tons of Add-ons and Blizz-ABS can work separately.

There's tons of projects I had before that use Tons of Add-ons without Blizz-ABS.

It's a shame since Tons of Add-ons has HP/SP/sex bars included already from the package.

Just make three new scripts above Main and copypasta each Tons of Add-ons part in the right order. Then in the configuration section, just set whatever one you want enabled as true. o.O
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 05, 2011, 05:50:41 am
Quote from: Starrodkirby86 on January 04, 2011, 02:20:24 pm
Tons of Add-ons and Blizz-ABS can work separately.

There's tons of projects I had before that use Tons of Add-ons without Blizz-ABS.

It's a shame since Tons of Add-ons has HP/SP/sex bars included already from the package.

Just make three new scripts above Main and copypasta each Tons of Add-ons part in the right order. Then in the configuration section, just set whatever one you want enabled as true. o.O


Well , when I try to run my tons of add ons, It always give errors saying it needs a special input?
Like Game_Character and stuff, while it is in the script?

Maybe its just me doing something wrong... What I tried is:
-Just saying true to what I want
-Just saying true + configuring more
-Configuring and instead of making the true thing, make it false in her configuring itself

none seem to work...
Title: Re: In sight script thing + HP Bar
Post by: The Niche on January 05, 2011, 11:58:36 am
Quote from: Starrodkirby86 on January 04, 2011, 02:20:24 pm
Tons of Add-ons and Blizz-ABS can work separately.

There's tons of projects I had before that use Tons of Add-ons without Blizz-ABS.

It's a shame since Tons of Add-ons has HP/SP/sex bars included already from the package.

Just make three new scripts above Main and copypasta each Tons of Add-ons part in the right order. Then in the configuration section, just set whatever one you want enabled as true. o.O


Right, now I'm going to go make a game where exp is replaced with sex.
Title: Re: In sight script thing + HP Bar
Post by: WhiteRose on January 05, 2011, 12:12:44 pm
Quote from: Futendra on January 05, 2011, 05:50:41 am
Well , when I try to run my tons of add ons, It always give errors saying it needs a special input?
Like Game_Character and stuff, while it is in the script?

Maybe its just me doing something wrong... What I tried is:
-Just saying true to what I want
-Just saying true + configuring more
-Configuring and instead of making the true thing, make it false in her configuring itself

none seem to work...


If you're getting errors, you've either copy-pasted the scripts incorrectly, or you've changed something you shouldn't have.
Title: Re: In sight script thing + HP Bar
Post by: Futendra on January 05, 2011, 01:09:30 pm
Quote from: WhiteRose on January 05, 2011, 12:12:44 pm
Quote from: Futendra on January 05, 2011, 05:50:41 am
Well , when I try to run my tons of add ons, It always give errors saying it needs a special input?
Like Game_Character and stuff, while it is in the script?

Maybe its just me doing something wrong... What I tried is:
-Just saying true to what I want
-Just saying true + configuring more
-Configuring and instead of making the true thing, make it false in her configuring itself

none seem to work...


If you're getting errors, you've either copy-pasted the scripts incorrectly, or you've changed something you shouldn't have.


Nope, Just inserted like said in the topic, right above Main, then said true to the things I need, And then! errors....

But NVM It I'll use one I found and just customize