Home » Renegade Discussions » Mod Forum » Scripting Help
Re: Scripting Help [message #418244 is a reply to message #418187] |
Sat, 23 January 2010 03:39 |
|
Omar007
Messages: 1711 Registered: December 2007 Location: Amsterdam
Karma:
|
General (1 Star) |
|
|
@Your script zone questions;
Gen_Blacky wrote on Sat, 23 January 2010 07:10 | Thank you how would i set the size of the script zone and did I use the xyz cords wrong.
GameObject *zone = Commands->Create_Object("Script_Zone_All",Vector3(-83.531f,-89.294f,-0.589f));
How do i use
Attach_Script_Once
or
Attach_Script
with more then 3 peramters ?
Would i do it like this ?
Commands->Attach_Script(zone,"script",team,msg);
|
The use of the Vector3 seems OK. You just have to make sure the coords are right
Also im not sure it works with creating script zones. It does work with PhysicalGameObjects. Never tried it on zones
I dont know how you can set the size, sorry
Attach_Script_Once(obj,"script","param1,param2,param3");
Commands->Attach_Script(obj,"script","param1,param2,param3");
@Your code;
Well the first thing i dont get is why you would increase nodplayers when GDI uses the command;
if (team == 1)
{
printf("GDI\n");
nodPlayers++;
....
and gdiplayers when nod uses it.
if (team == 0)
{
printf("NOD\n");
gdiPlayers++;
....
No wonder it says TEAMS EVEN when you used !tc on Nod. GDI had only 1 player and Nod 2 but you increased GDI first meaning both teams have 2 according to your code
This piece of code is in both teams useless because you increased it by 1 first AND becasue you check for gdiPlayers < nodPlayers first it will never reach this.
else if (gdiPlayers == 0) //or nodPlayers in GDI ;)
{
char message[256];
sprintf(message,"msg You are the only player on Nod.", Get_Player_Name_By_ID(ID));
Console_Input(message);
//Console_Input(StrFormat("msg You are the only player on Nod.",Get_Player_ID(obj)).c_str();
}
And you are letting it say 'You are the only player on Nod/GDI' while you didnt even checked for that
What i would do is remove
nodPlayers++;
gdiPlayers++;
and change
else if (gdiPlayers == 0) //or nodPlayers in GDI ;)
{
char message[256];
sprintf(message,"msg You are the only player on Nod.", Get_Player_Name_By_ID(ID));
Console_Input(message);
//Console_Input(StrFormat("msg You are the only player on Nod.",Get_Player_ID(obj)).c_str();
}
To
else if (gdiPlayers == 0 && nodPlayers == 1) //or nodPlayers && gdiPlayers in GDI ;)
{
char message[256];
sprintf(message,"msg You are the only player on Nod.", Get_Player_Name_By_ID(ID));
Console_Input(message);
//Console_Input(StrFormat("msg You are the only player on Nod.",Get_Player_ID(obj)).c_str();
}
and put this as the first action (before the if(gdiPlayers < nodPlayers))
Or just leave it out. Why wouldnt the player have rights to swap when he is the only one?
I hope this helped you
[Updated on: Sat, 23 January 2010 04:05] Report message to a moderator
|
|
|
|
|
Scripting Help
|
|
|
Re: Vector3 pos
By: Sir Kane on Fri, 22 January 2010 16:31
|
|
|
Re: Vector3 pos
By: zunnie on Fri, 22 January 2010 22:16
|
|
|
Re: Vector3 pos
|
|
|
Re: Vector3 pos
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 03:39
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 13:01
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 15:23
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sun, 24 January 2010 03:38
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 27 January 2010 07:34
|
|
|
Re: Scripting Help
By: cAmpa on Mon, 25 January 2010 15:31
|
|
|
Re: Scripting Help
By: Hex on Wed, 27 January 2010 07:06
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 27 January 2010 17:52
|
|
|
Re: Scripting Help
By: Hex on Thu, 28 January 2010 02:44
|
|
|
Re: Scripting Help
By: raven on Thu, 28 January 2010 10:31
|
|
|
Re: Scripting Help
By: reborn on Fri, 29 January 2010 16:37
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Sat, 30 January 2010 03:08
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 24 February 2010 03:35
|
|
|
Re: Scripting Help
By: Tunaman on Wed, 24 February 2010 08:16
|
|
|
Re: Scripting Help
By: raven on Wed, 24 February 2010 08:40
|
|
|
Re: Scripting Help
By: reborn on Wed, 24 February 2010 08:45
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Wed, 24 February 2010 12:46
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Wed, 24 February 2010 14:47
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Hex on Sun, 04 April 2010 02:44
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
Goto Forum:
Current Time: Fri Dec 20 02:42:03 MST 2024
Total time taken to generate the page: 0.01201 seconds
|