[HOWTO] Compile custom scripts  
Old 06-09-2008, 03:07 AM   #1
hellspawn93
 
Join Date: Sep 2007
Posts: 20
hellspawn93 is on a distinguished road
Here is a handy guide on how to compiel custom scripts for those who dont know how


THE SCRIPT IM USING AS AN EXAMPLE IS PORTABLE TELEPORTER FROM ASPIREDEV

Heres one way to compile scripts even if you have almost 0 C++ knowledge.

First off do a fresh compile of Ascent.


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
What you want it to say is

Code:
SUBDIRS = GossipScripts CustomScript InstanceScripts ServerStatusPlugin SpellHandlers LUAScripting
Change customscript to whatever you named your folder

Now close the makefile and delete'

Code:
Gossip_Battlemaster.cpp
Gossip_Innkeeper.cpp
GuardGossip.cpp
you should have this



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
Change it to

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
delete

Code:
 SetupInnkeepers(mgr);
    SetupBattlemaster(mgr);
    SetupGuardGossip(mgr);
LEAVE THIS OPEN

now open your script (.cpp) and search for

Code:
 class SCRIPT_DECL
For example the Portable Teleporter says
Code:
class SCRIPT_DECL Pwarper : public GossipScript
Pwarper is what you need.

Now go back to your Setup.cpp and where the

Code:
 SetupInnkeepers(mgr);
    SetupBattlemaster(mgr);
    SetupGuardGossip(mgr);
Was add

Code:
SetupPwarper(mgr);
change Pwarper to whatever your script says

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
Now close and save Setup.cpp and open up Setup.h

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
Delete
Code:
void SetupInnkeepers(ScriptMgr * mgr);
void SetupGuardGossip(ScriptMgr * mgr);
void SetupBattlemaster(ScriptMgr * mgr);
And add

Code:
void SetupPwarper(ScriptMgr * mgr);
Pwarper being what you got from your script.

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
])
and your going to want to change it to this

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
])
REMEMBER CUSTOMSCRIPT IS YOUR FOLDER NAME.

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

Aldaus for the original guide.
HellSpawn for spending hours re-writing and updating it to look like the recent ascent (openascent)

Last edited by hellspawn93; 06-09-2008 at 03:20 PM.
hellspawn93 is offline   Reply With Quote
 
Old 06-09-2008, 09:41 AM   #2
goldensilver
 
goldensilver's Avatar
 
Join Date: Jan 2008
Posts: 37
goldensilver is an unknown quantity at this point
Brilliant !
goldensilver is offline   Reply With Quote
 
Old 06-27-2008, 08:26 PM   #3
demonic
 
Join Date: May 2008
Posts: 1
demonic is an unknown quantity at this point
Hello

I have followed your guide exactly, yet I still am getting the following errors when I try to compile. Any help or guidance on this would be awesome.

Thanks

[CODE]1>------ Build started: Project: customscripts, Configuration: Release Win32 ------
1>Compiling...
1>GuardGossip.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\src\CustomScripts\GuardGossip.cpp': No such file or directory
1>Gossip_Innkeepers.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\src\CustomScripts\Gossip_Innkeepers.cpp': No such file or directory
1>Gossip_Battlemaster.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\src\CustomScripts\Gossip_Battlemaster.cpp': No such file or directory
1>Setup.cpp
1>PortableTeleporter.cpp
1>..\src\CustomScripts\PortableTeleporter.cpp(58) : warning C4101: 'Menu' : unreferenced local variable
1>Build log was saved at "file://d:\DemonicWow\SVN\Opensascent2\trunk\src\scripts\projects\2008_int_release_CustomScripts\BuildLog.htm"
1>customscripts - 3 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========[/CODE]
demonic is offline   Reply With Quote
 
Old 06-27-2008, 09:53 PM   #4
Legendary
 
Legendary's Avatar
 
Join Date: May 2008
Location: 127.0.0.1:1337
Posts: 993
Legendary has a spectacular aura about
Loooong, but very helpful guide. +Rep
Legendary is offline   Reply With Quote
 
Old 07-03-2008, 09:11 PM   #5
darknezz19
 
Join Date: Jun 2008
Posts: 19
darknezz19 is an unknown quantity at this point
Got my scripts to compile with no erros but i don't have a final .dll in my release folder. It's producing something called "CustomScript.dll.intermediate.manifest" which is about 1kb in size and all the scripts in serperate .obj files. I have the solution config set to release for win32.

Edit: I got it to work nevermind. +rep yah once i get some

Last edited by darknezz19; 07-04-2008 at 04:05 AM.
darknezz19 is offline   Reply With Quote
 
Old 07-10-2008, 11:41 AM   #6
Charlie9809S
Yellow Eyebrows!!!
 
Charlie9809S's Avatar
 
Join Date: Apr 2008
Location: Why the Fuck is this not GREEN!
Posts: 831
Charlie9809S has much to be proud ofCharlie9809S has much to be proud ofCharlie9809S has much to be proud of
/BUMP

can i pls get some help, ive done everything exactly as instructed. i am still getting errors:

