I have problems with the heli script for VC2.
I finally got the UHD1.C working, but now the Heli script gives this error: "Line 65: Function body redefinition"
Do anybody know what it mean?
#define PARTS_COUNT 3
char OBJECT_NAME[PARTS_COUNT][32] = { "body.l1", "UH1B_Rotor_Main_LOD1", "UH1B_Rotor_Rear_LOD01"};
//these must be changed for other chopper then UH1D
#define ANIMATION "levels\\frenchroute\\data\\frenchroute_mp\\manm\\test.manm"
//path to the animation
SC_NOD_GetTransform(info->master_nod, &original_trans[0]);
for (i=0;i<3;i++)
SC_NOD_GetTransform(SC_NOD_Get(info->master_nod,OBJECT_NAME[i]),&original_trans[i+1]);
case SC_OBJ_MSG_RELEASE:
SC_MP_Synch_Remove(SYNCH_CHOPPERTIMER);
SC_NOD_SetTransform(info->master_nod, &original_trans[0]);
for (i=0;i<3;i++)
SC_NOD_SetTransform(SC_NOD_Get(info->master_nod,OBJECT_NAME[i]),&original_trans[i+1]);
SC_MANM_Release(MANM);
case SC_OBJ_MSG_DOTICK:
info->next_exe_time = 0.0;
switch (status){
case 1:
//flying
if (isserver()){
gTime += info->elapsed_time;
S_timer = gTime;
SC_MP_Synch_SendChanges(SYNCH_CHOPPERTIMER, TRUE);
// SC_sgf(GVARSYNCED,gTime);
} else {
//gTime = SC_ggf(GVARSYNCED);
gTime = gTime + info->elapsed_time;
if (C_timer>gTime)
gTime = C_timer;
}
SC_MANM_Set(MANM, 0, SC_NOD_Get(info->master_nod,OBJECT_NAME[0]), gTime);
if (gTime > animlength){
//animation ended, so do something about it. now it loops
gTime=0;
//commented code would release the chopper and move it to the original place
/*
Emitor_Release();
SC_NOD_GetWorldPos(SC_NOD_Get(info->master_nod,OBJECT_NAME[0]),&vec);
SC_SND_PlaySound3D(3159,&vec);
gTime=0;
status=2;
SC_NOD_SetTransform(info->master_nod, &original_trans[0]);
for (i=0;i<3;i++)
SC_NOD_SetTransform(SC_NOD_Get(info->master_nod,OBJECT_NAME[i]),&original_trans[i+1]);
SC_MANM_Set(MANM[0], 0, SC_NOD_Get(info->master_nod,OBJECT_NAME[0]), 0);
SC_DUMMY_Set_DoNotRenHier2(info->master_nod,TRUE);*/
return FALSE;
}
}
#define PARTS_COUNT 3
char OBJECT_NAME[PARTS_COUNT][32] = { "body.l1", "UH1B_Rotor_Main_LOD1", "UH1B_Rotor_Rear_LOD01"};
//these must be changed for other chopper then UH1D
#define ANIMATION "levels\\rescue_continue\\data\\rescue\\manm\\heli.manm"
//path to the animation
SC_NOD_GetTransform(info->master_nod, &original_trans[0]);
for (i=0;i<3;i++)
SC_NOD_GetTransform(SC_NOD_Get(info->master_nod,OBJECT_NAME[i]),&original_trans[i+1]);
case SC_OBJ_MSG_RELEASE:
SC_MP_Synch_Remove(SYNCH_CHOPPERTIMER);
SC_NOD_SetTransform(info->master_nod, &original_trans[0]);
for (i=0;i<3;i++)
SC_NOD_SetTransform(SC_NOD_Get(info->master_nod,OBJECT_NAME[i]),&original_trans[i+1]);
SC_MANM_Release(MANM);
case SC_OBJ_MSG_DOTICK:
info->next_exe_time = 0.0;
switch (status){
case 1:
//flying
if (isserver()){
gTime += info->elapsed_time;
S_timer = gTime;
SC_MP_Synch_SendChanges(SYNCH_CHOPPERTIMER, TRUE);
// SC_sgf(GVARSYNCED,gTime);
} else {
//gTime = SC_ggf(GVARSYNCED);
gTime = gTime + info->elapsed_time;
if (C_timer>gTime)
gTime = C_timer;
}
SC_MANM_Set(MANM, 0, SC_NOD_Get(info->master_nod,OBJECT_NAME[0]), gTime);
if (gTime > animlength){
//animation ended, so do something about it. now it loops
gTime=0;
//commented code would release the chopper and move it to the original place
/*
Emitor_Release();
SC_NOD_GetWorldPos(SC_NOD_Get(info->master_nod,OBJECT_NAME[0]),&vec);
SC_SND_PlaySound3D(3159,&vec);
gTime=0;
status=2;
SC_NOD_SetTransform(info->master_nod, &original_trans[0]);
for (i=0;i<3;i++)
SC_NOD_SetTransform(SC_NOD_Get(info->master_nod,OBJECT_NAME[i]),&original_trans[i+1]);
SC_MANM_Set(MANM[0], 0, SC_NOD_Get(info->master_nod,OBJECT_NAME[0]), 0);
SC_DUMMY_Set_DoNotRenHier2(info->master_nod,TRUE);*/
return FALSE;
}
}
// ************************************************************************************************************************ //
//
// File: Heli.cxx
// Description: Common code used by helicopters. It's controlled by messages sent by SC_ObjectScriptMessage()
// Author: Beny
//
// ************************************************************************************************************************ //
Redefinition means that you are trying to define some function which is already defined. Check in script which function it is (which line...) and then try to look inside include files if this function is already defined on another place... Voila, easy to fix. ;-)
EDIT: Now I can see it. Problem is ScriptMain() function. I don't understand your scripts (never scripted VC2), but it looks you have included one script to another. Is it right? Do you have two hueys with two different scripts or only one huey?
try to use heli.c script and delete there second line (include of uhd1.c file), there is rotor defined
about pilot - don't have idea, I never made scripts for vc2, but i think there are missing definitions of entry points/seats. I can help you with VC1 huey, but not with this one, sorry
For that script is missing one included script (#include "../../../../../g/machines/uh1d/uh1d.c" )
I improved that long time ago but it is still with bugs.
I tested my improved version today and there is missing sound and some warnings that MP sync. isn't released after map finish.
Visually all looks working and you can enter/ exit too.
I don't have time to finish or fix it, and don't want to upload it here because its not finished and with bugs.
I just uploaded all of the scripts from Indiglow site which utilized the helicopter in French Route for VC2...I am sure these scripts will contain information which will allow you to create a moving helicopter and the seating for the pilots and people in the chopper.
#define PARTS_COUNT 3
char OBJECT_NAME[PARTS_COUNT][32] = { "body.l1", "UH1B_Rotor_Main_LOD1", "UH1B_Rotor_Rear_LOD01"};
//these must be changed for other chopper then UH1D
#define ANIMATION "levels\\frenchroute\\data\\frenchroute_mp\\manm\\test.manm"
//path to the animation
Then crew.cxx
Code
#define GROUP 5
#define VEHICLENAME "uh1d"
#include <inc\shigor\ussoldier.cxx>
Then pilot1
Code
#define GROUP 5
#define VEHICLENAME "uh1d"
#include <inc\shigor\ussoldier.cxx>
additionally you will need 4 .MANM files created in 3dsmax: HQMACV_CRASH.MANM, HQMACV_LOOP1.MANM, HQMACV_PRELOOP.MANM, and TEST.MANM.
The code i uploaded is original code (with comments) added into the script. Luke did this so me and Andy would understand what is happening. Have you opened and looked at all the commenting Luke did in the scripts i uploaded?
I just uploaded the file for FrenchRoute to www.vietcong-coop..., You can open it in your editor, check out where things are, finalize it, and see how Luke got the helicopter working in that map...
i still dont know how to make the chopper work, i tried alot of stuff but couldnt get it to work, i couldnt open the frenchroute map in the editor it self becuase it gave an error
can you show me how to do it picture by picture (if you still know how to do it)? like they explained how to make ctf in vc2 on the vet forums
daan24 wrote:
i still dont know how to make the chopper work, i tried alot of stuff but couldnt get it to work, i couldnt open the frenchroute map in the editor it self becuase it gave an error
can you show me how to do it picture by picture (if you still know how to do it)? like they explained how to make ctf in vc2 on the vet forums