Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » crate question
crate question [message #270832] Wed, 04 July 2007 21:52 Go to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
1)Is it possible to make a script so the money crate wont pop up for like 200 seconds at the start of everymap?
2)the mutants run to fast and lag i decreased the speed and increased the mass but it still runs fast and lags back how can i fix it?
3)how can i make it so crate vechs (like flame shots chem instead of flame) and when u buy crate u still have normal vechs but the crate ones have new things added
4)how can i make a basic crate>? i understand u make the code but dont u have to add other stuff and in the ssgm.ini file add a crate thing as well?
Re: crate question [message #270847 is a reply to message #270832] Thu, 05 July 2007 00:05 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
joe937465 wrote on Thu, 05 July 2007 00:52

1)Is it possible to make a script so the money crate wont pop up for like 200 seconds at the start of everymap?



Yes.

joe937465 wrote on Thu, 05 July 2007 00:52


2)the mutants run to fast and lag i decreased the speed and increased the mass but it still runs fast and lags back how can i fix it?



Changing the speed of any preset makes it warp and appear to "lag", but it's just the server adjusting itself because the client still thinks it's going at a different speed. You cannot change the speed of any character without this crappy effect. Not that I am aware anyway, I am pretty sure about this...

joe937465 wrote on Thu, 05 July 2007 00:52


3)how can i make it so crate vechs (like flame shots chem instead of flame) and when u buy crate u still have normal vechs but the crate ones have new things added



Most, if not all vehichles have more then one preset use the same model. You could make your mods to an unused (one that doesn't start "cnc") vehichle preset, then go to the part of the code for the vehichle crate and change the preset that is created to your modified one (I can't remember if it is created in the cinematic file or the actual scripts.dll). This way a vehichle bought from the purchase terminal will not give your modified one, but the crate will.

joe937465 wrote on Thu, 05 July 2007 00:52


4)how can i make a basic crate>? i understand u make the code but dont u have to add other stuff and in the ssgm.ini file add a crate thing as well?


Crate percentages are softcoded in the .ini file yes.You would have to do the same if you wanted the percentages softcoded.
I would perhaps for the first time and sake of learning, mod a different existing crate first.



Re: crate question [message #270849 is a reply to message #270832] Thu, 05 July 2007 00:14 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
a)then how can i make this 200 sec code?
b) well i guess i cant use mutants?
c)back to the mod vech crate what about those

GDIRVC_buggy.txt type files change present as well? in them along with in the scripts?
d)well what i mean is i know i would have to make that script inside the crate custom section right? what else would i have to look for change edit or add?
Re: crate question [message #270856 is a reply to message #270849] Thu, 05 July 2007 01:08 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
joe937465 wrote on Thu, 05 July 2007 03:14

a)then how can i make this 200 sec code?



Use "The_Game()->GameDuration_Seconds " so that if the duration is > 200 then it destroys the crate if it is a money crate.

There is a far better way to do it, but this I think would be the simplest for you.

joe937465 wrote on Thu, 05 July 2007 03:14


b) well i guess i cant use mutants?



You can, just don't mess around with there speed. Or use a mutant that has the right speed you want (they vary).

joe937465 wrote on Thu, 05 July 2007 03:14


c)back to the mod vech crate what about those
GDIRVC_buggy.txt type files change present as well? in them along with in the scripts?



change the preset name in this part of the code to your modified one:

char *RandomVehicle[12][3] =
{
	{ "GDI Humvee",	"humvee", "CnC_GDI_Humm-vee" },
	{ "Nod Buggy", "buggy", "CnC_Nod_Buggy" },
	{ "GDI APC", "gdiapc", "CnC_GDI_APC" },
	{ "Nod APC", "nodapc", "CnC_Nod_APC" },
	{ "GDI MRLS", "mrls", "CnC_GDI_MRLS" },
	{ "Nod Mobile Artillery", "arty", "CnC_Nod_Mobile_Artillery"},
	{ "GDI Medium Tank", "med", "CnC_GDI_Medium_Tank" },
	{ "Nod Light Tank", "lighttank", "CnC_Nod_Light_Tank" },
	{ "Nod Flame Tank", "flamer", "Nod_Flame_Tank_Player" },
	{ "Nod Stealth Tank", "stank", "Nod_Stealth_Tank_Player" },
	{ "GDI Mammoth Tank", "mammy", "CnC_GDI_Mammoth_Tank" },
	{ "Nod Recon Bike", "recon", "Nod_Recon_Bike_Player"}
};


I would also make sure to have a look at the cinematic file for each one, there might be something happenening in there too that you need to look at.

joe937465 wrote on Thu, 05 July 2007 03:14


d)well what i mean is i know i would have to make that script inside the crate custom section right? what else would i have to look for change edit or add?


First places I would start would be:

void crate_defaults()
void crate_init()
void M00_CNC_Crate



[Updated on: Thu, 05 July 2007 01:09]

Report message to a moderator

