[XP] Blizz-ABS

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

Previous topic - Next topic

Blizzard

The error is with Tons. Redownload part 3, I've put up a fixed version.
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.

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Aqua

Blizz, did you mean to redownload part 3 of Tons or ABS???
Because they both still don't work for me and I get the same error...

Gah I can't think with this giant headache.

nathmatt

tons is what i downloaded & it works but i am haveing trouble with the change event name part the is what im using

$game_map.rename_event(1,'\\e[1]')
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Sin86

I got a question about SDK. What exactly happens if you have SDK 2? Is it really a big of a deal if you have that? Also, is it possible for a SDK user to go from 2 to 1?

Aqua

March 28, 2008, 06:06:46 pm #285 Last Edit: March 29, 2008, 05:36:53 pm by Aqua
Errors!


Got when I go to a map with enemies
Edit:
I fixed this one... XD
Line 2463 should be:
in_sight_e = ai.sight.find_all {|b| ai.negative.include?(b.AI_data.basic)}



Got when I tried to select a skill in the controls menu.


Edit again:
Mmm... there are quite a few bugs I've found already w/o even being able to use skills (because of a bug) so I think it might be easier if I just contacted you on MSN in the morning.


Edit again and again...:
Blizz, most of the bugs are caused by typos in BABS and Tons which caused skills to be unusable.

For Tons, some of the config have !false and makes it not work.


But here are some other ones I found:

The members of the caterpillar only jump when the player is sneaking too.

Beam skill doesn't work :P
Script 'Blizz-Abs Part 3' line 5084: NoMethodError occurred.
undefined method '[]=' for 0:fixnum


Objects that have Player Touch for Trigger for event coding don't start when touched anymore.

The Main Character

oh no somany errors it must be hard scripting an abs

winkio

blizz, a cooldown time for skills/ period of invulnerability after being hit would be nice.  I just got pwned by a mage 5 levels below me!

Blizzard

You DO have a short period of invulnerability, it's the time where the main character is blinking. If you want enemies to wait longer before they attack, simply increase the "Enemy Behavior" option "AI Delay Time".

@The main character: I was doing those updates during the week of my exams. It's rather natural that I messed up. (^_^') But yeah, to maintain such a huge script isn't easy.

@Aqua: Damn... Alright, give me a few days, I'll put up v1.98 and fix Tons. And yes I meant Part 3 of Tons.

@Sin86: Blizz-ABS won't work with SDK 2.x. Going back should be possible, but it depends on which SDK dependant scripts you are using. I'm not sure if Blizz-ABS will fully work with SDK 1.x, but this is much more likely than with SDK 2.x.
Now, the problems that happen with SDK 2.x are, first off, the automatic disposal. SDK disposes windows and stuff automatically when exiting a scene, so the attempt to dispose stuff in Blizz-ABS's mods of the scenes will cause a crash. Other problems were edits in the some scripts and the splitting of methods. I just remember that I once tried to see what the problems were so I could fix them, but after 15 minutes of constanly new errors (I only overrode the problems, I didn't fix them), I realized that making those two compatible would be a hell of a job, expecially with Blizz-ABS being a complicated 5000+ lines of code script. SDK 1.x wasn't messed up so much, so it might work with Blizz-ABS up to some level. That's why I added "80% compatible with SDK 1.x, 40% compatible with SDK 2.x" in the manual.

@nathmatt: What exactly happens?
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.

winkio

Oh Blizz, i forgot to mention that the mage had the full-power attribute on so it is more agressive.  I want it to keep being agressive (move towards me) and ignore the AI timer when moving but not ignore the AI timer for attacking/skill use.  I notice that although you setup both 'agressive' and 'offensive' in part 2, you only use 'agressive' in part 3.  Does that mean that 'offensive' is going to be in 2.00?  What do 'offensive' and 'agressive' do?

Blizzard

No, no, you got that wrong. The passive attribute will only make them not attack you first, the full power attribute will make the override the AI Delay Timer. The enemy will stand in a distance away from you as long as the timer hasn't expired. THEN he will attack/use a skill. That means he will always go towards you, but not too close, when being in combat mode.

That what you have seen about "aggressive" and "offensive" has nothing to do with enemies, it's for allies. (Enemies don't have the passive attribute as variable, but as a method, just find def passive and def origin_aggressive and you'll see what I mean.) This is a chapter from the manual 2.0 describing what it will be for:

Quote from: Manual 2.04.3.2. Ally Combat AI

