Custom Scripts Not being Found

I’m having an issue adding Custom Scripts into my server. I have a Player Reward script and I have

#ifdef SCRIPTS
/* This is where custom scripts’ loading functions should be declared. */
void AddSC_Player_Rewards();

void AddCustomScripts()
#ifdef SCRIPTS
/* This is where custom scripts should be added. */
}within my scriptloader. Now whenever I tried to compile I got unknown reference AddSC_Player_Rewards(); which doesn’t make sense to me since it’s all right there in the Player_Rewardtime.cpp

My Cmake File has

file(GLOB_RECURSE sources_Custom Custom/.cpp Custom/.h)


message(" → Prepared: Custom")
Now I still get undefined etc etc,

I went into build/src/server and looked at the Makefile which has no reference to my Custom scripts. I have no idea what’s going on here and any help would be appreciated.

did you rerun cmake? (configure & generate)
Is the script file in the Custom folder and not in any subfolder in there? Assuming script file is a .cpp file.

You sure AddSC_Player_Rewards is correct? Check the casing and any typos by comparing to or copying the function in the script file.

I’m 100% sure on the scripts name and casing. I’ve watched during the make and the Custom Folder SAYS scripts are prepared and added, but it’s not adding Player_Rewards.h and I’ve redone everything with cmake as well. Reran just to see it add the new ScriptLoader.cpp, but not the Player_Rewards.h

You can try to add your script by other way. In Visual Studio go on game->Scripts and add new file. Setup it to save your file in /src/server/scripts/custom . i add scripts in that way wothout cmake and work everytime

Running Ubuntu Server 15.04. I don’t see Visual Studio helping here. /emoticons/default_tongue.png I got it to work by changing it from a header file to a c plus plus, but it compiles, but doesn’t run the script. /emoticons/default_sad.png

maybe show the script?
Could have a bug in it making it useless.

Or debug it to see what it does if anything at all. Or add some debug prints to it.