ArcEmu: Extrascripts Problem - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Extrascripts Problem i hate base.h

#1 User is offline   Vict0V 

  • Member
  • Pip
  • Group: Members
  • Posts: 37
  • Joined: 01-January 10
  • Gender:Male
  • Location:On top of your friend list
  • Interests:C#, C++, PHP, Reverse Engineering, Arcemu Development.

Posted 29 August 2010 - 05:27 AM

Hi Arcemu,

i have written some a bossfight and put it in my extrascripts project.
now here's the point:

c:\arcemu core\src\scripts\src\extrascripts\..\Common\Base.h(365): error C2143: syntax error : missing ';' before '*'
c:\arcemu core\src\scripts\src\extrascripts\..\Common\Base.h(365): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\arcemu core\src\scripts\src\extrascripts\..\Common\Base.h(365): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\arcemu core\src\scripts\src\extrascripts\..\Common\Base.h(365): warning C4183: 'GetInstanceScript': missing return type; assumed to be a member function returning 'int'


my base.h doesn't want me to compile my script :D (note: i have never edited base.h or base.cpp, or any other file :P!!)
another note: i do not use any InstanceScript, or the function GetInstanceScript()...
so i tried this:


//Instances
bool					IsHeroic();
int32					HeroicInt( int32 pNormal, int32 pHeroic ) { return IsHeroic() ? pHeroic : pNormal; }
//MoonInstanceScript*		GetInstanceScript();


i commented out the line that causes my error, but that causes only more errors...

some help?
thx in advance,
victov
0

#2 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 29 August 2010 - 06:03 AM

How are we supposed to know what's wrong in your script if you don't post it o.O ?
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#3 User is offline   Vict0V 

  • Member
  • Pip
  • Group: Members
  • Posts: 37
  • Joined: 01-January 10
  • Gender:Male
  • Location:On top of your friend list
  • Interests:C#, C++, PHP, Reverse Engineering, Arcemu Development.

Posted 29 August 2010 - 06:16 AM

oops :P

im pretty sure the problem isn't in my script...
but here it is:

#include "Setup.h"
#include "..\Common\Base.h"

#define T_1_H_BOSS 7
#define T_1_A_BOSS 4
#define T_2_H_BOSS 8
#define T_2_A_BOSS 5
;
class TowerOneHordeBoss : public MoonScriptCreatureAI
{
public:
	ADD_CREATURE_FACTORY_FUNCTION(TowerOneHordeBoss);
	TowerOneHordeBoss(Creature* pCreature) : MoonScriptCreatureAI(pCreature) {

		AddEmote( Event_OnCombatStart, "Im horde boss 1 and i entered combat", Text_Yell);
        AddEmote( Event_OnTargetDied,  "Im horde boss 1 and i killed someone" , Text_Yell);
        AddEmote( Event_OnDied, "Im horde boss 1 and i died :D", Text_Yell);
	};
	
	void Destroy()
	{
		delete this;
	}

	void OnCombatStart(Unit* mTarget)
	{
		sWorld.SendWorldText("Horde boss 1 is under attack");
		sWorld.SendWorldWideScreenText("Horde boss 1 is under attack");
	}
	void OnDied(Unit* mTarget)
	{
		sWorld.SendWorldText("Horde boss 1 died, tower 1 is now controlled by the alliance");
		sWorld.SendWorldWideScreenText("Horde boss 1 died, tower 1 is now controlled by the alliance");
	}
};

class TowerOneAllyBoss : public MoonScriptCreatureAI
{
public:
	ADD_CREATURE_FACTORY_FUNCTION(TowerOneHordeBoss);
	TowerOneAllyBoss(Creature* pCreature) : MoonScriptCreatureAI(pCreature) {

		AddEmote( Event_OnCombatStart, "Im ally boss 1 and i entered combat", Text_Yell);
        AddEmote( Event_OnTargetDied,  "Im ally boss 1 and i killed someone" , Text_Yell);
        AddEmote( Event_OnDied, "Im ally boss 1 and i died :(", Text_Yell);
	};
	
	void Destroy()
	{
		delete this;
	}

	void OnCombatStart(Unit* mTarget)
	{
		sWorld.SendWorldText("Alliance Boss 1 is under attack");
		sWorld.SendWorldWideScreenText("Alliance boss 1 is under attack");
	}
	void OnDied(Unit* mTarget)
	{
		sWorld.SendWorldText("Alliance Boss 1 died, tower 1 is now controlled by the horde");
		sWorld.SendWorldWideScreenText("Alliance boss 1 died, tower 1 is now controlled by the horde");	
	}
};
class TowerTwoHordeBoss : public MoonScriptCreatureAI
{
public:
	ADD_CREATURE_FACTORY_FUNCTION(TowerOneHordeBoss);
	TowerTwoHordeBoss(Creature* pCreature) : MoonScriptCreatureAI(pCreature) {
		AddEmote( Event_OnCombatStart, "Im horde boss 2 and i entered combat", Text_Yell);
        AddEmote( Event_OnTargetDied,  "Im horde boss 2 and i killed someone" , Text_Yell);
        AddEmote( Event_OnDied, "Im horde boss 2 and i died :(", Text_Yell);
	};
	
