Random Crate. [message #113245] |
Sun, 05 September 2004 15:44 |
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 |
|
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 |
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 |
|
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 #113253] |
Sun, 05 September 2004 16:12 |
|
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 |
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 #113324] |
Mon, 06 September 2004 07:50 |
|
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 #113327] |
Mon, 06 September 2004 08:06 |
|
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 |
|
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 #113446] |
Tue, 07 September 2004 06:47 |
|
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 #114009] |
Sat, 11 September 2004 07:34 |
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 |
|
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 |
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 |
|
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 |
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 |
|
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 #114136] |
Sun, 12 September 2004 00:06 |
|
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?
|
|
|