Author Topic: Block City Version 3  (Read 23970 times)


This is the script that is running on ScatteredSpace's primary server: Block City. The script retains all features that the primary server has. This includes the Deathmatch Arena, VIP system, Server Moderator & VIP labeling, and a logging system to keep tabs on your server moderators.

The script can be used on both Non-Dedicated and Dedicated servers, but not LAN Servers.

HOW TO USE:
- Players must build on a (default) baseplate to begin building.
- If Baseplate alignment is on, the player must align their baseplate by having it touch two other baseplates.
- Players are limited on how many Bricks they can plant by how many Blocks (currency) they have.
- Players can gain Blocks by chopping trees, mining ores, or (if enabled) Deathmatch.

Useful Server Moderator Commands:
- /addvip [USERNAME] - Grants a user VIP.
- /removevip [USERNAME] - Removes VIP from a user.
- /setBlocks [AMOUNT] [USERNAME] - Sets a user's Blocks to a specific amount.
- /grantBlocks [AMOUNT] [USERNAME] - Gives a user an additional amount of Blocks to their own amount.

KNOWN ISSUES:
  • The Spawn System conflicts with Brick_ScaleSpawns, I am not sure why yet.
  • SimpleDB v3 Does not save on exit, but rather saves every 10 minutes.
  • SimpleHelp Does not support nested (sub) sections (yet).
  • 64x64 Baseplates cannot be planted when trying to be aligned with a loaded save Baseplate.
  • Block City is not compatible with the latest Duplicator version. We recommend you use the patched V11 Duplicator instead. (DIRECT LINK HERE)

Some preferences like the DM arena, VIP system, and Baseplate alignment system are disabled by default. You must edit prefs.cs in the Script_BlockCity.zip file to enable these features or enable them within RTB's Preferences menu.

If you find a bug with this script please report it ASAP with a console log.

Simply place Script_BlockCity within your Add-Ons folder within your Blockland folder.

CHANGE LOG - V3
- Database replaced with Mr. Doom's SimpleDB v3-B
- Help system changed from function based help to a XML Style help file (BlockCity.XHLP)
- Added Credits
- Added $Pref::BlockCity::AutoDisplayHelp (runs /help when the client spawns)
- Added Selective Projectile Disabling (only disables digger & axe projectiles from spawning from bricks & players, on by default)
- Rewrote the resource mod to be easily expandable and more balanced.
- Removed RTB Prefs to change resource costs/reward/respawn in game, now must be edited in the datablock.
- Smoothed most systems for spawning bricks, so if you run out of blocks it does not spawn and delete the brick (just denies you)
- Disabled Help.cs (conflicts with SimpleHelp, but is a backup)
- Removed PLAYERConnect();
- Removed savePLAYER();
- Removed isPlayer(); -- Use BCDB.existUser(%blid) instead (returns true/false)
- Removed SortArray();
- Removed SpawnCheck();
- Removed BaseCheck();
- Removed FindBlocks(); -- No longer neccessary with SimpleDB
- Removed ServerCmdJoinDM();
- Removed ServerCmdLeaveDM();
- Removed BrickMessage();
- Rewrote  isOnline(); -- Now Jolly and Loop Free!
- Added    GivePlayer(client,amount[,name-of-item]);
- Added    ChargePlayer(client,cost,name-of-item);
- Added    ServerCmdDM(); -- Adds or Removes you from DM
- Added    ServerCmdHelp(%client[,%section]); -- For SimpleHelp
- Added    SuperBaseCheck(); -- Replaces BaseCheck();
- Added    BrickTest(); -- Preplant brick testing for ServerCmdPlantBrick();
- Added    ServerCmdPlantBrick(); OVERWRITE (aka. in a package)
- Added Credits to the help system
- Added Refunds to the help system
- Added Refunds v1, (Experimental)
- Added Several new resources.
- Added Text notifying users that axes chop trees and digger mines, if they don't hit the correct resource.
- Added Support for Destiny's Variable Events.

Resources no longer use manually set respawn times etc...
You now set the Total Hits and Blocks Per Hit in the datablocks (you will see examples, MDRM_BPH etc...)
Resources also no longer use individual datablocks, they inherit the parent of their group, so you don't respecify everything.
The following formulas are used to find costs/respawn time/reward (this is Pseudocode not the actual torque script)
Code: [Select]
Reward = RoundDown(BlocksPerHit*TotalHits)
RespawnTime = BlocksPerHit*TotalHits*8000
Cost = RoundDown(BlocksPerHit*TotalHits*150)
Refund = RoundDown(BlocksPerHit*TotalHits*75)

THE UPDATE WILL AFFECT THE DATABASE!
(It will be reset)
Simply replace your current Script_BlockCity File with this one.

Special Thanks to:
- Mr. Wallet: Coding help
- Mr. Doom: Coding revisions, Resource System 2, SimpleDB, SimpleSpawn (Alpha), SimpleHelp (Alpha), Refunds (Beta),
- Truce: Initial Default Minigame system
- Destiny: Baseplate alignment system
- Kunit: Initial Resource system

Download Link: Block City


Mr. Doom's License on SimpleDB/SimpleHelp:
It says it at the Top of SimpleDB, but basically it means: ScatteredSpace is allowed to distribute and modify it with their Scripts, however they must give me credit.



For Modders: Example Codes:
To Give blocks to a player for winning the DM (the player is named %Killer in this case)
Code: [Select]
GivePlayer(%Killer,%reward,"DM Win"); This will tell them they gained blocks for a "DM Win" and give them %reward blocks.

To Charge for a 100 Block Brick named "Expensive Brick"
Code: [Select]
if(chargePlayer(%client,%cost,"Expensive Brick")){
   // They will be told and charged, but this is what you do if they were charged (if chargePlayer returned true)
} else {
   // They will be told they don't have enough, but this is what you do if they didn't buy it (like delete the brick)
}
To Check if a player is in the database
Code: [Select]
BCDB.existUser(%Client.BL_ID); // Returns True/False
« Last Edit: August 20, 2009, 09:58:03 PM by KINEX »

Will be interesting to try, at least.

Cool, glad to see you got it release-ready.


I've added the Useful Server Moderator Commands to the Original Post to help Admins with the script.

so a tiny bit of it is like city rp, just made it alot different. sounds cool

Nice beter than a CityRp, CityRp=Suckish

I think Mr.Doom is credit to team!


this is a great mod

Tom

Looks good, but I bet there will be many of these up tomorrow. At least its not as broken as CityRP.

Something inside me just did a backflip.

Hooray, something similar to CityRP that doesn't suck. Good job.

Hooray, something similar to CityRP that doesn't suck. Good job.
Nailed it corndog.

2 little thing....dose it already set a price on bricks not like a master price but like 1 dolar for a 1x1 brick and 5 dollar for a 1x4 ramp


justtttttt askin but still its epicly epic dling