Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AI problem
#1
I have written this small script for template:
    C-Code:
int ego(){
if (self.state == 14){
clr();
print("Ouch!, that hurts");
}
return 0;
}

and I have saved it as "0.as" in the AI folder.

I wanted to do somthing like when template will go to lying state, the console will show the text "Ouch!, that hurts". But when template goes to lying state the console shows nothing. Please anyone help me and state the mistakes in this script.
Thanks!
(Remember that I am just a noob in AI scripting.)
Life is like a bicycle; to keep your balance, you must keep moving.
Reply
Thanks given by:
#2
I believe that id 0 will not work with scripts yet, try changing Template's id to a different number (and also rename 0.as appropiately).
Quote of the Day f***ing Year (Click to View)
Reply
Thanks given by:
#3
You forgot a semicolon.
The console reports these errors during compilation.
Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
Reply
Thanks given by:
#4
(08-25-2012, 03:36 PM)Ramond Wrote:  I believe that id 0 will not work with scripts yet, try changing Template's id to a different number (and also rename 0.as appropiately).

Kind of true. It won't work with ego() because ego is never called on ID 0.

Ramond edited this post 08-25-2012 08:27 PM because:
Or that :P I just remember something didn't work with me and BP so we changed the ID.
[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:
#5
Even after changing the id it did not work
(08-25-2012, 04:19 PM)Someone else Wrote:  You forgot a semicolon.
The console reports these errors during compilation.

oh sorry I forget to give the semicolon while writing the post.
please someone help me.
please someone help me.
Life is like a bicycle; to keep your balance, you must keep moving.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)