UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: ville88 on June 27, 2018, 10:56:53 pm

Title: script_struct scripts Need Help
Post by: ville88 on June 27, 2018, 10:56:53 pm
I'm trying to add a "script_struct" to the map without "radiant" using only the scripts but:
this script does not work
Code Snippet
Plaintext
main()
{
level thread struct_sounds();
}

struct_sounds()
{

struct_sounds = [];
struct_sounds[0] = spawnstruct();
struct_sounds[0].origin = (-208, 48, 16);
struct_sounds[0].targetname = "couch_loop";
struct_sounds[0].script_sound = "couch_loop";
struct_sounds[0].script_label = "looper";

}


help me fix it please :)
Title: Re: script_struct scripts Need Help
Post by: gympie6 on June 28, 2018, 06:03:39 am
I'm trying to add a "script_struct" to the map without "radiant" using only the scripts but:
this script does not work
Code Snippet
Plaintext
main()
{
level thread struct_sounds();
}

struct_sounds()
{

struct_sounds = [];
struct_sounds[0] = spawnstruct();
struct_sounds[0].origin = (-208, 48, 16);
struct_sounds[0].targetname = "couch_loop";
struct_sounds[0].script_sound = "couch_loop";
struct_sounds[0].script_label = "looper";

}


help me fix it please :)

Okeey,
1: where is your main connected to?
2: I don't know if that soundcode works for your struct so maybe you have to use this:
Struct_sound[0] playsound("soundName here");
Title: Re: script_struct scripts Need Help
Post by: ville88 on June 28, 2018, 06:15:33 am
I need it not only for sounds

Double Post Merge: June 28, 2018, 06:15:54 am
Okeey,
1: where is your main connected to?
2: I don't if that soundcode works for your struct so maybe you have to use this:
Struct_sound[0] playsound("soundName here");

You have to check in code reference if I am right about the parameter(s)

I need it not only for sounds
Title: Re: script_struct scripts Need Help
Post by: gympie6 on June 28, 2018, 06:20:03 am
I need it not only for sounds

Double Post Merge: June 28, 2018, 06:15:54 am
I need it not only for sounds

Now I only see "struct_sounds" what else do you need?
Title: Re: script_struct scripts Need Help
Post by: ville88 on June 28, 2018, 06:30:27 am
Now I only see "struct_sound" what else do you need?

I need to add a "script_struct" to a map supported by all "kvp" (example: riser spawner or sounds)

I lost the source of the map. and I need to add a couple of sounds and spawn for zombie riser
as well as "script_struct" for the buyable barricade
Title: Re: script_struct scripts Need Help
Post by: gympie6 on June 28, 2018, 10:21:44 am
I need to add a "script_struct" to a map supported by all "kvp" (example: riser spawner or sounds)

I lost the source of the map. and I need to add a couple of sounds and spawn for zombie riser
as well as "script_struct" for the buyable barricade

Why the hell are you doing this by script? Things like these are already be played in other scripts.
If you want to play sound on them you can better search for these entries and then do something.
From what I read here you are doing double work? Show me more examples of what you really want.
Title: Re: script_struct scripts Need Help
Post by: ville88 on June 28, 2018, 12:00:29 pm
Why the hell are you doing this by script? Things like these are already be played in other scripts.
If you want to play sound on them you can better search for these entries and then do something.
From what I read here you are doing double work? Show me more examples of what you really want.

working example:

Code Snippet
Plaintext
init_risers();


init_risers()
{
mn = getDvar("mapname");
switch(mn)
{
case "nazi_zombie_death":
level.riser_spot = [];
level.riser_spot[0] = spawnstruct();
level.riser_spot[0].origin = (848,432,64);
level.riser_spot[0].targetname = "zombie_rise";
level.riser_spot[0].script_noteworthy = "riser_door";

level.riser_spot[1] = spawnstruct();
level.riser_spot[1].origin = (880,504,64);
level.riser_spot[1].targetname = "zombie_rise";
level.riser_spot[1].script_noteworthy = "riser_door";

level.riser_spot[2] = spawnstruct();
level.riser_spot[2].origin = (152,480,64);
level.riser_spot[2].targetname = "zombie_rise";
level.riser_spot[2].script_noteworthy = "riser_door";

level.riser_spot[3] = spawnstruct();
level.riser_spot[3].origin = (296,456,64);
level.riser_spot[3].targetname = "zombie_rise";
level.riser_spot[3].script_noteworthy = "riser_door";

level.riser_spot[4] = spawnstruct();
level.riser_spot[4].origin = (296,552,64);
level.riser_spot[4].targetname = "zombie_rise";
level.riser_spot[4].script_noteworthy = "riser_door";
break;
}
}
Title: Re: script_struct scripts Need Help
Post by: Harry Bo21 on June 28, 2018, 12:36:23 pm
A - you cannot spawn script structs (spawn struct is a ‘data structure’ )