	void Destroy()
	{
		delete this;
	}

	void OnCombatStart(Unit* mTarget)
	{
		sWorld.SendWorldText("Horde boss 2 is under attack");
		sWorld.SendWorldWideScreenText("Horde boss 2 is under attack");
	}
	void OnDied(Unit* mTarget)
	{
		sWorld.SendWorldText("Horde boss 2 died, tower 2 is now controlled by the Alliance");
		sWorld.SendWorldWideScreenText("Horde boss 2 died, tower 2 is now controlled by the Alliance");	
	}
};

class TowerTwoAllyBoss : public MoonScriptCreatureAI
{
public:
	ADD_CREATURE_FACTORY_FUNCTION(TowerOneHordeBoss);
	TowerTwoAllyBoss(Creature* pCreature) : MoonScriptCreatureAI(pCreature) {

	AddEmote( Event_OnCombatStart, "Im ally boss 2 and i entered combat", Text_Yell);
        AddEmote( Event_OnTargetDied,  "Im ally boss 2 and i killed someone" , Text_Yell);
        AddEmote( Event_OnDied, "Im ally boss 2 and i died :(", Text_Yell);
	};
	
	void Destroy()
	{
		delete this;
	}

	void OnCombatStart(Unit* mTarget)
	{
		sWorld.SendWorldText("Alliance boss 2 is under attack");
		sWorld.SendWorldWideScreenText("Alliance boss 2 is under attack");
	}
	void OnDied(Unit* mTarget)
	{
		sWorld.SendWorldText("Alliance boss 2 died, tower 2 is now Horde controlled");
		sWorld.SendWorldWideScreenText("Alliance boss 2 died, tower 2 is now Horde controlled");	
	}
};

void SetupTowerBossScripts(ScriptMgr* mgr)
{
    mgr->register_creature_script(T_1_H_BOSS, &TowerOneHordeBoss::Create);
	mgr->register_creature_script(T_1_A_BOSS, &TowerOneAllyBoss::Create);
	mgr->register_creature_script(T_2_H_BOSS, &TowerTwoHordeBoss::Create);
	mgr->register_creature_script(T_2_A_BOSS, &TowerTwoAllyBoss::Create);
}

0

#4 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 August 2010 - 07:07 AM

The problem is plain and simple, you need to read a C++ book to learn the syntax. That should have been the first step before ever touching Arcemu code.
"The demand for free goods is infinite."
0

#5 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 29 August 2010 - 08:28 AM

Setup.h should be the only included header, since it's used as PreCompiled Header. Also i saw your script is about bosses, why not put it in InstanceScripts?
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#6 User is offline   Vict0V 

  • Member
  • Pip
  • Group: Members
  • Posts: 37
  • Joined: 01-January 10
  • Gender:Male
  • Location:On top of your friend list
  • Interests:C#, C++, PHP, Reverse Engineering, Arcemu Development.

Posted 29 August 2010 - 08:41 AM

View Postdfighter, on 29 August 2010 - 07:07 AM, said:

The problem is plain and simple, you need to read a C++ book to learn the syntax. That should have been the first step before ever touching Arcemu code.

i know C++, and im starting to hate you.

@saintJamesApostle: if i do not include base.h C++ does not recognize the MoonscriptCreatureAI classes. And this is not for an instance, in fact this is a for a battleground realm and all instances are disabled, so putting it in an instance script would be pretty useless :P
0

#7 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 August 2010 - 08:58 AM

View PostVict0V, on 29 August 2010 - 08:41 AM, said:

i know C++, and im starting to hate you.

Then why are you adding semicolons into your source files randomly? o.O
"The demand for free goods is infinite."
0

#8 User is offline   Vict0V 

  • Member
  • Pip
  • Group: Members
  • Posts: 37
  • Joined: 01-January 10
  • Gender:Male
  • Location:On top of your friend list
  • Interests:C#, C++, PHP, Reverse Engineering, Arcemu Development.

Posted 29 August 2010 - 09:11 AM

ah come on, who cares about a wrong-placed semicolon?
it doesn't solve my problem, why am i being hated if i only ask for a little help?
it's the same as a few weeks ago, when i had a little question about the vehicles i was implementing, i asked a question, and arcemu deletes all the vehicle related stuff from the source? (rev 3497)

im asking for help, not for hate
0

#9 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 August 2010 - 09:14 AM

View PostVict0V, on 29 August 2010 - 09:11 AM, said:

ah come on, who cares about a wrong-placed semicolon?
it doesn't solve my problem, why am i being hated if i only ask for a little help?
it's the same as a few weeks ago, when i had a little question about the vehicles i was implementing, i asked a question, and arcemu deletes all the vehicle related stuff from the source? (rev 3497)

im asking for help, not for hate

Need a hug?
Well those semicolons just tell that you don't know C++. That is all.
"The demand for free goods is infinite."
0

#10 User is offline   Vict0V 

  • Member
  • Pip
  • Group: Members
  • Posts: 37
  • Joined: 01-January 10
  • Gender:Male
  • Location:On top of your friend list
  • Interests:C#, C++, PHP, Reverse Engineering, Arcemu Development.

