Home » Renegade Discussions » Mod Forum » Making A New Crate
Making A New Crate [message #271761] |
Sun, 08 July 2007 19:09 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
call me a n00b call me slow or dumb but i want to make a random vech spy crate
i jsut mainly got the random vech crate and edit some stuff added the commands to make it stealth and a spy and then mad some new
Cinematic with new names here it is i hope its not that bad :S
else if ((RandomIntCrate <= (percent+=Settings->CrateSpyVehicle)) && (Settings->CrateSpyVehicle > 0)) {
if (Get_Vehicle(sender) || Settings->GameMode != 1 || Settings->CrateVehSpawnPos[0].X == 0.0f ||
Settings->CrateVehSpawnPos[0].Y == 0.0f || Settings->CrateVehSpawnPos[0].Z == 0.0f || Settings->CrateVehSpawnPos[1].X == 0.0f ||
Settings->CrateVehSpawnPos[1].Y == 0.0f || Settings->CrateVehSpawnPos[1].Z == 0.0f) {
goto CrateStart;
}
Vector3 Pos = Settings->CrateVehSpawnPos[Get_Object_Type(sender)];
Damage_All_Vehicles_Area(999999.0f,"Laser_NoBuilding",Pos,2.0f,obj,0);
Commands->Set_Position(sender,Pos);
GameObject *Temp = Commands->Create_Object("Invisible_Object",Pos);
int Index = 0;
if (Rnd <= 25) Index = 0;
else if (Rnd <= 50) Index = 1;
else if (Rnd <= 70) Index = 2;
else if (Rnd <= 90) Index = 3;
else if (Rnd <= 110) Index = 4;
else if (Rnd <= 130) Index = 5;
else if (Rnd <= 145) Index = 6;
else if (Rnd <= 160) Index = 7;
else if (Rnd <= 170) Index = 8;
else if (Rnd <= 180) Index = 9;
else if (Rnd <= 190) Index = 10;
else Index = 11;
if (Settings->Is_Disabled(RandomVehicle[Index][2])) goto Reselect2;
Commands->Set_Is_Visible(sender,true);
Commands->Enable_Stealth(sender,true);
StrFormat2(message2,"%ls picked up a Random Vehicle Crate.",Get_Wide_Player_Name(sender));
StrFormat2(message1,"ppage %d [Crate] You Got A %s From The Random Spy Vehicle Crate!!!.",Get_Player_ID(sender),
RandomVehicle[Index][0]);
Commands->Attach_Script(Temp,"Test_Cinematic",StrFormat("%sRVC_Spy_%s.txt",Commands->Get_Player_Type(sender) ==
0?"Nod":"GDI",RandomVehicle[Index][1]).c_str());
Console_Input(StrFormat("msg Crate: Oh No! %Is just Got A Random Spy Vehicle!",Get_Wide_Team_Name(Team)).c_str());
if (Settings->Gamelog) {
Vector3 pos = Commands->Get_Position(sender);
StrFormat2(message3,"CRATE;VEHICLE;%s;%d;%s;%f;%f;%f;%f;%f;%f;%d", RandomVehicle[Index][0], Commands->Get_ID(sender),
Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z,
Commands->Get_Facing(sender),;Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender));
}
|
|
|
Re: Making A New Crate [message #271768 is a reply to message #271761] |
Sun, 08 July 2007 19:24 |
|
AoBfrost
Messages: 1248 Registered: March 2007
Karma: 0
|
General (1 Star) |
|
|
I'm trying to make a building damage crate for ssgm, I am editing the source directly as I dont know how to edit or make plugins (if i learn, i'll make my mod a plugin), i have the script for it for ssaow, but it's different in ssgm so the old coding is useless now....I'm not releasing it either, but what i want it to do is damage all enemy buildings by a random percentage (without killing it)
Joe...your spy veh crate is actually a good idea, i'd like to see spy stanks or spy hummers lol, byt spy hummers wont work unless they have new scripts, so the only way to make it work is make the spy veh crate a stank since it cant be seen, or else you;d have noobs with original scripts that see you driving a vehicle and base defenses dont attack you.....so use stanks.
Scrin wrote on Fri, 05 October 2007 12:19 | ''whoa im the photoshop''
|
KANE LIVES!!!
|
|
|
|
Re: Making A New Crate [message #271770 is a reply to message #271761] |
Sun, 08 July 2007 19:26 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
hmm well im not really sure how to change it to only get stank so i did the lazy thing and used all vechs unless soemone could help me with that part?
|
|
|
Re: Making A New Crate [message #271774 is a reply to message #271761] |
Sun, 08 July 2007 19:30 |
|
AoBfrost
Messages: 1248 Registered: March 2007
Karma: 0
|
General (1 Star) |
|
|
make it spawn the preset for a stealth tank in one of the lines, I'm not sure, i'm starting to code ssgm too, and sorry I cant release the source for the old mods i want to use in ssgm, I was told not to because they were custom, the only reason I have it is to help with ssgm coding for building dmg and other mods.
One thing i got to work though was kane crate, ion crate, and petrova crate, but those all i did was edit presets and all, not much scripting there....
Scrin wrote on Fri, 05 October 2007 12:19 | ''whoa im the photoshop''
|
KANE LIVES!!!
|
|
|
Re: Making A New Crate [message #271776 is a reply to message #271761] |
Sun, 08 July 2007 19:31 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
well i just need help finishing my spy vech crate and ill see what i can do about changing it to a stank
|
|
|
Re: Making A New Crate [message #271779 is a reply to message #271761] |
Sun, 08 July 2007 19:34 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Well what Joe done I think was just copy the existing random veh crate code and it's still using the same array. He should not have it choose the veh from the array at all.
|
|
|
|
Re: Making A New Crate [message #271781 is a reply to message #271779] |
Sun, 08 July 2007 19:36 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
yes but im not sure if i only take out the one part
int Index = 0;
if (Rnd <= 25) Index = 0;
else if (Rnd <= 50) Index = 1;
else if (Rnd <= 70) Index = 2;
else if (Rnd <= 90) Index = 3;
else if (Rnd <= 110) Index = 4;
else if (Rnd <= 130) Index = 5;
else if (Rnd <= 145) Index = 6;
else if (Rnd <= 160) Index = 7;
else if (Rnd <= 170) Index = 8;
else if (Rnd <= 180) Index = 9;
else if (Rnd <= 190) Index = 10;
else Index = 11;
or is there more to take out?
AoBfrost wrote on Sun, 08 July 2007 21:34 | I mean random veh sounds good, but from my experience using stealth suit drop mod in our server, we had to trash the mod because people with scripts older than 2.9.2 would see you normally while 2.9.2 and 3.0+ cant see you unless you attacked them...same for vehicles....it looks like it's stealthed, but to non custom scripted n00bs, it aint stealthed.
|
a men to that when i first played i did not know what scripts where but i got them and rg ahhaa
[Updated on: Sun, 08 July 2007 19:37] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Making A New Crate [message #271793 is a reply to message #271761] |
Sun, 08 July 2007 20:01 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
well then how do i make it where theres only one vech (stank) that will transport and transport u to the spot where the heli drops it of f just like the random vech crate? because some crates in inside tunnels and etc
|
|
|
|
Re: Making A New Crate [message #271829 is a reply to message #271761] |
Sun, 08 July 2007 21:39 |
|
AoBfrost
Messages: 1248 Registered: March 2007
Karma: 0
|
General (1 Star) |
|
|
Ahhh ummmmmm i'm not sure, but isnt it possible to copy or write a line that says the crate will give you a stank? because theres crates that give you certain objects all the time when you get that crate such as ummm dehealth...I dont know, joe your probably better than I am lol, if no one can help you, then try asking my friend, he's a c++ master in renegade modding, but recently he quit modding ren, but he still helps people here and there with scripts and coding, ask and he will answer pretty fast
look for [AoB]Saad in IRC: #eat-sock
he taught me c++ so if you have a question, ask him, he's very helpful.
Scrin wrote on Fri, 05 October 2007 12:19 | ''whoa im the photoshop''
|
KANE LIVES!!!
|
|
|
|
Re: Making A New Crate [message #271891 is a reply to message #271761] |
Mon, 09 July 2007 03:56 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Ok, the vehichles have the scripts attached to them in the cinematic file, not the source code to the scripts.dll. I have no idea if there is a script that makes something ignored by base defence.
What I am trying to say to you, is you need to attach a script to the vehichle in the cinematic to do what you want.
I would personally make a script using the following statements:
Commands->Set_Is_Visible(obj,false);
And call it something like joe_add_spy. Remember to destroy the script on ::killed
The actual code for the crate would something like this, but I havn't tested or compiled it, there is most likely missing syntax, this is just something for you to base your code on:
else if ((RandomIntCrate <= (percent+=Settings->CrateSpyVehicle)) && (Settings->CrateSpyVehicle > 0)) {
if (Get_Vehicle(sender) || Settings->GameMode != 1 || Settings->CrateVehSpawnPos[0].X == 0.0f || Settings->CrateVehSpawnPos[0].Y == 0.0f || Settings->CrateVehSpawnPos[0].Z == 0.0f || Settings->CrateVehSpawnPos[1].X == 0.0f || Settings->CrateVehSpawnPos[1].Y == 0.0f || Settings->CrateVehSpawnPos[1].Z == 0.0f) {
goto CrateStart;
}
Vector3 Pos = Settings->CrateVehSpawnPos[Get_Object_Type(sender)];
Damage_All_Vehicles_Area(999999.0f,"Laser_NoBuilding",Pos,2.0f,obj,0);
Commands->Set_Position(sender,Pos);
GameObject *Temp = Commands->Create_Object("Invisible_Object",Pos);
StrFormat2(message2,"%ls picked up a Random Vehicle Crate.",Get_Wide_Player_Name(sender));
StrFormat2(message1,"ppage %d [Crate] You got a special spy stank from the Spy Vehicle Crate.",Get_Player_ID(sender));
Commands->Attach_Script(Temp,"Test_Cinematic",StrFormat("%sSpy_Veh.txt",Commands->Get_Player_Type(sender) == 0?"Nod":"GDI"));
Console_Input(StrFormat("msg Crate: Looks like %ls just got a spy vehicle! Go them!",Get_Wide_Team_Name(Team)).c_str());
if (Settings->Gamelog) {
Vector3 pos = Commands->Get_Position(sender);
StrFormat2(message3,"CRATE;VEHICLE;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender));
}
}
This would mean that it only calls the "NodSpy_Veh.txt" and the "GSISpy_Veh.txt", which you would have to create, and make so it creates a stealth tank and then attaches you "joe_add_spy" script to it.
Something like this:
(You can adapt this for both cinematics, but this is the GDI version.
;************************* Transport Helicopter Hummvee Drop ************************
; ****************************** Trajectory Transport
-1 Create_Object, 1, "XG_TransprtBone", 0, 0, 0, 0
-1 Play_Animation, 1, "XG_TransprtBone.XG_HD_TTraj", 1
; ****************************** Transport
-1 Create_Real_Object, 2, "CnC_GDI_Transport", 1, "BN_Trajectory"
-1 Attach_Script, 2, "KAK_Prevent_Destruction_Until_Entered"
-1 Set_Primary, 2
-1 Attach_to_Bone, 2, 1, "BN_Trajectory"
-1 Play_Animation, 2, "v_GDI_trnspt.XG_HD_Transport",1
-700 destroy_object, 2
; ****************************** Trajectory Nod_Light_Tank
-1 Create_Object, 3, "XG_HD_HTraj", 0, 0, 0, 0
-1 Play_Animation, 3, "XG_HD_HTraj.XG_HD_HTraj", 1
; ****************************** Nod_Spy_Stank
-1 Create_Real_Object, 4, "CnC_Nod_Stealth_Tank", 3, "BN_Trajectory"
-1 Attach_Script, 4, "joe_add_spy"
-1 Attach_Script, 4, "M02_Player_Vehicle", "0"
-1 Attach_Script, 4, "KAK_Prevent_Destruction_Until_Entered"
-1 Attach_to_Bone, 4, 3, "BN_Trajectory"
-437 Attach_to_Bone, 4, -1, "BN_Trajectory"
-437 Move_Slot, 7, 4
; ****************************** Harness
-1 Create_Object, 6, "XG_HD_Harness", 0, 0, 0, 0
-1 Play_Animation, 6, "XG_HD_Harness.XG_HD_Harness", 0
;******************************* SigFlare
-1 Create_Real_Object, 8, "SignalFlare_Gold_Phys3"
-437 Destroy_Object, 8
; ****************************** Primary Destroyed
1000000 Destroy_Object, 1
1000000 Destroy_Object, 2
1000000 Destroy_Object, 3
1000000 Destroy_Object, 4
1000000 Destroy_Object, 5
1000000 Destroy_Object, 6
You will also need to amend the entries for:
void Crate_Defaults()
void Crate_Level_Loaded()
void CrateSettings
So that it includes you new crate (this is a simple task).
You should have all the information you need now to start working on your spy veh crate on your own now.
|
|
|
|
Re: Making A New Crate [message #271943 is a reply to message #271761] |
Mon, 09 July 2007 09:56 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
That shouldnt be hard to do as all you would need to do is get the position of the player then add 100 to his current Z, but doesnt work with tunnel crates
// What ever crate selection code goes here
// The main death code
Vector3 pos = Commands->Get_Position(sender);
pos.Z += 100;
Commands -> Set_Position(sender,pos);
As for joel, I thought enabling stealth on vehicles didnt work? :\
[Updated on: Mon, 09 July 2007 09:57] Report message to a moderator
|
|
|
Re: Making A New Crate [message #271945 is a reply to message #271761] |
Mon, 09 July 2007 10:00 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
You can enable stealth on vehichles, it just doesn't work for people not running the cp scripts update.
But he is doing it to a stank anyway...
|
|
|
|
|
|
Goto Forum:
Current Time: Sun Nov 10 04:21:48 MST 2024
Total time taken to generate the page: 0.01460 seconds
|