B - assigning Kvps would do nothing anyway apart from assign stuff - that doesn’t just ‘make them work’

C - can’t play a sound on a struct - because it’s not an entity
Title: Re: script_struct scripts Need Help
Post by: ville88 on June 28, 2018, 01:04:41 pm
A - you cannot spawn script structs (spawn struct is a ‘data structure’ )

B - assigning Kvps would do nothing anyway apart from assign stuff - that doesn’t just ‘make them work’

C - can’t play a sound on a struct - because it’s not an entity

sad. Thanks

Title: Re: script_struct scripts Need Help
Post by: IZaRTaX on June 28, 2018, 07:01:43 pm
You can add a loop sound directly in raw\clientscripts\createfx\your_map_fx.csc

Code Snippet
Plaintext
main()
{

ent = clientscripts\_fx::createOneshotEffect();
ent.v[ "origin" ] = ( -4676, 496, -187 );
ent.v[ "angles" ] = ( -90, 90, 0 );
ent.v[ "delay" ] = -4;
ent.v[ "soundalias" ] = "your_aliase";

}

Soundaliase example:

Code Snippet
Plaintext
name,platform,file,sequence,vol_min,vol_max,dist_min,dist_max,limit_count,limit_type,entity_limit_count,entity_limit_type,bus,volume_min_falloff_curve,volumefalloffcurve,reverb_send,dist_reverb_max,reverb_min_falloff_curve,reverb_falloff_curve,pitch_min,pitch_max,randomize_type,spatialized,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,chainaliasname,startdelay,speakermap,lfe percentage,center percentage,envelop_min,envelop_max,envelop percentage,occlusion_level,occlusion_wet_dry,real_delay,distance_lpf,move_type,move_time,min_priority,max_priority,min_priority_threshold,max_priority_threshold,,isbig

# ZOMBIES,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

your_aliase,,your_folder\element\your_sound.wav,1,1,1,50,500,,,,,full_vol,,,1,,,,,,,3d,,,looping,,all_sp,,,,,,,,,,,,1,,,,,100,100,0.25,1,,

Or in your .gsc for a one shoot like activate something:

Code Snippet
Plaintext
main()
{
level thread test();
}

test()

{

trigger = getent("your_trigger","targetname");
debris = getent("debris_ent","targetname"); //script brushmodel/model

trigger waittill("trigger");

wait 0.1;

sound_ent = spawn("script_origin", debris.origin); //Also it works for trigger.origin
wait_network_frame();
sound_ent playsound("your_aliase");
wait 0.1;
sound_ent delete();

}

Soundaliase example:

Code Snippet
Plaintext
name,platform,file,sequence,vol_min,vol_max,dist_min,dist_max,limit_count,limit_type,entity_limit_count,entity_limit_type,bus,volume_min_falloff_curve,volumefalloffcurve,reverb_send,dist_reverb_max,reverb_min_falloff_curve,reverb_falloff_curve,pitch_min,pitch_max,randomize_type,spatialized,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,chainaliasname,startdelay,speakermap,lfe percentage,center percentage,envelop_min,envelop_max,envelop percentage,occlusion_level,occlusion_wet_dry,real_delay,distance_lpf,move_type,move_time,min_priority,max_priority,min_priority_threshold,max_priority_threshold,,isbig

# ZOMBIES,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

your_aliase,,your_folder\element\your_sound.wav,1,1,1,500,900,,,,,full_vol,,,0,,,,,,,3d,,,,,all_sp,,,,,,,,,,,,1,,,,,100,100,0.25,1,,