Jump to content
Sign in to follow this  
desantnik

Need help with CPP

Recommended Posts

Hi everybody...

I need help with the cpp of an addon... for my personal use

I was going to use sea demons early morpeh infantry and convert them to using lib 45's weapons....

heres the problem... earlier it was working and then I went and f*cked it up and now I have no idea what the problem is.... would anybody be willing to help?

the problem is that when I try to start OFP I get this:

Config: End of line encountered after lib_mosinb, lib_Throw, lib_Put};

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// / Morpeh addon v1.0 by SEA DEMON

// some basic defines

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot 0// dummy weapons

#define WeaponSlotPrimary 1// primary weapons

#define WeaponSlotSecondary 16// secondary weapons

#define WeaponSlotItem 256// items

#define WeaponSlotBinocular 4096// binocular

#define WeaponHardMounted 65536

class CfgPatches

{

class SovietMarineOFF

{

units[] = {SovietMarineOFF};

weapons[] = {};

requiredVersion = 1.40;

};

class SovietMarineSMG

{

units[] = {SovietMarineSMG};

weapons[] = {};

requiredVersion = 1.40;

};

class SovietMarine

{

units[] = {SovietMarine};

weapons[] = {};

requiredVersion = 1.40;

};

class SovietMarineMG

{

units[] = {SovietMarineMG};

weapons[] = {};

requiredVersion = 1.40;

};

class SovietMarineMedic

{

units[] = {SovietMarineMedic};

weapons[] = {};

requiredVersion = 1.40;

};

class SovietMarineAT

{

units[] = {SovietMarineAT};

weapons[] = {};

requiredVersion = 1.40;

};

class Groups

{

units[] = {};

weapons[] = {};

requiredVersion = 1.40;

};

};

class CfgVehicles

{

class All{};

class AllVehicles:All{};

class Land:AllVehicles{};

class Man:Land{};

class Soldier:Man{};

class SoldierWB:Soldier{};

class SoldierWG:SoldierWB{};

class SovietMarineOFF : SoldierWB

{

side=2

displayName="Soviet Marine Officer";

model="\SEAmorpeh\SEAmorpeh";

scope=2;

sensitivity=1.25;

accuracy=2.500000;

nightVision=1;

camouflage=0.750000;

weaponSlots="1 + 16 + 8* 256 + 1* 4096 + 2 + 4* 32";

weapons[]={"lib_ppsh41",lib_Throw,lib_Put};

magazines[]={"lib_ppsh41mag","lib_ppsh41mag","lib_ppsh41mag",lib_rgd33,lib_rgd33};

};

class SovietMarineSMG : SoldierWB

{

side=2

displayName="Soviet Marine SMG";

model="\SEAmorpeh\SEAmorpeh";

scope=2;

sensitivity=1.25;

accuracy=2.500000;

nightVision=1;

camouflage=0.750000;

weaponSlots="1 + 16 + 8* 256 + 1* 4096 + 2 + 4* 32";

weapons[]={"lib_ppsh41",lib_Throw,lib_Put};

magazines[]={"lib_ppsh41mag","lib_ppsh41mag","lib_ppsh41mag",lib_rgd33,lib_rgd33};

};

class SovietMarine : SoldierWB

{

side=2

displayName="Soviet Marine";

model="\SEAmorpeh\SEAmorpeh";

scope=2;

sensitivity=1.25;

accuracy=2.500000;

nightVision=1;

camouflage=0.750000;

weaponSlots="1 + 16 + 8* 256 + 1* 4096 + 2 + 4* 32";

weapons[]={"lib_mosinb,lib_Throw,lib_Put};

magazines[]={"lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_rgd33

,lib_rgd33};

};

class SovietMarineMG : SoldierWB

{

side=2

displayName="Soviet Marine MG";

model="\SEAmorpeh\SEAmorpeh";

scope=2;

sensitivity=1.25;

accuracy=2.500000;

nightVision=1;

camouflage=0.750000;

weaponSlots="1 + 16 + 8* 256 + 1* 4096 + 2 + 4* 32";

weapons[]={"lib_dp27",lib_Throw,lib_Put};

magazines[]={"lib_dp27mag","lib_dp27mag","lib_dp27mag","lib_dp27mag"};

};

class SovietMarineMedic : SoldierWB

{

side=2

displayName="Soviet Marine Medic";

model="\SEAmorpeh\SEAmorpeh";

accuracy=1000;

picture="imedic";

vehicleClass="Men";

scope=2;

cost=60000;

attendant=1;

sensitivity=1.25;

nightVision=1;

camouflage=0.750000;

nameSound="medic";

hiddenSelections[]={};

weaponSlots="1 + 16 + 8* 256 + 1* 4096 + 2 + 4* 32";

weapons[]={lib_mosinb,lib_Throw,lib_Put};

magazines[]={lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_rgd33,l

ib_rgd33};

};

class SovietMarineAT : SoldierWB

{

side=2

displayName="Soviet Marine AT";

model="\SEAmorpeh\SEAmorpeh";

scope=2;

sensitivity=1.25;

accuracy=2.500000;

nightVision=1;

camouflage=0.750000;

weaponSlots="1 + 16 + 8* 256 + 1* 4096 + 2 + 4* 32";

weapons[]={lib_mosinb,lib_Throw,lib_Put};

magazines[]={lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_mosinMag,lib_rgd33,l

ib_rgd33};

};

