Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AI question about revive
#1
How to write AI for revive the char?
Reply
Thanks given by:
#2
First of all, welcome to LFE, also, I don't think you can revive a char using ai, ai stands for artificial intelligence , if you want to revive a char, use DC, add some body aka bdy to the specific chars you want to revive, and make an or at the same place as the bdy, it must be negative though.
Spoilered Spoilers (Click to View)

You're just dying if you're living and thinking about a betrayal, revive yourself.
Think about that one person that has trusted you forever, not the thousand people that have betrayed you.
Reply
Thanks given by:
#3
Thank yo for your reply,

I have already used DC to make some skills for revive,
unfortunately I don't know how to set AI for the com. player to revive me.

Is is possible to make it? When I die, and the com. player know that and revive me?
Reply
Thanks given by:
#4
Well it depends on whether the AI still works when a character is dead. Try doing a "print("something");" call and see if it still shows when your character is dead. If it does, then the way to do it is as follows:
    AI-Code:
if (self.hp <= 0)
    DuA(); //or whatever input you set for the skill.


However, if it doesn't print when you're dead, then it is most likely that you can't do it.

Edit: @bashs: Ah you're right. I thought the the OP managed to write a skill that revives himself, and he wants the computer to be able to use it and revive himself.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by: feiterry
#5
Shouldn't it be something like "self.team.hp < 0" if such a thing even exists? can you do that? (dammit, not being in school for 3 months made me forget about the names of programming).
Reply
Thanks given by:
#6
I think, if I understood correctly, feiterry wants the COM AI to find dead allies and revive them?

Code:
for (int i = 0; i < 400; i++){ //target
        if (loadTarget(i) == 0 && target.num != self.num && target.team==self.team && target.hp <= 0){
            // Some logic to execute the revive move and/or walk to target
            break;
        }
    }

Depending on the range of the revive you might have to make the AI walk to the person etc.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by: AmadisLFE , feiterry
#7
Thank you!!

you guess correctly, and sorry for my poor english,

Let me try if it is work or not~
Reply
Thanks given by:
#8
(07-27-2014, 02:16 AM)feiterry Wrote:  Thank you!!

you guess correctly, and sorry for my poor english,

Let me try if it is work or not~

I am an ai noob, so I didn't understand, anyway, if that works, click the solved button, also instead of thanking directly in post, you can also use the thank button ;), I hope you have fun in LFE :)
Spoilered Spoilers (Click to View)

You're just dying if you're living and thinking about a betrayal, revive yourself.
Think about that one person that has trusted you forever, not the thousand people that have betrayed you.
Reply
Thanks given by:
#9
A stupid question...

how can the AI walk near the char(HP=0)..?
Reply
Thanks given by:
#10
Please help~
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)