Author Topic: [FFVIII-PCSteam] Removing something in the AI code <Solved>  (Read 276 times)

Hazedge

  • Cool newbie
  • *
  • Posts: 86
  • Karma: 1
    • View Profile
Hey guys!
I was trying to program one specific AI and got stuck in something thats not working (or I'm doing it the wrong way).

Code: [Select]
if (self.status == BLIND) {
self.varDD += 1
if (self.varDD >= 5) {
self.status - BLIND
                self.varDE += 1
}
}

My intention is to remove the status BLIND when the varDD gets to 5 or more and make the enemy use BERSERK when self.varDE gets to 3, but the program don't recognize the minus in self.status - BLIND.
Is there a right way to make it work?
I can't make variables do the same thing too, all I could do is put then to = 0 instead of - value.

EDIT:
Taking advantage of this post, what code should I use to change one enemy's resistence?
In this case I want to make him immune to BLIND when BERSERK is used.
« Last Edit: 2018-10-02 00:58:41 by Hazedge »

Girl next door

  • Crazy poster
  • *
  • Posts: 133
  • Karma: 4
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #1 on: 2018-10-01 14:44:41 »
I't's self.status != BLIND

But I don't think it will work anyway. If it is, that should be interesting !

Hazedge

  • Cool newbie
  • *
  • Posts: 86
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #2 on: 2018-10-01 14:47:53 »
I't's self.status != BLIND

But I don't think it will work anyway. If it is, that should be interesting !
I've put self.status == BLIND on purpose, the logic is to count stacks for each turn hes blinded to enter BERSERK and become immune to BLIND.

EDIT:
OH YOU MEAN THATS THE CODE!! ROFL
Sorry I interpreted it wrong xD
I'm gonna try it right away

EDIT2:
Nop, not happening.
Syntax Error, no viable alternative at input
I thought about changeresistance(arg1, arg2) but I think it only work with elements, not status.
« Last Edit: 2018-10-01 15:03:27 by Hazedge »

Girl next door

  • Crazy poster
  • *
  • Posts: 133
  • Karma: 4
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #3 on: 2018-10-01 16:12:19 »
That's what I thought. ;) And yes, the changeresistance is only for elements.

gaaasstly

  • Fast newbie
  • *
  • Posts: 38
  • Karma: 2
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #4 on: 2018-10-01 16:38:21 »
What language is this? Does it support bitwise operators (if not, what is the equivalent)? What is the type of self.status and BLIND?

Leythalknight

  • Fast newbie
  • *
  • Posts: 16
  • Karma: 2
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #5 on: 2018-10-01 17:06:44 »
If nothing else works, you could achieve a similar effect by using magicid to make the Berserk animation play on the enemy, changestat to increase its ATK, and making it spam an attack with 255 Hit after being Blinded for X turns.

Edit: Made a simple AI script for this. Should work, though you'd have to add in the other abilities the monster uses beneath the if self.varDE == 0.

Code: [Select]
if (self.varDE == 0) {
    if (rand() % 3 == 0) {
        target(201)
        domoveid(0)
    }
}
if (self.status == BLIND) {
    self.varDD += 1
}
if (self.varDD >= 5) {
    if (self.varDE == 0) {
        target(200)
        unknown05(15)
        magicid(108)
        changestat(0, 15)
        self.varDD = 0
        self.varDE = 1
    }
}
if (self.varDE == 1) {
    target(201)
    domoveid(1)
}


Edit 2: This script will make the enemy cast Esuna on itself after 5 turns of being Blinded, then fill its ATB and make it cast Berserk on itself:

Code: [Select]
if (self.status == BLIND) {
    self.varDD += 1
}
if (self.varDD >= 5) {
    if (self.varDE == 0) {
        target(200)
        domoveid([Esuna # goes here])
        fillatb()
        self.varDD = 0
        self.varDE = 1
    }
}
if (self.varDE == 1) {
    target(200)
    domoveid([Berserk # goes here])
    self.varDE = 0
}

You can change Berserk's condition to a self.varDE of 3 if you'd prefer. Remedy/Eye Drops also work in place of Esuna if the enemy can be Silenced.
« Last Edit: 2018-10-01 18:47:40 by Leythalknight »

Hazedge

  • Cool newbie
  • *
  • Posts: 86
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #6 on: 2018-10-01 23:07:40 »
Thats some pretty interesting ideas.
I was thinking about Esuna if I ran out of ideas for too long as well but was letting it as last resort.

The monster in question is the T-Rexaur. In the mod I was planning to give a big surprise to players who think this game is the same, so I was putting him to give a surprise react: when blinded for too long, he enters in a rage mode and start attacking with higher SPD.

Since we cant remove the status then the HIT 255 is a good choice, I liked it
Whats this unknown05(15)? Sorry my ignorance, I'm still learning new codes for these AIs

Leythalknight

  • Fast newbie
  • *
  • Posts: 16
  • Karma: 2
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #7 on: 2018-10-01 23:43:36 »
Thats some pretty interesting ideas.
I was thinking about Esuna if I ran out of ideas for too long as well but was letting it as last resort.

The monster in question is the T-Rexaur. In the mod I was planning to give a big surprise to players who think this game is the same, so I was putting him to give a surprise react: when blinded for too long, he enters in a rage mode and start attacking with higher SPD.

Since we cant remove the status then the HIT 255 is a good choice, I liked it
Whats this unknown05(15)? Sorry my ignorance, I'm still learning new codes for these AIs

I think that's a neat idea. I really dislike how Blind cripples physical attackers.

unknown05(15) is something included in Elvoret's AI before it calls the Storm Breath animation that takes Biggs and Wedge out of the battle. Not even those JP AI scripts I linked you know what it does, but I included it since it may have something to do with calling the magicid. I've used it in an enemy's AI before and it didn't cause any problems, at least.

Hazedge

  • Cool newbie
  • *
  • Posts: 86
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #8 on: 2018-10-02 00:02:42 »
Something odd happened (and kinda funny xD)

I've used this code on T-Rexaur
Code: [Select]
if (self.status == CONFUSION) {
    target(207)
    domoveid(0)
    return
}
if (self.status == BLIND) {
if (self.status != BERSERK) {
self.varDD += 1
if (self.varDD >= 5) {
target(200)
domoveid(3)
changestat(6, 255)
return
}
}
}
if (rand() % 3 == 0) {
target(204)
domoveid(1)
}
else {
target(201)
domoveid(0)
}

He acts normally, attacking and using tail attack sometimes and all... When I use Blind I counted 5 turns and he did uses Berserk, but then he had an inverted effect ROFL instead of running around like crazy trying to bite then all, he decided to just stay put, give a look to one party member, say "good day sir" AND CONTINUE TO JUST STAND THERE LMAO
Seriously, he just turn to one party members direction and thats it, I was like "wth is going on? whys he so passive? did he became a gentlemen????"

EDIT:
The changestat is correct? I dont know if 6 is the HIT stat, I know these:
0 = STR
1 = VIT
2 = MAG
3 = SPR
4 = SPD
5 = LUK
Or am I wrong somewhere?
« Last Edit: 2018-10-02 00:06:54 by Hazedge »

Leythalknight

  • Fast newbie
  • *
  • Posts: 16
  • Karma: 2
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #9 on: 2018-10-02 00:10:48 »
Something odd happened (and kinda funny xD)

I've used this code on T-Rexaur
Code: [Select]
if (self.status == CONFUSION) {
    target(207)
    domoveid(0)
    return
}
if (self.status == BLIND) {
if (self.status != BERSERK) {
self.varDD += 1
if (self.varDD >= 5) {
target(200)
domoveid(3)
changestat(6, 255)
return
}
}
}
if (rand() % 3 == 0) {
target(204)
domoveid(1)
}
else {
target(201)
domoveid(0)
}

He acts normally, attacking and using tail attack sometimes and all... When I use Blind I counted 5 turns and he did uses Berserk, but then he had an inverted effect ROFL instead of running around like crazy trying to bite then all, he decided to just stay put, give a look to one party member, say "good day sir" AND CONTINUE TO JUST STAND THERE LMAO
Seriously, he just turn to one party members direction and thats it, I was like "wth is going on? whys he so passive? did he became a gentlemen????"

EDIT:
Is it the changestat? I dont know if 6 is the HIT stat, I know these:
0 = STR
1 = VIT
2 = MAG
3 = SPR
4 = SPD
5 = LUK
Or am I wrong somewhere?

I don't think there's a way to modify Hit using changestat since hit percentages for enemy attacks are calculated using Attack Parameter in the moves' data. T-Rexaur will either have to heal its Blindness or you'll have to use the psuedo-Berserk effect and make it use an attack that always hits instead of its normal ones. You can modify an unused enemy attack for this.

Hazedge

  • Cool newbie
  • *
  • Posts: 86
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #10 on: 2018-10-02 00:24:27 »
Thats gonna be extremely hard... The thing is, theres alot of Unnamed Enemy Attacks around the Doomtrain program, but I know some of then are still being used. The problem is knowing which one I can use.

Leythalknight

  • Fast newbie
  • *
  • Posts: 16
  • Karma: 2
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #11 on: 2018-10-02 00:25:56 »
Thats gonna be extremely hard... The thing is, theres alot of Unnamed Enemy Attacks around the Doomtrain program, but I know some of then are still being used. The problem is knowing which one I can use.

I'm know there are others, but I'm pretty sure that #235, Barrier Change, is never actually used despite being in Bahamut's list of abilities. You'd have to use Carbuncle to change its name though.

Hazedge

  • Cool newbie
  • *
  • Posts: 86
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #12 on: 2018-10-02 00:27:45 »
I'm know there are others, but I'm pretty sure that #235, Barrier Change, is never actually used despite being in Bahamut's list of abilities. You'd have to use Carbuncle to change its name though.
Hummm... Good to know (and yeah I've changed everything about Bahamut's AI so this is certainly not being used)
Im gonna try it out and post here the results!

EDIT:
Question about the changestat, the value on arg2 is a bonus or is an exact value? For example: changestat(0, 20) <= is it adding 20 STR or putting it exactly to 20?
« Last Edit: 2018-10-02 00:34:20 by Hazedge »

Leythalknight

  • Fast newbie
  • *
  • Posts: 16
  • Karma: 2
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #13 on: 2018-10-02 00:41:54 »
Hummm... Good to know (and yeah I've changed everything about Bahamut's AI so this is certainly not being used)
Im gonna try it out and post here the results!

EDIT:
Question about the changestat, the value on arg2 is a bonus or is an exact value? For example: changestat(0, 20) <= is it adding 20 STR or putting it exactly to 20?

It's percentage-based, but I'm not sure of the exact values. According to FFVIII guides out there, Raijin's STR is doubled when in Aura status, which would mean a changestat value of 15 doubles a stat.

edit: Judging from GIM52A's AI, it may be that

10 = 100%
15 = 150%
20 = 200%
« Last Edit: 2018-10-02 00:44:00 by Leythalknight »

Hazedge

  • Cool newbie
  • *
  • Posts: 86
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Removing something in the AI code
« Reply #14 on: 2018-10-02 00:57:58 »
Its done!
Now T-Rexaur is beating the ?#%& out of everyone hahaha!
Thanks for the info guys, you all helped me alot!

Girl next door +1 Like
Leythalknight +1 Like
« Last Edit: 2018-10-02 13:15:13 by Hazedge »