int ScriptMain(s_SC_L_info *info){
float fl;
int i;
s_SC_initside initside;
s_SC_initgroup initgroup;
c_Vector3 vec;
char txt[32];
BOOL hide_weapons,hide_CTF_flags,teamgame,hideRW;
void *c4nod;
info->next_exe_time = 10.0f;
switch (info->message)
{
case SC_LEV_MES_INITSCENE:
InitScene(info);
// hide C4
c4nod = SC_NOD_GetNoMessage(NULL,"c4");
if (c4nod) SC_DUMMY_Set_DoNotRenHier2(c4nod,TRUE);
switch(SC_ggi(GVAR_MP_MISSIONTYPE)){
case GVAR_MP_MISSIONTYPE_ATG:
switch(SC_ggi(GVAR_MP_MISSIONSUBTYPE)){
case 1:SC_SetObjectScript("bombplace","ini\\multiplayer\\scripts\\atg_dobj.c");break;
case 2:SC_SetObjectScript("bombplace","ini\\multiplayer\\scripts\\bomb_dobj_vc.c");break;
}// switch(SC_ggi(GVAR_MP_MISSIONTYPE))
break;
case GVAR_MP_MISSIONTYPE_COOP://COOP_US
SC_SetObjectScript("sampan","LEVELS\\DEAD_END\\DATA\\MAP_D\\scripts\\obj_s\\_ANM_MWP_BOAT.c"); // sampan
break;
case 10://custom COOP_VC
I see, you you refer to the first type of whip trap (the swinging bamboo with spikes) script within your mapname/data/sublevelname/scripts/obj_s folder:
The second declaration script refers to the other type of whip trap (the one with the swinging spiked log, correct? and the script for that one is the "_WHIP_TRAP_RANDOM_2.c" you must have named to refer to this type of trap...
I was copy/pasting the whip_trap script "into" my level.c script as per your suggestion in the other section... "add script to trap object in level.c script
"...I misinterpreted what you were saying, and i was doing it wrong...
I will try to add the sc_def.h, that you mentioned in a PM, to even see if my script works this way (just out of curiousity)...If it doesn't, then i will do your method...I don't see any reason why it wouldn't work after this...
i know there are a more scripts like eg the turntable script (constant rotating object). is it needed to write it in level.c or synchronize it (especially this script)?
apfelbaum wrote:
i know there are a more scripts like eg the turntable script (constant rotating object).
Synchronization is needed to avoid that different players can see different state/position/..
If you use some continuous rotating then you probably don't need to synchronize it.
You will need it when players must see your object same time in same angle.
apfelbaum wrote:
is it needed to write it in level.c or synchronize it (especially this script)?
In level.c you can just attack script with object.
Other option in VC to attack script with object is to use script in same folder and with same name, then its attacked automatically. But after finalization editor don't add those *.scr (compiled scripts) to final game file and object cant work in game. It will work only when object with script are under scripts folder/subfolder.
I should write some tutorials to my scripts thread about "how to add scripts".
Ando, what do you mean by this statement, "- when "trees" are in right position then you can delete trap objects."
I have turned on "Show Subentities," and it will not allow me to delete trap objects...i can only select and move them...
Also, it says to "link the trap object to the tree", not "associate" correct???
When i duplicate the tree and trap object from the originals (which i placed outside of the map) the trap object becomes skinny...and the same happens with the macetrap when i duplicate its tree and trap object...Is this what you experience too?
can you please look at my file structure and script declarations in my level.c to see if i did things correctly? I am attaching the file to this post...
EDIT:
bugs:
- download and replace tree object for whip trap. I added wrong tree to attachment of whip trap script attachment before ( fixed now )
- in LEVEL.C is some wrong names
whiptrap#0 > _whip_trap#0 ( must match with trap name in map )
macetrap#0 > _mace_trap#0 ( must match with trap name in map )
__MaceTrap.c > _MaceTrap.c ( must match with c file name )
- first tree object name must end with 0 (_whip_trap_tree#0 and _mace_trap_tree#0)
- need to delete tree objects outside of map or just unlink trap from it.
I finished today my huey script with synchronized seats. Now just need to make small improvements and test it more.
Currently tested only with 2x editor.