[XP] Blizz-ABS

Started by Blizzard, January 09, 2008, 08:21:56 am

Previous topic - Next topic

KK20

Quote from: Metaron on August 08, 2012, 01:27:47 pm
"Script 'Part 2' line 3292: NoMethodError occurred.
undefined method 'battler' for nil;NilClass"
The reason for the error is because you are trying to find a battler that does not exist. In other words, the event ID #96 either does not exist on the map or it is not an enemy.

To prevent further errors like this, you should do something like this in a script call:
if $BlizzABS.is_enemy?(96)
$game_variables[79] =
$BlizzABS.get_enemy(96).hp
end
That way, it won't throw an error at you if the battler doesn't exist.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

This should work even better

if $BlizzABS.is_enemy?(96)
$game_variables[79] =
$BlizzABS.get_enemy(96).hp
else
$game_variables[79] = 0
end


When the enemy doesn't exist, the variable will be 0.

*levels up KK20*
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

Oh yeah, duh! I even went ahead and tested my previous snippet. The variable will remain at the last HP value the monster had before being killed.

So yeah, I dun goofed. :^_^': Thanks Blizz

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Bob423

so i've just made a simple CMS, and i want to include the premenu commands in the command window (and remove the premenu) would i use $scene = Scene_Hotkeys.new or something?

Metaron

Thanks guys, it works perfectly ^^.

Bob423

Quote from: Bob423 on August 12, 2012, 02:17:40 am
so i've just made a simple CMS, and i want to include the premenu commands in the command window (and remove the premenu) would i use $scene = Scene_Hotkeys.new or something?


k, i got rid of the premenu, and AI trigger and AI behavior both work. but i still dont know how to get Hotkeys to work.

LiTTleDRAgo

$scene = Scene_Hotkeys.new(tone = Tone.new(0, 0, 0, 0), index = 0)

  #  tone - screen background tone
  #  index - index character in party

Bob423


veinhardt.nightshade

Um... Is there a compatible lighting effects script on Blizz-ABS?

Boba Fett Link

Could you explain more? Do you want light following the player, or torches and stuff glowing, or what?
This post will self-destruct in 30 seconds.

veinhardt.nightshade

Quote from: Boba Fett Link on August 14, 2012, 12:12:12 pm
Could you explain more? Do you want light following the player, or torches and stuff glowing, or what?


the torches script... just like by near fantastica's...

Kiwa

Hey fellas,

Ive been trying for a bit no to figure out how to make an enemy NPC stand still ....then attack if i get in his sight or hearing range.
there are a lot of cool ideas i have if i can get it working.

and also..
is there a way i can always show the hot keys? i looked in the "Blizz-ABS Config 2.84"(which is a FANTASTIC addition to the already amazing ABS)  as well as the code it self in page 1 of the BABS. cant seem to locate a way to always show the hot keys ...currently every time i play my game i have to hit the button to display it. a minor nuisance for me... but if i actually release the game id want it displayed for user sake.

Thanks! Hopefully soon I can release a small demo to show what ive been up to.

Blizzard

August 16, 2012, 07:23:19 am #4852 Last Edit: August 16, 2012, 07:24:54 am by Blizzard
Search for script commands in the manual. There's a list of all script commands.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Kiwa

August 16, 2012, 10:52:05 am #4853 Last Edit: August 16, 2012, 11:58:52 am by Kiwa
Thanks blizz.

There is a lot of good stuff in there i feel i can use at some point.
i now have both my mini map and the hot keys activated :D thanks.

I didn't see anything in there i could use 'Directly' for making my select NPC stationary until in line of sight or hearing.
I thought about making an enemy with its own "State" with the "restrictions: Can't move".
but then when the enemy hears or or sees me.. it cant move.
so im going to try to play with:
$BlizzABS.enemy_can_see?(event_id, target_type, target)
$BlizzABS.enemy_can_hear?(event_id, target_type, target)

that runs off of a parallel process in the common events...or perhaps just on the individual maps that will remove that state upon either of those 2.
(tho i don't really know how to fill in the id, type, and target...lol)

we'll see if it works lol.
any words of wisdom? lol

Thanks, As always!


EDIT**

Well i got the Code to force a "state" on the enemy making him stand still..but i think i need more coding experience to make it where it can be freed from sight.. i cant figure it out lol.

any ideas?

KK20

Nice problem solving you did there. Yes, you are on the right track--parallel process and apply a state. I've made the script call you should use
if $BlizzABS.is_enemy?(1)
if $BlizzABS.enemy_can_perceive?(1,
ACTORS, PARTY)
$BlizzABS.enemy_change_state(1,
false, 20)
else
$BlizzABS.enemy_change_state(1, true,
20)
end
end
Give that a whirl.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kiwa

August 16, 2012, 04:10:55 pm #4855 Last Edit: August 16, 2012, 04:25:22 pm by Kiwa
Thanks for the code.

I tried my best to modify it to fit in. No errors popping up but i am getting an issue.. just as if the code was never there.
so let me first explain some of my set up.

/e[33]
is my enemy im using. hes event 3 (003)

18
is my "Standing Stationary" State.

now i have 1 event on a 2 page self switch parallel process invisible to all jammed in a wall somewhere. (event 6)
Page 1:

$game_system.hotkeys = true
$game_system.minimap = 1
$BlizzABS.enemy_change_state(TROOP,
true, 18)
Control Self Switch A =ON


Page 2: (Self Switch A =ON)

if $BlizzABS.is_enemy?(33)
if $BlizzABS.enemy_can_perceive?(33,
ACTORS, PARTY)
$BlizzABS.enemy_change_state(TROOP,
false, 18)
else
$BlizzABS.enemy_change_state(TROOP,
true, 18)
end
end


Page 1 has worked since i made the post earlier. I immediately tried it..then posted my desperate cry for coding help.
So i feel the error is in my modifying your code.
I tried to change true to ADD and false to REMOVE...and that didn't work.
I tried to remove my code on page 1. that didn't work either. they just walked around like they never had any code.

Ill keep putzing  with it.. thanks for the help!

Also just tried changing perceive to "BlizzABS.enemy_can_see?(7, ACTORS,
0)"
also tried "33" all to cause syntax error in code..lol

