Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help fixing a bug in a script
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#3
RE: Need help fixing a bug in a script

Besides, many of the original scripts use optimization techniques to ease their job a little.

For example in order to not have to wright the same code multiple times, the might just create custom functions.

PHP Code: (Select All)
void OnStart()
{
    if(
areAllQuestsCompleted)
        
SpawnStuff("Enemy"true);
}

void SpawnStuff(string whatToSpawnbool effects)
{
    
SetEntityActive(whatToSpawntrue);
    if(
effects)
    {
        
PlayMusic("music.ogg"true1.0f1.0f1false);
        
GiveSanityDamage(10.0ftrue);
    }
}

bool areAllQuestsCompleted()
{
    if(
QuestIsCompleted("lastQuest"))
    {
        return 
true;
    }
    return 
false;


Some of those functions might be even used in a totally different part of the script and need to be declared only once. Therefore it is possible that you did not copy one of those functions.

But it's very difficult to know without seeing the code.
02-24-2016, 09:49 AM
Find


Messages In This Thread
RE: Need help fixing a bug in a script - by Spelos - 02-24-2016, 09:49 AM
RE: Need help fixing a bug in a script - by WALP - 02-24-2016, 11:43 PM



Users browsing this thread: 1 Guest(s)