Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Random Crate.
Random Crate. [message #113245] Sun, 05 September 2004 15:44 Go to next message
Hammer_FIST is currently offline  Hammer_FIST
Messages: 17
Registered: September 2004
Karma: 0
Recruit
Hello, i have been looking into the scripts.dll mods, and i know a fair amount of C++, i was wondering, what do i use to detect when the crate is created, so that i can attach a script to it? i know how to do most of the random crate things, but i just dont know this part... any help would be very apreciated, thankyou.
Random Crate. [message #113248] Sun, 05 September 2004 16:01 Go to previous messageGo to next message
xptek is currently offline  xptek
Messages: 1410
Registered: August 2004
Location: USSA
Karma: 0
General (1 Star)
You'll need to attach the script you create to the object you would like detected when it's created.

void GG_St00pid_Script::Created(GameObject *obj) {
//LOLOL. Put your stuff.
}

Notice the Created.

Attach that to the present you'd like to be detected when it's created.


cause = time
Random Crate. [message #113249] Sun, 05 September 2004 16:04 Go to previous messageGo to next message
Hammer_FIST is currently offline  Hammer_FIST
Messages: 17
Registered: September 2004
Karma: 0
Recruit
i already know that, but what i do not know is how to detect when the object is created to attach said script to it...
Random Crate. [message #113250] Sun, 05 September 2004 16:05 Go to previous messageGo to next message
xptek is currently offline  xptek
Messages: 1410
Registered: August 2004
Location: USSA
Karma: 0
General (1 Star)
Attach that script to it in LE.

cause = time
Random Crate. [message #113251] Sun, 05 September 2004 16:06 Go to previous messageGo to next message
Hammer_FIST is currently offline  Hammer_FIST
Messages: 17
Registered: September 2004
Karma: 0
Recruit
i never thought of that Surprised thanx!
Random Crate. [message #113253] Sun, 05 September 2004 16:12 Go to previous messageGo to next message
xptek is currently offline  xptek
Messages: 1410
Registered: August 2004
Location: USSA
Karma: 0
General (1 Star)
lol, no problem. feel free to ask if you have any more questions.

cause = time
Random Crate. [message #113262] Sun, 05 September 2004 16:37 Go to previous messageGo to next message
Hammer_FIST is currently offline  Hammer_FIST
Messages: 17
Registered: September 2004
Karma: 0
Recruit
this may seem a dumb question, but how do i attach it in LE, i tryed but im not very good with it, could you help?
Random Crate. [message #113301] Sun, 05 September 2004 21:45 Go to previous messageGo to next message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma: 0
Recruit
lolx

void M00_CnC_Crate::Custom(GameObject *obj, int message, int param, GameObject *sender) {
if (message == 1000025) { // 1000025 is the one sent for powerup collected (i think)
Give_Powerup(sender, "bla bla");
}
}


http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif
Random Crate. [message #113324] Mon, 06 September 2004 07:50 Go to previous messageGo to next message
xptek is currently offline  xptek
Messages: 1410
Registered: August 2004
Location: USSA
Karma: 0
General (1 Star)
It's not fun hooking into old scripts. When I get LE reinstalled I'll make a quick tutorial.

cause = time
Random Crate. [message #113325] Mon, 06 September 2004 07:57 Go to previous messageGo to next message
Dan
Messages: 395
Registered: August 2003
Location: UK
Karma: 0
Commander
I'm in the finishing stages on my Random Crate script too... And btw, dont use "1000025" to detect the custom for when a crate is picked up... use "CUSTOM_EVENT_POWERUP" as it is MUCH easier to see what you are trying to do (and the number is 1000000025).

To attach a script to a GDI soldier in LE:

1) Start up LE and click on the new and type in a name. Click on OK.
2) Find your mod folder on your hard drive (usually C:\Program Files\Renegadepublictools\Level Edit\yourmodname and make a new folder called "Scripts"
3) Put your scripts.dll into the new folder.
4) In the folder things on the right, expand Object -> Soldier - >Soldier_Presets -> GDI -> GDI_MiniGunner_0 then select "CnC_GDI_MiniGunner_0", and click on the Mod button below the folders.
5) Go to the scripts Tab
6) Click on the Add button and in the "Type" box select your script name.
7) In the parameters rollout, select different parameters and set the value in the box below. and continue until all your params are set. click OK
Cool Click OK again and click on the red cross in the top right of the screen (to close LE)
9) When the message pops up asking to save the presets, click on Yes.
10) wait for it to close and then go to C:\Program Files\Renegadepublictools\Level Edit\yourmodname\presets and move your Objects.ddb into your renegade data folder. (Dont forget to put your scripts.dll into the renegade folder).
11) Load up renegade and enjoy!
Random Crate. [message #113326] Mon, 06 September 2004 08:02 Go to previous messageGo to next message
xptek is currently offline  xptek
Messages: 1410
Registered: August 2004
Location: USSA
Karma: 0
General (1 Star)
lol, so we have about three random crate scripts in development? Razz

cause = time
Random Crate. [message #113327] Mon, 06 September 2004 08:06 Go to previous messageGo to next message
Dan
Messages: 395
Registered: August 2003
Location: UK
Karma: 0
Commander
Lol seems so... I'm just fixing a few bugs that I find at the moment, should be done sometime soon. I'm also fixing a few bugs in my vehicle wreckage script (drops a wreckage when a vehicle dies which is rebuildable). I just need to alter the positions a bit so it doesnt get stuck in the ground when you repair it, and I need to add the new vehcile to the vehicle limit.
Random Crate. [message #113332] Mon, 06 September 2004 08:27 Go to previous messageGo to next message
xptek is currently offline  xptek
Messages: 1410
Registered: August 2004
Location: USSA
Karma: 0
General (1 Star)
I've done that as well before.. lol

cause = time
Random Crate. [message #113398] Mon, 06 September 2004 16:00 Go to previous messageGo to next message
RadioactiveKangaroo is currently offline  RadioactiveKangaroo
Messages: 32
Registered: May 2004
Karma: 0
Recruit
Oh noes.. not that Destroyed vehicle script again... don't make the shells worth too many points... I was on a server (not naming it) where the shells for the humm-vee were worth about 700 points...

Brian/Spîke < ... > says:
humans = the only creature that can spend more time trying to procreate than to survive.

http://users.cablemo.net/~mattjolly/Pics/Last%20Exile%20Siggie2.jpg
Random Crate. [message #113446] Tue, 07 September 2004 06:47 Go to previous messageGo to next message
Dan
Messages: 395
Registered: August 2003
Location: UK
Karma: 0
Commander
Yeh, I had that problem too when making it. When I repaired a shell i got around 400-500 points from it. So I just made it unteamed and the base defences wont shoot them and you get no points from repairing or destroying them.
Random Crate. [message #113453] Tue, 07 September 2004 09:16 Go to previous messageGo to next message
xptek is currently offline  xptek
Messages: 1410
Registered: August 2004
Location: USSA
Karma: 0
General (1 Star)
RadioactiveKangaroo

Oh noes.. not that Destroyed vehicle script again... don't make the shells worth too many points... I was on a server (not naming it) where the shells for the humm-vee were worth about 700 points...


Fuxu. Razz


cause = time
Random Crate. [message #113615] Wed, 08 September 2004 21:59 Go to previous messageGo to next message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma: 0
Recruit
lolx, LE....
hard code it into scripts.dll (use the force.....i mean source)


http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif
Random Crate. [message #114009] Sat, 11 September 2004 07:34 Go to previous messageGo to next message
Hammer_FIST is currently offline  Hammer_FIST
Messages: 17
Registered: September 2004
Karma: 0
Recruit
ok ok i tryed to do what you said, but im still confused, what EXACTLY do i need to attach the script to, to make it activate when the crate spawns?
Random Crate. [message #114033] Sat, 11 September 2004 10:36 Go to previous messageGo to next message
Dan
Messages: 395
Registered: August 2003
Location: UK
Karma: 0
Commander
In the bunch of preset 'folders' to the right of the LE screen, open them like this:

Object -> Spawner -> CnC_Spawners

Then select the one called "CnC_Spawner_Crate" then click on the "Mod" button below (has a pic of a hammer on it) and then go to the scripts tab, refer to my previous guide to go from there.
Random Crate. [message #114038] Sat, 11 September 2004 11:30 Go to previous messageGo to next message
Hammer_FIST is currently offline  Hammer_FIST
Messages: 17
Registered: September 2004
Karma: 0
Recruit
hmmm, that is what I did, i thought maybe there was something wrong with my code, i was trying to make a vehicle blocker spawn when the crate is created, this code should do it should it not?
void Test_Crate::Created(GameObject *obj) {
Commands->Create_Object("Vehicle_Blocker",Commands->Get_Position(obj));
}
Random Crate. [message #114064] Sat, 11 September 2004 13:49 Go to previous messageGo to next message
Dan
Messages: 395
Registered: August 2003
Location: UK
Karma: 0
Commander
This is the code I use in my Created() function of my script

void DAN_CnC_Crate::Created(GameObject * obj)
{
    Commands->Set_Model(obj,"vehcol2m"); 
    VehBlock = Commands->Create_Object("Vehicle_Blocker",Commands->Get_Position(obj));
}


VehBlock is a GameObject which is a private member of my script class. I use that later on script shutdown to destroy the vehicle blocker, cant have that sitting there now can we?

And yes, that looks like it should work. You did remember to move the objects.ddb from the LE's ''presets'' folder into your Renegade/Data folder didnt you?

[EDIT]

An advantage of changing the crate's model to "vehcol2m" is that you only have to touch the crate in order to pick up the crate, unlike in the BC servers where you have to run through the middle to do it.
Random Crate. [message #114066] Sat, 11 September 2004 13:55 Go to previous messageGo to next message
Hammer_FIST is currently offline  Hammer_FIST
Messages: 17
Registered: September 2004
Karma: 0
Recruit
yes i did move the objects there.... but it did keep renaming it too bjects, that wouldnt be why would it?
Random Crate. [message #114067] Sat, 11 September 2004 13:56 Go to previous messageGo to next message
Dan
Messages: 395
Registered: August 2003
Location: UK
Karma: 0
Commander
in the data folder it MUST be called objects.ddb otherwise renegade wont get the data from it. Dont call it bjects.ddb
Random Crate. [message #114068] Sat, 11 September 2004 14:14 Go to previous messageGo to next message
Hammer_FIST is currently offline  Hammer_FIST
Messages: 17
Registered: September 2004
Karma: 0
Recruit
Dan... the scripts names it bjects.dbb anyway... i dont know why... also... my renegade crashes instantly if its objects.ddb which is why my script wouldnt work Neutral
Random Crate. [message #114136] Sun, 12 September 2004 00:06 Go to previous messageGo to previous message
Dan
Messages: 395
Registered: August 2003
Location: UK
Karma: 0
Commander
Huh? So in C:\Program Files\Renegadepublictools\Level Edit\yourmod\presets objects.ddb is called bjects.ddb?
Previous Topic: scrips.dll 1.9.1 problem
Next Topic: DR: RA2 Vengeance, Sole Survivor, etc
Goto Forum:
  


Current Time: Sun Dec 01 10:55:18 MST 2024

Total time taken to generate the page: 0.02276 seconds