               class EventHandlers

{

fired = "_this exec ""\lib_sldr_1\gren.sqs""";

};

};

};

class CfgGroups

{

class Resistance

{

name="Resistance";

class Soviet_Marine_Infantry

                                        {

                              name="Red Navy Marines";

       

class Marine_Squad

{

name="Soviet Marine squad";

class Unit0

{

name="1";

side=2;

vehicle="SovietMarineOFF";

rank="CAPTAIN";

position[]={0,5,0};

};

class Unit1

{

name="2";

side=2;

vehicle="SovietMarineSMG";

rank="Lieutnant";

position[]={-10,0,0};

};

class Unit2

{

name="3";

side=2;

vehicle="SovietMarineMG";

rank="Sergeant";

position[]={10,0,0};

};

class Unit3

{

name="4";

side=2;

vehicle="SovietMarine";

rank="Sergeant";

position[]={15,0,0};

};

class Unit4

{

name="5";

side=2;

vehicle="SovietMarine";

rank="Private";

position[]={-15,0,0};

};

class Unit5

{

name="6";

side=2;

vehicle="SovietMarineMedic";

rank="Private";

position[]={-20,0,0};

};

class Unit6

{

name="7";

side=2;

vehicle="SovietMarineAT";

rank="Private";

position[]={-25,0,0};

};

};

};

};

some one please tell me whats wrong? crazy_o.gif

Share this post


Link to post
Share on other sites

you've put under  - class SovietMarine : SoldierWB

.......

weapons[]={"lib_mosinb,lib_Throw,lib_Put};

notice the {" ......but at the end u didnt put a ". - a case of a missing ". Same for your magazines[]= line..missing "

Actually ofp is pretty user friendly..it tells us our mistakes, tk heavens, at the start..so next time if u encounter another error message, just look closely at what it says, cos it does give u a clue as to where the error was....i didnt have to look closely..aint got eagle eyes,lol! ..just look at the error msg and zoom straight to put and throw lines and spotted the error there.. wink_o.gif

either u put the "xx" for each item or u dont put at all...usually i would put the "xxx" for each weapons, but mags i dont use it.

eg:-

weapons[]={"lib_mosinb","lib_Throw","lib_Put"};

Hope it helped.

Share this post


Link to post
Share on other sites

Thanks Philcommando that did the trick but now another message crops up.. this while I am ingame and I cant put a spot on it anywhere even though I looked at where the problem should be...

no entry 'config.cpp/CfgVehicles/CfgGroups.scope.

and if I try some units I get a crash to desktop with this message:

out of reserved memory (393216 KB).

Code change required ( current limit 524288 KB).

Total free 29787 KB

Free blocks 168, Max free size 26265 KB

any idea as whats causing this?

thx in advance

Share this post


Link to post
Share on other sites

Glad u managed to get it ingame. As mentioned, ofp gives a clue and the clue lies in the cfgGroups section. I did a check against the config190 and found out there seems to be additions to the original codes..not sure if the engine could handle any other codes that are not within its scope. There seems to an additional:-

class Marine_Squad and name="x" for all your units

it might these lines that are causing the error msg, or just simply short of 1more ' }; ' . I have retype a set of codes using the config190 set. Replace the whole cfggroup and see if it works:-

class CfgGroups

{

class Resistance

{

name="Resistance";

class Soviet_Marine_Infantry

{

name="Red Navy Marines Squad";

class Unit0

{

side=2;

vehicle="SovietMarineOFF";

rank="CAPTAIN";

position[]={0,5,0};

};

class Unit1

{

side=2;

vehicle="SovietMarineSMG";

rank="Lieutnant";

position[]={-10,0,0};

};

class Unit2

{

side=2;

vehicle="SovietMarineMG";

rank="Sergeant";

position[]={10,0,0};

};

class Unit3

{

side=2;

vehicle="SovietMarine";

rank="Sergeant";

position[]={15,0,0};

};

class Unit4

{

side=2;

vehicle="SovietMarine";

rank="Private";

position[]={-15,0,0};

};

class Unit5

{

side=2;

vehicle="SovietMarineMedic";

rank="Private";

position[]={-20,0,0};

};

class Unit6

{

side=2;

vehicle="SovietMarineAT";

rank="Private";

position[]={-25,0,0};

};

};

};

};

Hope it helps and may u help another in this community. All the best! smile_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×