FOnline Development > Questions and Answers

FOnline SDK - Question

<< < (38/93) > >>

JovankaB:

--- Quote from: Gob on October 22, 2011, 04:01:31 pm ---I have trouble with SDK. The ~param command doesn't seem to work.

I try things like

~param 0 0
~param 0 200 300
~param 0 72

Things to edit abbilities and some other things and it does nothing...

Any idea why? How can I fix this?

--- End quote ---

There is a bug in SDK. Param doesn't work with latest versions. You can replace it with custom function until they fix it:


--- Code: ---#include "_defines.fos"
void param( Critter& cr, int, int index, int value ) {
if( index < 200 ) {
cr.StatBase[index] = value;
} else if( index >= 200 && index <= 217 ) {
cr.SkillBase[index] = value;
} else if( index >= 300 && index <= 469 ) {
cr.PerkBase[index] = value;
} else if( index >= 510 && index <= 549 ) {
cr.ModeBase[index] = value;
}
}

--- End code ---


* Save the code as for example "jovb.fos" in the Sripts folder.
* Add "@ server module jovb" line in scripts.cfg file.
* Restart server, login, get admin access and type for example:
~run jovb param 0 200 300
It should work like ~param 0 200 300 (300% small guns).

Thanks to Ghosthack for the fix :)

Here is another function you can find useful, put it in the same module:


--- Code: ---void godmode( Critter& cr, int, int, int ) {

// Boost stats
for( int i = 0; i <= 6; i++) {
param( cr, 0, i, 10 );
}
param( cr, 0, ST_ACTION_POINTS, 100 );
param( cr, 0, ST_MELEE_DAMAGE, 100 );
param( cr, 0, ST_CARRY_WEIGHT, 1000000 );

// Boost skills
for( int i = 200; i <= 217; i++) {
param( cr, 0, i, 300 );
}

// Boost perks/modes
param( cr, 0, PE_AWARENESS, 1 );
param( cr, 0, PE_SILENT_RUNNING, 1 );
param( cr, 0, MODE_NO_STEAL, 1 );
param( cr, 0, MODE_UNLIMITED_AMMO, 1 );
param( cr, 0, MODE_NO_DROP, 1 );
param( cr, 0, MODE_NO_LOOSE_LIMBS, 1 );
param( cr, 0, MODE_INVULNERABLE, 1 );
param( cr, 0, MODE_NO_KNOCK, 1 );
param( cr, 0, MODE_NO_LOOT, 1 );
param( cr, 0, MODE_NO_PUSH, 1 );

cr.Say( SAY_NORM, "Godmode enabled" );
}

--- End code ---

~run jovb godmode 0 0 0 and you will get "godmode" without typing 100 params.
You can extend it to give you favorite armor, weapon etc. :)

Gob:
Thank you much apreciated.

Do I need to compile?

JovankaB:
If you do it like I said server should compile new script automatically on server start, and actually you don't even have to restart server, you can use ~load command to load script module, for example ~load jovb if you saved the scripts in jovb.fos file. You need admin access level to do this.

Gob:
Ah, I already did it. Is there a way to make this script available to normal clients? Without accessing admin powers or tester ecc...

JovankaB:
It is possible but requires more scripting.
Maybe someone will post some custom commands mod, I don't have anything ready to copy/paste :'(

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version