Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Crate location and frequency
Crate location and frequency [message #419973] Sun, 14 February 2010 11:57 Go to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
quick question, im looking to change the frequency of a crate comming up and possibly add a second location to them.... My question is do I have to edit this in each map or is there someplace in the settings or code i need to change, Thanks!

Re: Crate location and frequency [message #419983 is a reply to message #419973] Sun, 14 February 2010 12: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)
If you're running SSGM it's different to stock ren, please supply this information.


Re: Crate location and frequency [message #419988 is a reply to message #419983] Sun, 14 February 2010 13:07 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
reborn wrote on Sun, 14 February 2010 13:48

If you're running SSGM it's different to stock ren, please supply this information.


sorry, yes i am running SSGM.

It's WindowsFDS
SSGM 2.02 i think , it's the newest
Running the latest scripts.. 3.4 i think it is?

[Updated on: Sun, 14 February 2010 13:08]

Report message to a moderator

Re: Crate location and frequency [message #419989 is a reply to message #419973] Sun, 14 February 2010 13:09 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
also I have a few question on some of your plug-ins reborn, should i open a new thread? Wink

[Updated on: Sun, 14 February 2010 13:09]

Report message to a moderator

Re: Crate location and frequency [message #419993 is a reply to message #419973] Sun, 14 February 2010 13:18 Go to previous messageGo to next message
CarrierII is currently offline  CarrierII
Messages: 3804
Registered: February 2006
Location: England
Karma: 0
General (3 Stars)

Here is fine unless Reborn would rather discussion occurred on his own forums.

Renguard is a wonderful initiative
Toggle Spoiler
Re: Crate location and frequency [message #419994 is a reply to message #419973] Sun, 14 February 2010 13:31 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)
I don't mind wherever, more people read these forums, so questions are probably better read and answered here I guess.

With SSGM, you could move the crate spawns. The object creation hook has a little look for the crates, and attaches it's own script to them, here:

	
else if (Is_Powerup(obj)) {
		if (!Data->Mod && isin(Commands->Get_Preset_Name(obj),"Crate")) {
			Attach_Script_Once(obj,"MDB_SSGM_Crate","");
		}


At this point, you could move the object to new location depending on the map.

For the frequency you would have to (AFAIK) either make the change in level edit by changing the spawn delay time to something else, or you could just create more crate objects via code, using your own type of crate manager.



Re: Crate location and frequency [message #419997 is a reply to message #419973] Sun, 14 February 2010 14:08 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
o.k. I think I understand,not quite sure... so i have to edit the ssmg code? or put something into the ssgm.ini for each map? ill look into it a little deaper, the second question I posted on your forum but i will post it here as well, people may be searching for the same answers Smile

Im running WGC's addon .... or replacement script and i can no longer use your !sellvehicle plugin. the FDS freezes then restarts itself in an endless loop, also the same with your
!Surrender plugin, is this because WGC uses a different version of scripts? thanks.

[Updated on: Sun, 14 February 2010 14:09]

Report message to a moderator

Re: Crate location and frequency [message #420006 is a reply to message #419973] Sun, 14 February 2010 14:55 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)
I have no idea what WGC's addon is or does. However, I know that the surrender system works fine standalone, so that would indicate that this other code you have is conflicting with it.


Re: Crate location and frequency [message #420007 is a reply to message #419973] Sun, 14 February 2010 15:05 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
thats what I figured, ran great before i added the other script, its the "crate options" "vet system" and !buy" addon

Re: Crate location and frequency [message #420025 is a reply to message #419973] Sun, 14 February 2010 23:29 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)
Well, I could only assume it has something to do with these scripts you recently added.

If you need more help with the frequency and positions of the crates, just yell. I will throw up some code/level edit screenies or something if you're stuck.



Re: Crate location and frequency [message #420047 is a reply to message #419973] Mon, 15 February 2010 12:21 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
Thank you sir, i fixed the othe rproblem, i took some freash code and installed the crate upgrades alone, then everything else worked. I also put in your code you posted on the thread for the crates and have it now working with your vet system, thanks Smile

I have to download teh level editing program and Will work on the frequency of the crates. I was hopping these was a ssgm.ini entry i could do but i'll go map for map if i have too Wink
Re: Crate location and frequency [message #420048 is a reply to message #419973] Mon, 15 February 2010 14: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)
Are you able to write and compile your own code?


Re: Crate location and frequency [message #420054 is a reply to message #420048] Mon, 15 February 2010 18:13 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
reborn wrote on Mon, 15 February 2010 15:16

Are you able to write and compile your own code?


kinda and yes Wink

I haven't worked in C++ in yeeeeeeeaaaaaarrrrrrssss, Im the kind of guy that will only do things when I need to, kinda a forced learning thing, i could never learn from a book.

Because of my love of the game, and my Friends at UN <Un Rules> I'm trying to update the new maps server. So I've been reading through the code, got my compiler <thanks to your wonderful threads> and am trying to get things rolling again Smile I love the feel of the Atomix server, it's made the game fun again with all the eastereggs and tricks... but prefure New maps... so I wish to bump up our server.... not to the etxent of course, but in the feel that they have...

I think that makes sense Wink

Re: Crate location and frequency [message #420055 is a reply to message #420054] Mon, 15 February 2010 18:14 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
got another one for you. Love your code Wink

I've spent about an hour, so I figured i would post up, I at least try to fix these things...

With your AirStrike function I can't get the base defences to stop shooting at them. any idea's?

I know you said in the thread to attach a destory script to the object, throw me a bone and show me where to do this.... im going to assume it's in the *.txt files...

[Updated on: Mon, 15 February 2010 21:08]

Report message to a moderator

Re: Crate location and frequency [message #420068 is a reply to message #419973] Tue, 16 February 2010 01: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)
My experience with the cinematic files is limited, and what I did know, has since faded. However, I remember it's possible to attach scripts to the objects...

Probably not the most straight forward way to do it, but it should be possible to make your own script on the server that on the ::Created event, does Commands->Set_Visible(obj, false);. This should stop the base defenses shooting the planes...

You could also on that same script start a timer, and on the timer expired event destroys the object. However, I believe if you look at some of the drop vehicle txt files they will give you an example of how to destroy objects directly on the txt file.

If you create this script and add it to your servers solution, then in the text file you should be able to attach that exact script to the objects you're creating (although there probably is a way to use that Commands->Set_Visible(obj, false); part directly in the text file too I would imagine.

I'm at work, so can't be more specific, if this doesn't help, or you need more help, just shout and I will try when I get home...

If you posted your code, and exactly what you're trying to do, then I could probably help you out a bit more...



Re: Crate location and frequency [message #420081 is a reply to message #419973] Tue, 16 February 2010 14:54 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
o.k.. i've tryed, the code im using is actually yours.

http://www.renegadeforums.com/index.php?t=msg&th=26881&prevloaded=1& rid=24977&start=0

I atempted your "times destruction that you posted on the last page but the vehicles still stay in teh air, I wouldn't mind them flying over for a long period of time, but the base defenses shoot at them.

I tryed the Set_visable but when I compiled it didn't understand the function. I even went in to see how the Spy is ignored by the ob and agt but I couldn't attach it to a vehicle...

where in your code would I put these funcions? again, im using your code from the link *scratches head*
Re: Crate location and frequency [message #420082 is a reply to message #420081] Tue, 16 February 2010 14:55 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
again, I know im a noob, but I promis I only have to be told once, a little hand holding please Wink
Re: Crate location and frequency [message #420119 is a reply to message #419973] Wed, 17 February 2010 07:58 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)
Post what you have done, and how you're calling the function. I will fix it for you.


Re: Crate location and frequency [message #420128 is a reply to message #419973] Wed, 17 February 2010 09:17 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
o.k.. let me redo it, I removed the code Wink
Re: Crate location and frequency [message #420129 is a reply to message #419973] Wed, 17 February 2010 09:24 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
i put this is gmmain.cpp

Quote:


void reb_timed_destroy::Created(GameObject *obj){
Commands->Start_Timer(obj,this,31.0f,1);
}

void reb_timed_destroy::Timer_Expired(GameObject *obj, int number){
if(number ==1){
Commands->Destroy_Object(obj);
}
}



ScriptRegistrant<reb_timed_destroy> reb_timed_destroy_Registrant("reb_timed_destroy","");
ScriptRegistrant<reb_GDI_a10_strike> reb_GDI_a10_strike_Registrant("reb_GDI_a10_strike","");
ScriptRegistrant<reb_Nod_Jet_strike> reb_Nod_Jet_strike_Registrant("reb_Nod_Jet_strike","");




then tryed to make the call in the txt files.

Quote:


;******************* CHEAT SHEET ******************************

;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim )
;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object
;Start frame Play_Audio wave filename slot number bone name
; * no slot # / bone name = 2D Audio
;0= NO LOOP ( kills object when finshed ) 1= LOOP

;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************



; ****************************** Character Bone

-1 Create_Real_Object, 1, "GDI_A10_Flyover"
-1 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 0
-600 destroy_object, 1
-900 attach_script, 1, "reb_timed_destroy", ""

; ****************************** Path

-1 Create_Object, 2, "X3_a10_dep1", 0, 0, 0, 0
-1 Play_Animation, 2, "X3_a10_dep1.X3_a10_dep1", 0
-600 Destroy_Object, 2
-1 Attach_To_Bone, 1, 2, "BN_a-10_004"
-900 attach_script, 2, "reb_timed_destroy", ""



vehicles still stay in the air.

then I tryed to put it right in the gmmain.cpp

Quote:


void reb_GDI_a10_strike::Created(GameObject *obj) {
Commands->Attach_Script(obj,"reb_timed_destroy","");
Commands->Create_2D_WAV_Sound("m00evan_dsgn0073i1evan_snd.wav");
Console_Input("msg [WGC] Warning!!!");
Console_Input("msg [WGC] A-10 GDI AirStrike ordered to Attack Nod's Base!");



but when i call for an airstrike, after 31 seconds *I* die LOL

when you see what I did, can you also explain what I did wrong so I can learn, thanks!
Re: Crate location and frequency [message #420132 is a reply to message #420129] Wed, 17 February 2010 10:34 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)
Khyron263 wrote on Wed, 17 February 2010 11:24

i put this is gmmain.cpp

Quote:


void reb_timed_destroy::Created(GameObject *obj){
Commands->Start_Timer(obj,this,31.0f,1);
}

void reb_timed_destroy::Timer_Expired(GameObject *obj, int number){
if(number ==1){
Commands->Destroy_Object(obj);
}
}



ScriptRegistrant<reb_timed_destroy> reb_timed_destroy_Registrant("reb_timed_destroy","");
ScriptRegistrant<reb_GDI_a10_strike> reb_GDI_a10_strike_Registrant("reb_GDI_a10_strike","");
ScriptRegistrant<reb_Nod_Jet_strike> reb_Nod_Jet_strike_Registrant("reb_Nod_Jet_strike","");




then tryed to make the call in the txt files.

Quote:


;******************* CHEAT SHEET ******************************

;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim )
;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object
;Start frame Play_Audio wave filename slot number bone name
; * no slot # / bone name = 2D Audio
;0= NO LOOP ( kills object when finshed ) 1= LOOP

;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************



; ****************************** Character Bone

-1 Create_Real_Object, 1, "GDI_A10_Flyover"
-1 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 0
-600 destroy_object, 1
-900 attach_script, 1, "reb_timed_destroy", ""

; ****************************** Path

-1 Create_Object, 2, "X3_a10_dep1", 0, 0, 0, 0
-1 Play_Animation, 2, "X3_a10_dep1.X3_a10_dep1", 0
-600 Destroy_Object, 2
-1 Attach_To_Bone, 1, 2, "BN_a-10_004"
-900 attach_script, 2, "reb_timed_destroy", ""



vehicles still stay in the air.

then I tryed to put it right in the gmmain.cpp

Quote:


void reb_GDI_a10_strike::Created(GameObject *obj) {
Commands->Attach_Script(obj,"reb_timed_destroy","");
Commands->Create_2D_WAV_Sound("m00evan_dsgn0073i1evan_snd.wav");
Console_Input("msg [WGC] Warning!!!");
Console_Input("msg [WGC] A-10 GDI AirStrike ordered to Attack Nod's Base!");



but when i call for an airstrike, after 31 seconds *I* die LOL

when you see what I did, can you also explain what I did wrong so I can learn, thanks!


In the second attempt, you're attaching the script to obj. If you are dieing, then the obj must be the player GameObject *.

I cannot remember much about the cinematic text files, but what you did looks pretty much like what I would of done. It might be better to port the whole cinematic to a single script.



Re: Crate location and frequency [message #420134 is a reply to message #419973] Wed, 17 February 2010 10:52 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
you mean instead of using a cinematic text file to control the a10s and jets to hard code it into thegmmain.cpp? wouldn't the whole script need to be redone then?

At this point thats a little beyond me Wink

what is we attached the "spy" attributes to the jet objects? that way we can leave the flying, but the base defences will not attack them?

hmmmmm.....
Re: Crate location and frequency [message #420139 is a reply to message #420134] Wed, 17 February 2010 13:03 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
o.k. after reading up and seeing what othe rpeople did I did this...

Quote:


;_________________________________________
;
; Available Cinematic Script Commands
;
; time/frame Create_Object, id (slot), preset_name, x, y, z, facing, animation
; id can be -1 to mean do not store this object, and do not destroy
; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump"
;
; time/frame Destroy_Object, id (slot)
; 0 Destroy_Object, 0
;
; time/frame Play_Animation, id (slot), animation_name, looping, sub_obj_name
; 0 Play_Animation, 0, "Human.Jump", false
;
; time/frame Control_Camera, id ( slot )
; use id -1 for disabling control;
; note this will also disable star control and disbale the hud
; 0 Control_Camera, 0
;
;_________________________________________

;******************* CHEAT SHEET ******************************

;Start frame create_object slot number model x,y,z,facing animation name( model*hierarchy*.anim )
;Start frame Play_Animation slot number anim name ( model*hierarchy*.anim ) looping Sub Object
;Start frame Play_Audio wave filename slot number bone name
; * no slot # / bone name = 2D Audio
;0= NO LOOP ( kills object when finshed ) 1= LOOP

;************************* LEVEL 3: HOVERCRAFT EXPLODE AT BEACH ************************



; ****************************** Character Bone

-0 Create_Real_Object, 1, "Nod_Jet"
-0 Play_Animation, 1, "vf_gdi a10.vf_gdi a10", 1



; ****************************** Path

-0 Create_Object, 2, "X3_a10_dep1", 0, 0, 0, 0
-0 Play_Animation, 2, "X3_a10_dep1.X3_a10_dep1", 1
-0 Attach_To_Bone, 1, 2, "BN_a-10_004"

; ****************************** CleanUp

-400 Destroy_Object, 1
-400 Destroy_Object, 2


-900 attach_script, 1,2, "JFW_Destroy_Self_Timer","Time:10,TimerNum:100"



now, it worked for the NOD jets, but not the a-10s... so i went back into the code and noticed that in the NOD code it said..

Quote:


if(number == 5){
Commands->Create_2D_WAV_Sound("m00itoc_010in_ners_snd.wav");
Commands->Attach_Script(a101,"Test_Cinematic","jet_1.txt");
Commands->Attach_Script(a101,"Test_Cinematic","jet_2.txt");
Commands->Attach_Script(a101,"Test_Cinematic","jet_6.txt");
Commands->Attach_Script(a101,"Test_Cinematic","jet_3.txt");
Commands->Attach_Script(obj,"reb_Nod_Jet_strike7","");



and on GDI is just had this.

Quote:


if (number == 5){
Commands->Create_2D_WAV_Sound("mx0_a-10_166.wav");
Commands->Attach_Script(a101,"Test_Cinematic","a10_1.txt");
Commands->Attach_Script(a101,"Test_Cinematic","a10_4.txt");
Commands->Attach_Script(a101,"Test_Cinematic","a10_5.txt");
Commands->Attach_Script(a101,"Test_Cinematic","a10_6.txt");



do I added this call

Commands->Attach_Script(obj,"reb_GDI_a10_strike7","");

where it belongs and now everything is working Smile the planes make 2 passes and then go away... thanks for pointing me in the right direction Smile

[Updated on: Wed, 17 February 2010 13:33]

Report message to a moderator

Re: Crate location and frequency [message #420202 is a reply to message #419973] Thu, 18 February 2010 07:51 Go to previous messageGo to next message
Khyron263 is currently offline  Khyron263
Messages: 32
Registered: September 2009
Karma: 0
Recruit
hey Reborn, in that thread you put a link to some code to make the air strike available from a PT, but it was awhile ago and the link is dead. do you still have it can can U please repost it? Thanks Smile
Re: Crate location and frequency [message #420641 is a reply to message #419973] Tue, 23 February 2010 08:07 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Ah, the link has changed... Also, it was a chat hook to in a way "purchase" the air strike. I hate these chat commands really, but if you insist...
I don;t believe I had any conditional checks either, like if infantry building was still alive etc etc...
But might help you understand things a little clearer.

http://www.mp-gaming.com/reborns/coderelease/white.zip



Previous Topic: CloudyServ download?
Next Topic: Does anyoen have
Goto Forum:
  


Current Time: Sat Dec 21 03:08:54 MST 2024

Total time taken to generate the page: 0.01181 seconds