Re: crate question [message #270857 is a reply to message #270832] Thu, 05 July 2007 01:34 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
well i replace a mutant instead of chem warrior and by default moved fast and lagged back ALOT

aslo ty now

" I would also make sure to have a look at the cinematic file for each one, there might be something happenening in there too that you need to look at."

where do i see or find that at?
Re: crate question [message #270858 is a reply to message #270832] Thu, 05 July 2007 02:05 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Part of the SSGM download contains server files for your server's data directory, in this download there are a bunch of cinematic files that are called when the player gets a vehichle crate. Open them up, looks for where it says something like "create real object", if it makes a cnc vehichle preset, then you need to change that preset to your modified one instead.






[Updated on: Thu, 05 July 2007 02:06]

Report message to a moderator

Re: crate question [message #270860 is a reply to message #270832] Thu, 05 July 2007 03:02 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
o u mean all them txt files in data folder right?
Re: crate question [message #270864 is a reply to message #270832] Thu, 05 July 2007 03:26 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Yes, there the cinematic files for the vehichle crates. Or most of them are anyway.


Re: crate question [message #270877 is a reply to message #270832] Thu, 05 July 2007 04:38 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
1)so thats ALL i have to do? in scripts change present i modded.......change the cinematic files in the data folder files into present im using and thats it?


2)so how do i set this up? The_Game()->GameDuration_Seconds <--that

3)now out of these to make a new crate

void crate_defaults()
void crate_init()
void M00_CNC_Crate

i cant find the first 2 and the third one do i add on to the MDB_SSGM_Crate::Custom one
or make a new one?

[Updated on: Thu, 05 July 2007 04:49]

Report message to a moderator

Re: crate question [message #270889 is a reply to message #270877] Thu, 05 July 2007 05:16 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
joe937465 wrote on Thu, 05 July 2007 07:38

1)so thats ALL i have to do? in scripts change present i modded.......change the cinematic files in the data folder files into present im using and thats it?



Yeah, just change the preset. Then change the preset name in the scripts.dll source files and cinematic files to the one you have modded.

joe937465 wrote on Thu, 05 July 2007 07:38


2)so how do i set this up? The_Game()->GameDuration_Seconds <--that



Just add it to the crate manager code so that if the money crate is created within 200 seconds of the map being loaded then it destroys it.

joe937465 wrote on Thu, 05 July 2007 07:38


3)now out of these to make a new crate

void crate_defaults()
void crate_init()
void M00_CNC_Crate

i cant find the first 2 and the third one do i add on to the MDB_SSGM_Crate::Custom one
or make a new one?


I got those script names from ssaow 1.5 source code which I have at work. I dont have access to ssgm right now, but the names should be fairly similar.

And your question about ::custom, when I list "M00_CNC_Crate" I mean all of the script, that means created, custom, killed, damaged, timer etc etc etc...
There should also be a MDB_CNC_Crate too, or something similar which you might need to edit.



