Home » Renegade Discussions » Mod Forum » Crate location and frequency
Crate location and frequency [message #419973] |
Sun, 14 February 2010 11:57 |
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 #419988 is a reply to message #419983] |
Sun, 14 February 2010 13:07 |
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 #419994 is a reply to message #419973] |
Sun, 14 February 2010 13:31 |
|
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 |
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
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 |
|
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 #420025 is a reply to message #419973] |
Sun, 14 February 2010 23:29 |
|
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 #420055 is a reply to message #420054] |
Mon, 15 February 2010 18:14 |
Khyron263
Messages: 32 Registered: September 2009
Karma: 0
|
Recruit |
|
|
got another one for you. Love your code
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 |
|
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 |
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 #420129 is a reply to message #419973] |
Wed, 17 February 2010 09:24 |
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 |
|
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 #420139 is a reply to message #420134] |
Wed, 17 February 2010 13:03 |
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 the planes make 2 passes and then go away... thanks for pointing me in the right direction
[Updated on: Wed, 17 February 2010 13:33] Report message to a moderator
|
|
|
|
|
Pages (2): [1 ] |
|
Goto Forum:
Current Time: Sat Dec 21 03:24:20 MST 2024
Total time taken to generate the page: 0.01752 seconds
|