Code:
1>------ Build started: Project: CustomScript, Configuration: Release Win32 ------
1>Compiling...
1>GlobalNPC.cpp
1>Setup.cpp
1>Linking...
1>LINK : warning LNK4224: /OPT:NOWIN98 is no longer supported;  ignored
1>LINK : fatal error LNK1181: cannot open input file 'ascent-world.lib'
1>Build log was saved at "file://c:\Private Server\Copy of SVN2\branches\3_8_stable\src\scripts\projects\2008_int_release_CustomScript\BuildLog.htm"
1>CustomScript - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
if anyone has any idea what i can do, pls help

Cheers
Charlie9809S is offline   Reply With Quote
 
Old 07-15-2008, 04:01 PM   #7
deathlordfgf
 
Join Date: Jul 2007
Posts: 62
deathlordfgf is an unknown quantity at this point
100% Perfect Worked for me like a charm.. 7-15-08 ty
deathlordfgf is offline   Reply With Quote
 
Old 07-21-2008, 06:14 AM   #8
Charlie9809S
Yellow Eyebrows!!!
 
Charlie9809S's Avatar
 
Join Date: Apr 2008
Location: Why the Fuck is this not GREEN!
Posts: 831
Charlie9809S has much to be proud ofCharlie9809S has much to be proud ofCharlie9809S has much to be proud of
Hey, +rep to anyone who can help.

Ok, I sorted out error I posted above, then I did a heap of compiling that all worked 100%, thanks for the guide. But now I'm trying to compile my custom scripts with an older svn revision, Ascent rev 4552. At the start I was getting a heap of errors, which are now all fixed except this one:

Quote:
Compiling...
WishingStone.cpp
UberMorpher.cpp
SkillNPC.cpp
HealNPC.cpp
GlobalNPC.cpp
FriendPorter.cpp
Buffer.cpp
Setup.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ScriptSetup.h(34) : error C2065: 'BUILD_REVISION' : undeclared identifier
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ScriptSetup.h(34) : error C2065: 'BUILD_REVISION' : undeclared identifier
If anyone knows what i can do, please reply to this post, PM me, or MSN me(PM me for my MSN).

+rep to anyone who can help.

Cheers
Charlie9809S is offline   Reply With Quote
 
Old 08-20-2008, 01:18 AM   #9
spearman360
◄ The Lone Wolf (Lamezors
 
spearman360's Avatar
 
Join Date: Jul 2007
Location: AIM - SicAriO bx
Posts: 918
spearman360 is a splendid one to beholdspearman360 is a splendid one to beholdspearman360 is a splendid one to behold
I don't understand when he says,
Quote:
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.
spearman360 is offline   Reply With Quote
 
Old 08-21-2008, 02:18 PM   #10
juswill3
 
juswill3's Avatar
 
Join Date: May 2008
Location: Inside your hardrive stealing your RAM
Posts: 333
juswill3 is on a distinguished road
Ok so what does this all accomplish
juswill3 is offline   Reply With Quote
 
Old 08-22-2008, 12:02 AM   #11
zenathor
Tarkkanix
 
Join Date: Aug 2008
Location: Tarkkanix
Posts: 1,077
zenathor is a splendid one to beholdzenathor is a splendid one to beholdzenathor is a splendid one to behold
thank you ya it's loong
zenathor is offline   Reply With Quote
 
Old 08-26-2008, 08:44 AM   #12
dragonchat20
 
dragonchat20's Avatar
 
Join Date: Jan 2008
Location: Queensland, Australia
Posts: 171
dragonchat20 is an unknown quantity at this point
Thanks mate, great guide. No problems produced. +Rep to you.
dragonchat20 is offline   Reply With Quote
precompiled header file???  
Old 04-04-2009, 05:43 PM   #13
razkasar
 
razkasar's Avatar
 
Join Date: Jan 2008
Location: Sweden
Posts: 40
razkasar is an unknown quantity at this point
hello
Im getting a error says :

1>------ Build started: Project: ArcScriptCustomScripts, Configuration: Release Win32 ------
1>Compiling...
1>GMHelper.cpp
1>HouseNPC.cpp
1>..\src\CustomScripts\GMHelper.cpp(1) : fatal error C1083: Cannot open precompiled header file: '2008_int_release_CustomScripts\CustomScripts.pch' : No such file or directory
1>Setup.cpp
1>..\src\CustomScripts\HouseNPC.cpp(2) : fatal error C1083: Cannot open precompiled header file: '2008_int_release_CustomScripts\CustomScripts.pch' : No such file or directory
1>..\src\CustomScripts\Setup.cpp(20) : fatal error C1083: Cannot open precompiled header file: '2008_int_release_CustomScripts\CustomScripts.pch' : No such file or directory
1>Build log was saved at "file://c:\Documents and Settings\User\Skrivbord\ArcEmu\ArcEmu\src\scripts\ projects\2008_int_release_CustomScripts\BuildLog.h tm"
1>ArcScriptCustomScripts - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

anyone know how to fix??
razkasar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:12 PM.

All times are GMT. The time now is 01:12 PM. Contact Us - AC Web - Archive - Privacy Statement - Top