Posted 29 August 2010 - 09:18 AM

thank you dfighter, very very very helpfull!
i assume that you know C++, could you please tell me my enormously huge mistake?
0

#11 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 August 2010 - 09:22 AM

View PostVict0V, on 29 August 2010 - 09:18 AM, said:

thank you dfighter, very very very helpfull!
i assume that you know C++, could you please tell me my enormously huge mistake?

Hit up a book. Maybe it will help.
Hint: you don't need semicolons after the closing brackets of methods.
"The demand for free goods is infinite."
0

#12 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 29 August 2010 - 09:32 AM

View PostVict0V, on 29 August 2010 - 08:41 AM, said:

@saintJamesApostle: if i do not include base.h C++ does not recognize the MoonscriptCreatureAI classes. And this is not for an instance, in fact this is a for a battleground realm and all instances are disabled, so putting it in an instance script would be pretty useless :P

In fact you should include all the required headers (like Base.h) in Setup.h, since it's the one used to build PCH. You should read at least an article about PCH imho.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#13 User is offline   Vict0V 

  • Member
  • Pip
  • Group: Members
  • Posts: 37
  • Joined: 01-January 10
  • Gender:Male
  • Location:On top of your friend list
  • Interests:C#, C++, PHP, Reverse Engineering, Arcemu Development.

Posted 29 August 2010 - 09:49 AM

i have put all the includes in Setup.h, and the only file being included right now is Setup.h itself.
unfortunately, the error still comes up.

EDIT: i found someone with the same problem: Poor guy
0

#14 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 August 2010 - 10:05 AM

View PostVict0V, on 29 August 2010 - 09:49 AM, said:

i have put all the includes in Setup.h, and the only file being included right now is Setup.h itself.
unfortunately, the error still comes up.

EDIT: i found someone with the same problem: Poor guy

Poor guy he was told that he needs to learn C++ before he can work with Arcemu. What jerks these Arcemu guys are, they ain't spoonfeeding teenagers! How dare them when we pay them to teach us the basics!
"The demand for free goods is infinite."
0

#15 User is offline   Vict0V 

  • Member
  • Pip
  • Group: Members
  • Posts: 37
  • Joined: 01-January 10
  • Gender:Male
  • Location:On top of your friend list
  • Interests:C#, C++, PHP, Reverse Engineering, Arcemu Development.

Posted 29 August 2010 - 10:17 AM

what are you trying dfighter? do i have to kneel down and beg to get a little help?
anyone else having a solution to this problem?
0

#16 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 August 2010 - 10:20 AM

View PostVict0V, on 29 August 2010 - 10:17 AM, said:

what are you trying dfighter? do i have to kneel down and beg to get a little help?
anyone else having a solution to this problem?

You don't have to beg. All you have to do is read a book about the C++ programming language. Then study the Arcemu source code. I know it's hard, it requires you to take an effort...
"The demand for free goods is infinite."
0

#17 User is offline   Vict0V 

  • Member
  • Pip
  • Group: Members
  • Posts: 37
  • Joined: 01-January 10
  • Gender:Male
  • Location:On top of your friend list
  • Interests:C#, C++, PHP, Reverse Engineering, Arcemu Development.

Posted 29 August 2010 - 10:26 AM

i know C++ already (how would i have made this if i didn't?) and i have studied the source code.
i also have implemented multiple passenger mounts on the server im working for, this is kinda like.. a last resort?
i mean, who knows arcemu better then you guys? but if even you cant help me, who will?
0

#18 User is offline   Garvey 

  • is a cool guy
  • Group: Super Moderator
  • Posts: 331
  • Joined: 23-November 09
  • Gender:Male
  • Location:England
  • Server OS:Windows

Posted 29 August 2010 - 10:43 AM

You've implemented multi-passenger mounts?

Care to share?
But I, being poor, have only my dreams;
I have spread my dreams under your feet;
Tread softly because you tread on my dreams.
0

#19 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 August 2010 - 10:50 AM

View PostVict0V, on 29 August 2010 - 10:26 AM, said:

i know C++ already (how would i have made this if i didn't?) and i have studied the source code.
i also have implemented multiple passenger mounts on the server im working for, this is kinda like.. a last resort?
i mean, who knows arcemu better then you guys? but if even you cant help me, who will?

If you knew "The C++ programming language" you wouldn't make such semicolon mistakes so stop lying, this is not ac-web or any other similarly retarded site for teenagers.


~Topic locked
"The demand for free goods is infinite."
1

#20 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 29 August 2010 - 11:17 AM

On a side note, your error is obvious:
..\Common\Base.h(365): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 

http://msdn.microsof...y/ms173696.aspx
You are including Base.h but not the headers required by Base.h . Since you make use of MoonScriptCreatureAI, you should include all the required headers, just like what http://arcemu.info/t...Scripts/Setup.h does. That's why i told you to put your script in InstanceScripts, because it has a Setup.h already configured to support MoonScriptCreatureAI. You said you know C++ but you can't figure out which headers to include, even if all you had to do was copy the #includes in Setup.h of InstanceScripts...
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users