Likes: 0
Results 1 to 3 of 3
-
02-07-09, 03:48 PM #1
[Tutorial] Compiling custom scripts
Register to remove this adHere is a handy guide on how to compile custom scripts for those who don't know how
THE SCRIPT IM USING AS AN EXAMPLE IS TELEPORTER FROM Gastricpenguin
Heres one way to compile scripts even if you have almost 0 C++ knowledge.
First you need to compile Ascent/Arcemu core.
Now head to ascentdirectory/src/scripts/src
Now take GossipScripts and copy and paste a new folder out of it by right clicking it and copy then right clicking and paste.
You now have this
Now rename it to anything you want i will be renaming it CustomScript just for the guide youu can name it anything you want.
Now its time to edit the makefile.am Open up MakeFile.am still inside the src/scripts/src folder and it shoudl say the following
Code:SUBDIRS = GossipScripts InstanceScripts ServerStatusPlugin SpellHandlers LUAScripting
Code:SUBDIRS = GossipScripts CustomScript InstanceScripts ServerStatusPlugin SpellHandlers LUAScripting
Now close the makefile and delete'
Code:Gossip_Battlemaster.cpp Gossip_Innkeeper.cpp GuardGossip.cpp
Now you add your scripts in (the .cpp's)
I am only adding the teleporter so i have this now
Now head to CustomScript and open makefile.am in notepad
You should see this on the bottom line
Code:libGossipScripts_la_SOURCES = Gossip_Battlemaster.cpp Gossip_Innkeepers.cpp GuardGossip.cpp Setup.cpp
Code:libGossipScripts_la_SOURCES = Script Name.cpp Setup.cpp
Change Script Name to your script name
Ok Now it is time to open up Setup.cpp and this should be in the middle
Code:extern "C" SCRIPT_DECL uint32 _exp_get_script_type() { return SCRIPT_TYPE_MISC; } extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr) { SetupInnkeepers(mgr); SetupBattlemaster(mgr); SetupGuardGossip(mgr); } #ifdef WIN32
Code:SetupInnkeepers(mgr); SetupBattlemaster(mgr); SetupGuardGossip(mgr);
now open your script (.cpp) and search for
Code:class SCRIPT_DECL
Code:class SCRIPT_DECL Pwarper : public GossipScript
Now go back to your Setup.cpp and where the
Code:SetupInnkeepers(mgr); SetupBattlemaster(mgr); SetupGuardGossip(mgr);
Code:SetupPwarper(mgr);
it now looks like this
Code:extern "C" SCRIPT_DECL uint32 _exp_get_script_type() { return SCRIPT_TYPE_MISC; } extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr) { SetupPwarper(mgr); } #ifdef WIN32
Should say
Code:#ifndef INSTANCE_SCRIPTS_SETUP_H #define INSTANCE_SCRIPTS_SETUP_H void SetupInnkeepers(ScriptMgr * mgr); void SetupGuardGossip(ScriptMgr * mgr); void SetupBattlemaster(ScriptMgr * mgr); #endif
Code:void SetupInnkeepers(ScriptMgr * mgr); void SetupGuardGossip(ScriptMgr * mgr); void SetupBattlemaster(ScriptMgr * mgr);
Code:void SetupPwarper(ScriptMgr * mgr);
ALMOST DONE!!!!
Head to the Ascent root folder and look for configure.ac
Inside configure.ac search for ASCENT_CONFIG_FILES
You should see
Code:AC_CONFIG_FILES([ ./Makefile src/Makefile src/ascent-shared/Makefile src/ascent-world/Makefile src/ascent-logonserver/Makefile src/ascent-voicechat/Makefile src/ascent-realmserver/Makefile src/scripts/Makefile src/scripts/src/Makefile src/scripts/src/GossipScripts/Makefile src/scripts/src/InstanceScripts/Makefile src/scripts/src/ServerStatusPlugin/Makefile src/scripts/src/SpellHandlers/Makefile src/scripts/src/LUAScripting/Makefile extras/Makefile extras/collision/Makefile extras/collision/collision_dll/Makefile ])
Code:AC_CONFIG_FILES([ ./Makefile src/Makefile src/ascent-shared/Makefile src/ascent-world/Makefile src/ascent-logonserver/Makefile src/ascent-voicechat/Makefile src/ascent-realmserver/Makefile src/scripts/Makefile src/scripts/src/Makefile src/scripts/src/GossipScripts/Makefile src/scripts/src/InstanceScripts/Makefile src/scripts/src/ServerStatusPlugin/Makefile src/scripts/src/CustomScript/Makefile src/scripts/src/SpellHandlers/Makefile src/scripts/src/LUAScripting/Makefile extras/Makefile extras/collision/Makefile extras/collision/collision_dll/Makefile ])
head to Ascent/src/scripts/projects
And look for GossipScripts2003,2005, or 2008 depending on what visual studio you have. I am using 2008
Copy and paste it to make a copy then rename your copy anything you want.
Now you have to open it up with notepad and use Find and Replace you want to change the word GossipScripts to CustomScript then click replace all now save and open with Visual Studio.
Now click the little + sign next to CustomScript and delete all the files in them then go to Add then Existing Item and add your Setup.h and Setup.cpp from your CustomScript folder and also add your script.
the Setup files go in main resources and your script goes in Scripts.
Now just hit F7 and away you go!
This will not work unless you have already compiled ascent
--------------------------------
CREDITS
Onlykl for making tutorial
› See More: [Tutorial] Compiling custom scriptsLast edited by Onlykl; 02-07-09 at 04:21 PM.
-
02-07-09, 10:45 PM #2
Pretty detailed guide, good job, should help tons of private server owners who are willing to customize their server a bit, should be easy to follow for anyone, since theres screenies
-
03-07-09, 06:01 AM #3
Register to remove this adi made my best so if they has any problem they can ask me here