Ally combat AI can be set up by the player in the "AI setup" menu that can be accessed from the Blizz-ABS pre-menu. There the ally can be set up how aggressive/passive and how offensive/defensive to act. Aggressive allies will engage into combat with every possible enemy while passive allies will never get involved into combat, even if attacked. Offensive allies will never use anything different than offensive actions while defensive allies will never attack or use any sort of offensive action. You can enforce the aggressive/passive and offensive/defensive behavior for specific actors. In this case simply use a "Call Script" Event Command and type down one of those four possible commands:
$game_actors[ID].force_aggressive = X
$game_actors[ID].force_offensive = X
$game_party.actors[POS].force_aggressive = Y
$game_party.actors[POS].force_offensive = Y
ID is the ID of the actor in the database, POS the position of the actor in the party (starts from 0, not 1!), X and Y are the forced values of the behavior. X and Y can range from 1 to 15 where 1 means highly aggressive/offensive and where 15 means highly passive/defensive. If a forced value is being used, the player will not be able to change the behavior in the menu by himself. To disable the behavior enforcement you can use the same commands, but with 0 as new setting. This will restore the player's previous setting and allow him to change the behavior again. This allows you to use i.e. forced behavior for "highly aggressive" characters (a character is angry story-wise, etc.). Your imagination is the only limitation.


Remember the 4x4 behavior grid in SoM for CPU controlled allies? That's basically it. :)
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.

winkio

oh, ok.  I just decided to add in a few lines of code to make it so that full power enemies would only ignore the timer when moving, and the time would decrease twice as fast when standing still.  i find it much more balanced.  Thanks anyways, and now I understand it a whole lot better! ;D

the main character

ohh a preview of tat manual nice yup lookin forward to 2.00 cuz i got tat error tat aqua was takin bout but keep up the good work blizz u a really good scripter hope u did good on them exams 2

Blizzard

March 30, 2008, 01:44:42 pm #293 Last Edit: March 30, 2008, 01:46:30 pm by Blizzard
No problem, if you want it that way, simply edit it. I hope you can figure out the code. It's in Map_Enemy#update, those lines here:

     # decrease delay timer
   @AI_data.act[3] -= 1
   # if action exists
   if @AI_data.act[1] != 0
     # if leader and counter expired and only sometimes
     if @AI_data.leader && @AI_data.act[3] <= 0 && rand(100) < 10
       # all minions
       @AI_data.minions.each {|b|
           # 50% chance if they have an action pending
           if b.AI_data.act[1] != 0 && rand(2) == 0
             # force into action
             b.AI_data.act[3] = 0
             # 50% chance for same target
             b.AI_data.target = @AI_data.target if rand(2) == 0
           end}
     end
     # projectile evasion processing if attribute "defensive" is active
     BlizzABS::AI.evade_projectiles(self) if @AI_data.defensive
     # if running away and counter expired
     if self.escaping && @AI_data.act[3] <= 0
       # remove target and delete action
       @AI_data.target, @AI_data.act = nil, [0, 0, 0, 0]
     # if delay timer below lower boundry
     elsif @AI_data.act[3] <= rand(201)-400
       # set timer again
       @AI_data.act[3] = rand(2*BlizzABS::Config::AI_DELAY_TIME)
     end
   end


@the main character: Thanks, I did pretty well on the exams. ^_^ I'll see if I can release 1.98 in the next few days to fix those dumb bugs. :<
And yeah, that feature in 2.0 will be under AI Setup in the menu, that's what it's for. I'm thinking of a grid view like in SoM, but with 15x15 possible values instead of just 4x4.
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.

Aqua

Quote from: Blizzard on March 30, 2008, 01:44:42 pm
No problem, if you want it that way, simply edit it. I hope you can figure out the code. It's in Map_Enemy#update, those lines here:

     # decrease delay timer
    @AI_data.act[3] -= 1
    # if action exists
    if @AI_data.act[1] != 0
      # if leader and counter expired and only sometimes
      if @AI_data.leader && @AI_data.act[3] <= 0 && rand(100) < 10
        # all minions
        @AI_data.minions.each {|b|
            # 50% chance if they have an action pending
            if b.AI_data.act[1] != 0 && rand(2) == 0
              # force into action
              b.AI_data.act[3] = 0
              # 50% chance for same target
              b.AI_data.target = @AI_data.target if rand(2) == 0
            end}
      end
      # projectile evasion processing if attribute "defensive" is active
      BlizzABS::AI.evade_projectiles(self) if @AI_data.defensive
      # if running away and counter expired
      if self.escaping && @AI_data.act[3] <= 0
        # remove target and delete action
        @AI_data.target, @AI_data.act = nil, [0, 0, 0, 0]
      # if delay timer below lower boundry
      elsif @AI_data.act[3] <= rand(201)-400
        # set timer again
        @AI_data.act[3] = rand(2*BlizzABS::Config::AI_DELAY_TIME)
      end
    end


@the main character: Thanks, I did pretty well on the exams. ^_^ I'll see if I can release 1.98 in the next few days to fix those dumb bugs. :<


*is confuzzled by the code*
Yeah... I think I'm just gonna stick to finding bugs and reporting them to you XD

Blizzard

March 30, 2008, 01:48:26 pm #295 Last Edit: March 30, 2008, 01:53:06 pm by Blizzard
      # projectile evasion processing if attribute "defensive" is active
      BlizzABS::AI.evade_projectiles(self) if @AI_data.defensive


<3