KK20

August 16, 2012, 05:02:53 pm #4856 Last Edit: August 16, 2012, 05:15:49 pm by KK20
I tried using enemy_can_see and it didn't work on a "Can't Move" state. enemy_can_perceive works though. I've tested my code and it works. You made sure that page 2 in your event is set to parallel process?

Also, according to that edit, all of your enemies will move when one specific enemy can detect an actor.

EDIT
Actually, when I made this edit, enemy_can_see works.
Spoiler: ShowHide
    #--------------------------------------------------------------------------
    # enemy_can_see?
    #  id          - event ID
    #  target_type - enemies or actors
    #  target      - which target
    #  Checks is the given enemy can see a specific battler.
    #--------------------------------------------------------------------------
    def enemy_can_see?(id, target_type, target)
      # get enemies
      enemies = get_enemies(id)
      # can't see if not a battler
      return false unless enemies[0].is_a?(Map_Battler)
      # get targets to check
      targets = get_targets(target_type, target)
      # return result
      return (targets.any? {|t| enemies.any? {|e|
          $BlizzABS.AI.can_see_char?(e, t.real_x, t.real_y)}})
    end
Which makes me wonder why "see" had a different return process than "hear" and "perceive".

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kiwa

Yes Page 1 and Page 2 are both Parallel Processes. Yeah i added TROOP to try it out. i also did individual event number and it failed. so i decided to try troop...and it also failed.
I know page 2 is running just fine because i put a message with "show text" in the page.. and it spammed my character so much  with the message, i couldn't move.
So the issue has to be in my modification somewhere..perhaps i linked to an ID or something improperly? you see no Errors in your code i modified to fit my game?
tho the code its self seemed pretty easy to understand. perhaps I'm overestimating my self

your code you just linked just last post.. is that to be placed in the Script Editor? or in a parallel process event? (it looks rather fancy for 'call script')
ill play with it.. see if i can get it to work

Thank you! again...
*a brief history*
I have past exp with RPG maker and 2k3..a long time past.. but it was my main hobby back then (good ole don miguel)..so i remember quite a bit with eventing and such. (thats why parallel process with a state was one of my first ideas.."back in mah day..we had no fancy shmancy scripting!!" lol)
I also have coding exp from many years back using some C++, Action script, Ti-Basic, Basic, VB6..and a few others..however these were 10 years ago or so. some how, some of it comes back to me.. and others make my brain smoke lol.
so sometimes i look at stuff and say.. oh that will be easy!! then i write it..and ERROR ..and I'm like wtf!?

so please forgive my ignorance. hopefully ill pick it up quickly after some more practice.

:P

KK20

August 16, 2012, 09:58:13 pm #4858 Last Edit: August 16, 2012, 09:59:16 pm by KK20
Facepalming myself right now due to my inability to read clearly. You don't put the monster's database ID in the script (which is 33 in your case). You want to use the event's ID (which you said was 3).

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kiwa

OK! i removed part of MY code. Leaving only your code


if $BlizzABS.is_enemy?(3)
if $BlizzABS.enemy_can_perceive?(3,
ACTORS, PARTY)
$BlizzABS.enemy_change_state(3,
false, 18)
else
$BlizzABS.enemy_change_state(3,
true, 18)
end
end


and.....IT WORKS!!

If i fall from their perc circle range they drop their chase..which in some instances can work to my advantage and the players..
and i think Blizz had a script command to raise an enemys hearing, sight, and perc.
So i can use that..or perhaps make an entirely new monster

Any way! this is GREAT!
Thanks soooo much man!
you've been helping me a lot. I'm sure more questions will arise from me...if there is anything i can do for you in return PM me and let me know.

I'm not a good coder but I'm decently handy with pencil art and Icons(so far) i haven't really done any chip set or char mods since back in 2k3...like 7 or so years ago. so i cant say I'm worth a damn on that. even char development ...ect.. name it ill try my best!

Again thank you! :D