Author Topic: Client Sided RPG Mod  (Read 1390 times)

So I like got a copy of blockland to test all my scripts on there so I won't mess with any important stuff on my main blockland. Anyway i've come up with a script called a client sided RPG mod. Not like Nexus' adventure mod. All I need is a complete explanation on how to use blockland's wait command. If there is none or not even any simmiliar then is there even another way to do it?

You could use schedules to delay functions.

Code: [Select]
schedule(time in milliseconds, obj(usually 0), function name, arg1, arg2, arg3, ...);
just one thing:

Code: [Select]
echo(1);
schedule(1000, 0, echo, "2");
echo(3);

This will echo 1, then 3, then wait one second and echo 2 like this:
1
3
2


Or you could do this:

Code: [Select]
schedule(2000, 0, eval, "
dosomestuff(\"make sure to use backslashes for quotes inside here\");
dosomeotherstuff(32);
echo(\"asdf\");
");
« Last Edit: September 02, 2011, 09:36:51 PM by Scars75 »

You could use schedules to delay functions.

Code: [Select]
schedule(time in milliseconds, obj(usually 0), function name, arg1, arg2, arg3, ...);
just one thing:

Code: [Select]
echo(1);
schedule(1000, 0, echo, "2");
echo(3);

This will echo 1, then 3, then wait one second and echo 2 like this:
1
3
2


Ok thanks Scars I will keep that in mind but i've been tweaking my client.cs file for it a bit. Tested it out multiple times and always got the same error. It says the error halt is in the lines with the ## stuff in it. I just guess that means where the error is. But those errors were in my variable placings. It looked like Health = ##0##;

Ok thanks Scars I will keep that in mind but i've been tweaking my client.cs file for it a bit. Tested it out multiple times and always got the same error. It says the error halt is in the lines with the ## stuff in it. I just guess that means where the error is. But those errors were in my variable placings. It looked like Health = ##0##;
Show me your code.

Show me your code.
Code: [Select]
//Script Side Variables
Health = 0;
Hunger = 0;
Thirst = 0;

Package InGameRPG
{
echo("InGameRPG Package run successfully.");
echo("Hunger - (T)");
};

Code: [Select]
//Script Side Variables
Health = 0;
Hunger = 0;
Thirst = 0;

Package InGameRPG
{
echo("InGameRPG Package run successfully.");
echo("Hunger - (T)");
};

Variables need to have % or $ in front of the name. % for local and $ for global.

Code: [Select]
$ClRpg_Health = 0;
$ClRpg_Hunger = 0;
$ClRpg_Thirst = 0;

Package InGameRPG
{
echo("InGameRPG Package run successfully.");
echo("Hunger - (T)");
};

You should name them something like that.

Variables need to have % or $ in front of the name. % for local and $ for global.

Code: [Select]
$ClRpg_Health = 0;
$ClRpg_Hunger = 0;
$ClRpg_Thirst = 0;

Package InGameRPG
{
echo("InGameRPG Package run successfully.");
echo("Hunger - (T)");
};

You should name them something like that.
OH STUPID ME
I'm so dumb I didn't recognize that.
Thanks for helping my Scars. I appreciate it
Now I've got alot of work to do in scripting tonight. :/

Sorry for double post. But I've edited my variables and made it like yours.
Blockland then gave me another error when i've used the exec command for it. I'm so lazy :3
The places where the error was found was where I've put my first { to put my statements in my package.
It was like:

Package InGameRPG
##
##{

^statements and all that other stuff

Sorry for double post. But I've edited my variables and made it like yours.
Blockland then gave me another error when i've used the exec command for it. I'm so lazy :3
The places where the error was found was where I've put my first { to put my statements in my package.
It was like:

Package InGameRPG
##
##{

^statements and all that other stuff
Package has to have a lowercase P, torque is picky about that for some reason.

Package has to have a lowercase P, torque is picky about that for some reason.
Tried that.. It only moved the evil ##'s down to surround the first quotation mark that i used for the echo command. Like it was like this
echo(##"##balhblahblahbalhb

Tried that.. It only moved the evil ##'s down to surround the first quotation mark that i used for the echo command. Like it was like this
echo(##"##balhblahblahbalhb
I did some testing, and it seems you can't call functions inside packages. Just activate the package and it will echo that it worked if it was successful. Why are you using a package anyways?

I did some testing, and it seems you can't call functions inside packages. Just activate the package and it will echo that it worked if it was successful. Why are you using a package anyways?

Oh well... I was thinking like making a console rpg mod. Like an imaginary person with health, thirst, hunger and all that. And his hunger and thirst increased by the minute. And if I don't want to RP right now then Packaging comes to the rescue! I can RPG when I want to and not RPG when I want to.

Second Double post in my own topic ftw

Anyway I will continue this tommorow because I am not so bright at scripting at night... Need to refresh my brain you kno'.

Ok i've decided to work on my script today. I need help on describing variable when using the echo function. Like I already have a variable that I named health and I want it when I first start blockland to greet me and tell me the exact value of my health. I've tried this command:
Code: [Select]
echo("Hello Steve, you currently have ($ClRpg_Health) health");Edit: How do I display variables in console with echoes... All i'm asking...
« Last Edit: September 04, 2011, 06:48:25 PM by PurpleMetro »

To echo variables do like so:

echo("Your health is " @ $someVariable @ "."),
« Last Edit: September 04, 2011, 11:03:12 PM by infiniteLoop »