• Register
Post tutorial Report RSS Coding Introduction

A small introduction with detailed explaining images for creating your own scripts for the TCW Client for use in the Editor with VS2010. An Hello script example.

Posted by on - Basic Client Side Coding

Tcw.multiplayerforums.com
When you opened up the Solution in VS2010 make sure that it is set to Release and Win32.
This "mode" is required for making scripts you can use in the Editor/Game Client.
When you added your scripts the build will create a new scripts.dll which you should add into your Game Client folder and overwrite the existing file.
The Editor will load scripts from this file automatically so they become available then.

Tcw.multiplayerforums.com
Before we begin, goto Build->Rebuild Solution this will compile all scripts and build a clean scripts.dll
If you have errors feel free to post them in this topic or in a new topic in this sub-forum.
Tcw.multiplayerforums.com
This is what the end-result should look like. No errors and all successes ;)
4 were built which are part of the Release configuration for the Game, the 9 skipped ones are part of the SERVER (Release SSGM) and will be discussed later.

Tcw.multiplayerforums.com
In the solution explorer on the left you can find the plugins and scripts code available.
Expande the scripts->01.Sources->Tib.Crystal War to see a list of scripts that are used in Tiberium Crystal War.
ALL scripts contained in this folder are accessible from in the game and the editor automatically after building and placing the new scripts.dll in the game folder.

Tcw.multiplayerforums.com
To keep things organized you could create a new Filter and add one with your (project) name, for example "zunnie".

Tcw.multiplayerforums.com
To create scripts you need a .cpp source file and a .h header file.
Create two files by right clicking and adding them and call them (for example) zunnie.cpp and zunnie.h in the filter (folder) you just created.

Tcw.multiplayerforums.com
Tcw.multiplayerforums.com
The script example above when built becomes available in the Editor and Game as "zunnie_hello" which can then be attached to objects or spawners etc.
When it is attached to an object in the Editor (or by other means), that object, as soon as it gets created in the game, will display the message "zunnie says hello!" once.
For example if you have a spawner that spawns a bot, and you attach the script "zunnie_hello" to it, everytime that bot spawns and respawns it will say the string "zunnie says hello!" once.

Tcw.multiplayerforums.com
When you wrote your code you goto Build->Rebuild Solution and it will rebuild all files for this configuration (Release).

Tcw.multiplayerforums.com
when succeeded, switch the configuration mode to Release SSGM and do Build->Rebuild Solution one more time.

Tcw.multiplayerforums.com
When everything is completed successfully, the image of above should be the result.
If you have errors, feel free to post them here or in a new topic.

Tcw.multiplayerforums.com
Tcw.multiplayerforums.com
Tcw.multiplayerforums.com
Goto your bin folder, here is where you will find the built items.
Release folder is for the GAME ONLY, copy all binary files (.exe and .dll) to the Game folder and overwrite the existing files.
Release SSGM folder is for the SERVER ONLY, you copy all the binary files (.exe and .dll) to the server root folder and overwrite the existing files.

Tcw.multiplayerforums.com
If we attach the script to the GDI Barracks Building Controller (the blue house icon), when the map is loaded the Barracks is "Created" and it will say "zunnie says hello!" in the chat area once.

Have fun experimenting with this. I will probably write some more simple scripts in tutorial style soon for this.

:)

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Tutorial
Browse
Tutorials
Report
Report
Share
Related Games
Tiberium Crystal War
Tiberium Crystal War First Person Shooter
Related Engines
SAGE (Strategy Action Game Engine)
SAGE (Strategy Action Game Engine) Proprietary
Related Groups
MPF
MPF Developer & Publisher