Re: crate question [message #270976 is a reply to message #270832] Thu, 05 July 2007 13:38 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
ok almost done here back to the money crate thing

The_Game()->GameDuration_Seconds <---is that the full code or mor like

The_Game(500)->GameDuration_Seconds




also where can i find the gmax models of the no turrent and nod ceiling gun used ingame?

[Updated on: Thu, 05 July 2007 14:01]

Report message to a moderator

Re: crate question [message #270989 is a reply to message #270832] Thu, 05 July 2007 14:48 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
You are going off topic with another question, you havn't even sorted this problem yet. You do this all the time, you drag me into more and more questions (which is my fualt for letting you, but I am a problem solver by nature and can't help myself sometimes).

I am going to stick with the crate question.

It seems to me that you are again just asking me to write the code for you, then you slap it into your mod.

You have a few options here

//Option one

If you want a quick and easy solution then just make the first crate only spawn after 200 seconds, regardless of it's type. To do this just go to the code shown here:


void Crate_Level_Loaded() {
	int	Total = Settings->CrateDeath + Settings->CrateVehicle + Settings->CrateWeapon + Settings->CrateCharacter + Settings->CrateMoney + Settings->CratePoints + Settings->CrateTiberium + Settings->CrateAmmo + Settings->CrateHealth + Settings->CrateArmor + Settings->CrateRefill + Settings->CrateButterFingers + Settings->CrateSpy + Settings->CrateThief + Settings->CrateBeacon + Settings->CrateStealth;
	if (Total != 100) {
		Crate_Defaults();
		FDSMessage(StrFormat("Total crate percentages equal %d instead of 100. Using default percentages.",Total),"_ERROR");
	}
	Data->CrateLastPickup = -181;
	Data->CrateExists = false;
	Data->CrateID = 0;
}


Then on the line " Data->CrateLastPickup = -181;" change the value to "20". This will mean that a crate will not spawn on the map for 200 seconds.


//Option two

Just delete the crate if it tries to spawn a money crate within 200 seconds of the map starting.

To do this you will need to modify the script "void MDB_SSGM_Crate::Created(GameObject *obj) {" shown here:

void MDB_SSGM_Crate::Created(GameObject *obj) {
	PickedUp = false;
	if (!Settings->EnableCrates	|| Settings->GameMode == 3 || Settings->GameMode ==	4) {
		Commands->Destroy_Object(obj);
		return;
	}
	else if	(Settings->EnableCrates	&& Settings->EnableNewCrates) {
		if (Data->CrateExists || (The_Game()->GameDuration_Seconds - Data->CrateLastPickup) < 180) {
			Commands->Destroy_Object(obj);
			return;
		}
		Data->CrateExists = true;
		Commands->Set_Model(obj,"vehcol2m");
	}
	Set_Is_Powerup_Persistant(obj,true);
	Set_Powerup_Always_Allow_Grant(obj,true);
	Set_Powerup_Grant_Sound(obj,0);		
}


Ok, now you see the two lines:
		if (Data->CrateExists || (The_Game()->GameDuration_Seconds - Data->CrateLastPickup) < 180) {
			Commands->Destroy_Object(obj);


Well that basically says (assuming you are running aow mode and have the new crates enabled in the .ini file) that if a crate is spawned within 180 seconds of the last crate being spawned then it destroys it (that why in the previous option i told you to initialise the crate last pickup as 20, because the server would do (0-20), giving -20, so it would be another 180 seconds plus the 20 extra so 200 until it allowed a crate to spawn. Left at -181 it means a crate can spawn on map load and 3 mins thereafter).
This code sounds similar to what you want right?
So what I would do is study that code and copy/paste it and adapt it to my needs.
All you have to do is add a few lines under those two lines under an if syntax saying if the gameduration is less then 200 ("if(The_Game()->GameDuration_Seconds < 200)") and the crate happens to be a money crate, then destroy the object.


//Option three

I really can't be bothered to go on anymore... But there are allot more ways you can do this. Probably all of them more efficient then I have show, but none simpler (other then removing the crate completely).


Now I am pretty sure you are going to want to go with option two. And in anticipation of you asking what exactly is the code to add and where exactly to add it, word for word, operator for operator and line for line. I am going to encourage you to work it out yourself Razz



Re: crate question [message #271018 is a reply to message #270832] Thu, 05 July 2007 17:05 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
thanks bud so im a lil mixed up so the crate only wont spawns for 200 sec every tiem u get ti and second one jsut delete that crate if it spawns before 200 sec? i think number 2 sounds good

ok this is what i added just like u put
void MDB_SSGM_Crate::Created(GameObject *obj) {
	PickedUp = false;
	if (!Settings->EnableCrates	|| Settings->GameMode == 3 || Settings->GameMode ==	4) {
		Commands->Destroy_Object(obj);
		return;
	}
	else if	(Settings->EnableCrates	&& Settings->EnableNewCrates) {
		if (Data->CrateExists || (The_Game()->GameDuration_Seconds - Data->CrateLastPickup) < 360) {
			Commands->Destroy_Object(obj);
			return;
		}
		Data->CrateExists = true;
		Commands->Set_Model(obj,"vehcol2m");
	}
	Set_Is_Powerup_Persistant(obj,true);
	Set_Powerup_Always_Allow_Grant(obj,true);
	Set_Powerup_Grant_Sound(obj,0);		
}

so if money crates show up before the time is up it will destroy itself and all other crates and everything else whould be normal and the same?
Re: crate question [message #271089 is a reply to message #270832] Thu, 05 July 2007 21:59 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
No. You've managed to make the crate allowed to spawn every six minutes.


Re: crate question [message #271102 is a reply to message #270832] Thu, 05 July 2007 23:51 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Infact after re-reading your post you have mis-understood even more then I originally thought.

The first option would of spawned the first crate after 200 seconds, and 180 seconds thereafter.

The second option was trying to show you how you would make it so that if the money crate spawns within 200 seconds of the map load then it destroys itself, but all other crates are capable of spawning immediately. This option also mean crates will only spawn every 180 seconds.

What you have managed to do is make it so that the first crate won't spawn for three minutes, then six minutes thereafter. And I am not refering specifically to the money crate, what you have done applies to all crates.



Re: crate question [message #271336 is a reply to message #270832] Fri, 06 July 2007 22:10 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
dang how can i fix it?
Re: crate question [message #271380 is a reply to message #270832] Sat, 07 July 2007 02:20 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
joe937465 wrote on Sat, 07 July 2007 01:10

dang how can i fix it?


Reborn wrote on Thu, 05 July 2007 17:48


It seems to me that you are again just asking me to write the code for you, then you slap it into your mod.




Reborn wrote on Thu, 05 July 2007 17:48

in anticipation of you asking what exactly is the code to add and where exactly to add it, word for word, operator for operator and line for line. I am going to encourage you to work it out yourself Razz


Re-read the posts, it should make sense...



Re: crate question [message #271381 is a reply to message #270832] Sat, 07 July 2007 02:21 Go to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
lol ok and thanks again
Previous Topic: W3D export settings & LE Settings for invisible collision boxes
Next Topic: Ressurection mod --> Muzzle Flash
Goto Forum:
  


Current Time: Mon Dec 30 09:04:45 MST 2024

Total time taken to generate the page: 0.01143 seconds