EDIT:

    #--------------------------------------------------------------------------
    # evade_projectiles
    #  char - the character
    #  This method checks whether there are projectiles that could hit the
    #  character and determines the reaction of the character at the threat.
    #--------------------------------------------------------------------------
    def self.evade_projectiles(char)
      # temporary variable and get pixel movement rate
      ai, pix = char.AI_data, BlizzABS.pixel
      # find all projectiles within sight or close hearing that can hit char
      projectiles = BlizzABS::Cache.projectiles.find_all {|p|
          BlizzABS::Config::PERCEPTION_RANGE * 128 >=
          Math.hypot(p.real_x-char.real_x, p.real_y-char.real_y) &&
          ![1, 7, 8, 11, 12].include?(p.type) && p.group.include?(ai.basic) &&
          !BlizzABS::AI.wall?(char, p.x, p.y) &&
          (BlizzABS::Config::PERCEPTION_RANGE * 256 / 5 >=
          Math.hypot(p.real_x-char.real_x, p.real_y-char.real_y) ||
          BlizzABS::AI.can_perceive_char?(char, p.real_x, p.real_y,
          char.direction))}
      # check every projectile
      projectiles.each {|i|
          # create affection area rectangle for projectile
          range = case i.direction
          when 2
            Rect.new(i.real_x/4+8, i.real_y/4+8, 16, i.y*32/pix-i.real_y/4+24)
          when 4
            Rect.new(i.x*32/pix+8, i.y*32/pix+8, i.real_x/4-i.x*32/pix+24, 16)
          when 6
            Rect.new(i.real_x/4+8, i.real_y/4+8, i.x*32/pix-i.real_x/4+24, 16)
          when 8
            Rect.new(i.x*32/pix+8, i.y*32/pix+8, 16, i.real_y/4-i.y*32/pix+24)
          end
          # if this projectile will hit char
          if BlizzABS.intersection(range, Rect.new(char.real_x/4,
              char.real_y/4, 32, 32))
            # depending on how to quicker evade it
            dir = case i.direction
            when 2, 8 then (char.x >= i.x ? 6 : 4)
            when 4, 6 then (char.y >= i.y ? 2 : 8)
            end
            # if actually passable
            if char.passable?(char.x, char.y, dir)
              # move in that direction now
              char.force_move.unshift([dir, false])
            # if passable in opposite direction
            elsif char.passable?(char.x, char.y, i.direction)
              # move away now
              char.force_move.unshift([i.direction, false])
            end
          end}
    end


<3 <3 <3

EDIT: Wow, that condition to determine whether a projectile can hit the char is really complicated. I know, it's not "nicely" coded, but then again, people won't most probably ever need to bother about that method and I need high performance, so I can't bother with using extra code for the sake of readability.
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.

Aqua

Quote from: Blizzard on March 30, 2008, 01:48:26 pm
      # projectile evasion processing if attribute "defensive" is active
      BlizzABS::AI.evade_projectiles(self) if @AI_data.defensive

<3


*is still confused...*

Ooh can't wait for BABS2 so then my caterpillar chars can pwn people too :P
(and then I can find bugs)

nathmatt

March 30, 2008, 03:26:33 pm #297 Last Edit: March 30, 2008, 03:35:05 pm by nathmatt
sorry about that but i believe it was the same arror aqua was having when enemy was on map





edit some ideas for v2.0


u could make the ai somthing like fnal fantasy's 13
not quite the same but as far as the when hp =>70% use cure things like that
could add on option to need them as items if you wanted ppl to have to earn them
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

::)

Quote from: TEH MANUAL 2.04.3.3. Ally Trigger AI

The Ally Trigger AI is a Blizz-ABS specific feature that can be set up in the "AI setup" menu as well. A similar system exists in the commercial game "Final Fantasy XII" and is called "Gambits". The player is able to set up conditions, actions and execution probability in a user-friendly menu. If the conditions are met, the action will be executed. The closer a trigger is to the top of the list, the higher priority it has. Actions will ony be executed if they actually can by executed (i.e. an item can't be used if there are none left in the inventory).
Important note: Any Ally Trigger AI action will override Ally Combat AI setup!
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.

Aqua

Quote from: Blizzard on March 30, 2008, 03:39:53 pm
::)

Quote from: TEH MANUAL 2.04.3.3. Ally Trigger AI

The Ally Trigger AI is a Blizz-ABS specific feature that can be set up in the "AI setup" menu as well. A similar system exists in the commercial game "Final Fantasy XII" and is called "Gambits". The player is able to set up conditions, actions and execution probability in a user-friendly menu. If the conditions are met, the action will be executed. The closer a trigger is to the top of the list, the higher priority it has. Actions will ony be executed if they actually can by executed (i.e. an item can't be used if there are none left in the inventory).
Important note: Any Ally Trigger AI action will override Ally Combat AI setup!



OMG GAMBIT SYSTEM!!! :D
Hehe I was playing FFXII today too :P
I pwned some hunts... but Larsa always died XD