Jump to content

Idiots Guide for SAI

Recommended Posts

Hi All,

I have just written my first SAI script, copying from another and it was a partial success.

I do not know how to create text for an NPC to say, and how/where to link it. I think it is connected with a data script, but no details.

I do not know how to stop an NPC from attacking.

Are there any resources available to assist?

I have looked at the SAI Editor for Keira2, it is very good, but linking up a working SAI with an Idiots Guide to how to show text, stop attacking, run away to a certain point, etc would be very helpful.

An extremely complex SAI like insertwww.wowhead.com/quest=29678/shu-the-spirit-of-water seems daunting to write.

If the information is available via sniffs, then that would be fantastic, I have installed the sniff tool but live is so volatile atm that it is out of date, and even were it to be rewritten most likely live will be patched at least once per week for the near future, so it might not be worth the effort.

TLDR: I can't work out how to write SAI scripts, please help




Share this post

Link to post
Share on other sites
On 2017-04-22 at 3:29 PM, Nay said:

Both of those links lack details and in some ways they are out of date. They are by no means a step by step guide. This is what I consider a step by step guide. :P

Even as a person who has a lot of experience working with C++, SQL, and other languages, it's taking a while for me to grasp the processing flow of SAI scripts. It is a smart system, so to speak, but it's very opaque compared to say, C++ script, which has functionality that is immediately obvious to understand in its entirety just by reading the C++.

I'm actually kinda bummed that ADD_GOSSIP_ITEM() was removed, because when you use gossip menu generated from `world`.`gossip_menu_option` with a custom C++ script the menuId in

bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 menuId)

always is 1. As such, the function isn't provided any useful information as which option the player clicked.

Like I said though, SAI scripting is a good system, it's an extensible system, but it's not a particularly well documented or clear system at the moment.

I've been puttering away at making a trinket invoked character who offers helpful services via SAI script. What I have working (for 3.3.5a) atm is the trinket, the character, and one utility on conversation for 5 gold. The SQL here,


It's heavily commented, because I am old and I need to remember things. When it's finished, I'll likely post a verbose guide on my site.

SAI is nifty way to add content and probably pretty quick once you get the hang of it, but from a "programming as a hobby" perspective it's kinda boring: Poking bits into a database is data entry, not programming. lol...

Edited by Tatwi

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Saben
      Currently, I am trying to get wastewalker Workers to use the mining emote when out of combat.
      I am currently trying this to no avail.
      -- Wastewalker Worker SAI SET @ENTRY := 17964; UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`[email protected]; DELETE FROM `smart_scripts` WHERE `entryorguid`[email protected] AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES (@ENTRY,0,0,0,1,0,100,6,0,0,0,0,17,233,0,0,0,0,0,0,0,0,0,0,0,0,0,"Wastewalker Worker - Out of Combat - Set Emote State 233 (Dungeon)"), (@ENTRY,0,1,0,0,0,100,4,2300,7700,8000,11000,11,37662,32,0,0,0,0,5,0,0,0,0,0,0,0,"Wastewalker Worker - In Combat - Cast 'Rend' (Heroic Dungeon)"), (@ENTRY,0,2,0,2,0,100,7,0,15,0,0,25,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"Wastewalker Worker - Between 0-15% Health - Flee For Assist (No Repeat) (Dungeon)"), Edit: It appears to work in normal (not sure if that is from me), but not heroic. I tried copying the same smart_script with the heroic entry ID and that didn't work.
    • By Inky
      Hey all!

      I've been thinking, after I saw this introduction in the spanish part of the forum, this guy who wants to help out in any way he can... Given the fact that he didn't specify if he has any knowledge in developing of any kind the first thing I thought was in the missing gossip.
      But then again, there's nowhere to post that in spanish, if there are users that can't understand/speak english.

      Maybe we could make a "Help us gather missing gossip" kindda post but translated in spanish and pin it on the localized forums.
      You could also do the same with the "Converting EAI to SAI", because I know there are a lot of developers out there that know how to do it but don't speak english at all.

      Just something to think about, if you ask me this would be very efficient and "welcoming" for hispanic people (of course it could/should be done in all the other languages).
      I myself could help out in the spanish and portuguese sections.

      Cheers, XOXO!