Author Topic: CityRPG Syntax Error  (Read 1599 times)

Code: [Select]
db = $CityRPG::jobs::datablock;

This is the correct answer.

The implementation of jobs that this copy uses was suggested by Trader and uses something very similar to JVS. To his credit, it's a very fancy fung sheuing of how the engine works to save and load information.

1. Editor makes a job file where he defines a series of global variables.
2. Scripts execute this file which is just a bunch of variable declarations.
3. Scripts make a scriptObject based on global variables defined in the config file.
4. Deletes all global variables to prevent them from appearing in the next scriptobject.


Of course, knowing this really does not matter if all you're doing is mass producing a bunch of stuffty jobs. Why you're editing that file in the first place is beyond me.

Waitasecond. Datablock...is this about a player's job's datablock? Damnit, I remember changing Criminal Mastermind's playertype to Quake. What happened...

Changed back to NoJet, but to no avail...

Changed back to NoJet, but to no avail...
It doesn't matter what the datablock is if you aren't fixing the syntax error in the code.

I still don't know where the error is located.
In case any one wants to help, here's scriptobjects.cs
http://www.mediafire.com/?4jsyu45kzf5x7dc

you've already been given the answer

name   = $CityRPG::jobs::name;
invest   = $CityRPG::jobs::initialInvestment;
pay          = $CityRPG::jobs::pay;
tools      = $CityRPG::jobs::tools;
education   = $CityRPG::jobs::education;
db            =  must supply a datablock value
sellItems   = $CityRPG::jobs::sellItems;
sellFood   = $CityRPG::jobs::sellFood;

What to put for the datablock value, depends on what your trying to do.  If you dont understand what to put there, then maybe you dont understand what your trying to do and should read some more examples, or try something else.


What exactly IS a datablock value.

What exactly IS a datablock value.
Stop coding.

You've been told already.

I fixed THAT one, but now I got this.

Code: [Select]
Add-Ons/gamemode_cityrpg/package.cs Line: 638 - Syntax error.
>>> Some error context, with ## on sides of error halt:
commandToClient(%obj.client, 'messageBoxOK', "Hammer killing is wrong. Especially in City Roleplays. Using a default tool to kill is unfair. No damage has been done to the person you just attacked. One more note, if you hammer a person that is wanted, they will take damage, as this is considered self defense.");
else
parent::onHitObject(%this, %obj, %slot, %col, %pos, %normal);

function ##T##aserImage::onHitObject(%this, %obj, %slot, %col, %pos, %normal)
{
if(%col.getClassName() $= "Player" && isObject(%col.client) && !%col.client.getWantedLevel())
commandToClient(%obj.client, 'centerPrint', "You cannot tase this person, they are not wanted. No, I don't care if they stole your cake. The cake is a lie, anyways.");
>>> Error report complete.

ADD-ON "gamemode_cityrpg" CONTAINS SYNTAX ERRORS

Looks like your missing one or more closing }

go read (or re-read) iban's coding tutorial.  and pay special attention to the suff on syntax.

i'll give you the basics here:

every { must have a matching }
every ( must have a matching )

every statement must have a ;   at the end (except for if)
function stuff()  is not a statement so it doesnt need a ;  at the end


After fixing about 6 syntax errors, it's fixed. Lock'd.