OscarScorp Posted November 5, 2019 Group: Members Topic Count: 62 Topics Per Day: 0.02 Content Count: 217 Reputation: 16 Joined: 01/28/15 Last Seen: February 25, 2022 Share Posted November 5, 2019 Hello, How can a skill run a command? I know atcommand "@command"; and useatcmd "@command"; in an NPC script but these won't work in SRC. I would like to run a special command when using a specific skill. Thank you in advance! Quote Link to comment Share on other sites More sharing options...
0 Easycore Posted November 6, 2019 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 220 Reputation: 258 Joined: 04/08/13 Last Seen: August 24, 2023 Share Posted November 6, 2019 is_atcommand(fd, sd, "@command", 1); 1 Quote Link to comment Share on other sites More sharing options...
0 LOOLP - OFF Posted November 5, 2019 Group: Members Topic Count: 12 Topics Per Day: 0.01 Content Count: 233 Reputation: 51 Joined: 12/20/18 Last Seen: March 10, 2021 Share Posted November 5, 2019 *unitskilluseid <GID>,<skill id>,<skill lvl>{,<target id>}; *unitskilluseid <GID>,"<skill name>",<skill lvl>{,<target id>}; *unitskillusepos <GID>,<skill id>,<skill lvl>,<x>,<y>; *unitskillusepos <GID>,"<skill name>",<skill lvl>,<x>,<y>; This is the replacement of the older commands, these use the same values for GID as the other unit* commands (See 'GID'). Skill ID is the ID of the skill, skill level is the level of the skill. For the position, the x and y are given in the unitSkillUsePos. Quote Link to comment Share on other sites More sharing options...
0 OscarScorp Posted November 5, 2019 Group: Members Topic Count: 62 Topics Per Day: 0.02 Content Count: 217 Reputation: 16 Joined: 01/28/15 Last Seen: February 25, 2022 Author Share Posted November 5, 2019 6 minutes ago, Disabled LOOLP said: *unitskilluseid <GID>,<skill id>,<skill lvl>{,<target id>}; *unitskilluseid <GID>,"<skill name>",<skill lvl>{,<target id>}; *unitskillusepos <GID>,<skill id>,<skill lvl>,<x>,<y>; *unitskillusepos <GID>,"<skill name>",<skill lvl>,<x>,<y>; This is the replacement of the older commands, these use the same values for GID as the other unit* commands (See 'GID'). Skill ID is the ID of the skill, skill level is the level of the skill. For the position, the x and y are given in the unitSkillUsePos. So there is no way to use a command through the SRC? Like in skill.cpp, when using Bash skill for example, run a command from @command. Quote Link to comment Share on other sites More sharing options...
0 Naruto Posted November 6, 2019 Group: Members Topic Count: 20 Topics Per Day: 0.01 Content Count: 416 Reputation: 74 Joined: 05/16/19 Last Seen: January 24, 2021 Share Posted November 6, 2019 yeah i mean you cant just do this? atcommand_whatever ( 0 , 0 , 0 , 0 ) + all your stuff in the skill stuff? not sure besides gutting it completely Quote Link to comment Share on other sites More sharing options...
0 OscarScorp Posted November 6, 2019 Group: Members Topic Count: 62 Topics Per Day: 0.02 Content Count: 217 Reputation: 16 Joined: 01/28/15 Last Seen: February 25, 2022 Author Share Posted November 6, 2019 On 11/6/2019 at 8:17 AM, Naruto said: yeah i mean you cant just do this? atcommand_whatever ( 0 , 0 , 0 , 0 ) + all your stuff in the skill stuff? not sure besides gutting it completely Yeah I'm trying adding lines such as: In skill.cpp: atcommand "@mycommand"; useatcmd "@mycommand"; atcommand_mycommand(); But these won't work. I only get errors in console when trying to recompile. And yes, @mycommand works by itself, but I want users to get acces to it through a Skill, not by typing the command Or is there a way to make a clif_displaymessage type of clif to not display a message but to make the user type a string automatically? Therefore, auto-typing a command. On 11/6/2019 at 10:36 AM, Easycore said: is_atcommand(fd, sd, "@command", 1); It works!! Thank you so much! I just had to add at the beginning: #include "script.hpp" #include "status.hpp" #include "unit.hpp" ++ #include "atcommand.hpp" Quote Link to comment Share on other sites More sharing options...
Question
OscarScorp
Hello,
How can a skill run a command?
I know atcommand "@command"; and useatcmd "@command"; in an NPC script but these won't work in SRC.
I would like to run a special command when using a specific skill.
Thank you in advance!
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.