UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

script_struct scripts Need Help

broken avatar :(
Created 6 years ago
by ville88
0 Members and 1 Guest are viewing this topic.
3,540 views
broken avatar :(
×
broken avatar :(
Location: rueurope
Date Registered: 2 January 2012
Last active: 2 months ago
Posts
303
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
ville88's Groups
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 :)
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 5 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Subzero
Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
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");
Last Edit: June 28, 2018, 06:24:44 am by gympie6
broken avatar :(
×
broken avatar :(
Location: rueurope
Date Registered: 2 January 2012
Last active: 2 months ago
Posts
303
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
ville88's Groups
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
Last Edit: June 28, 2018, 06:15:54 am by ville88
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 5 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
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?
Last Edit: June 28, 2018, 06:23:05 am by gympie6
broken avatar :(
×
broken avatar :(
Location: rueurope
Date Registered: 2 January 2012
Last active: 2 months ago
Posts
303
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
ville88's Groups
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
Last Edit: June 28, 2018, 06:30:49 am by ville88
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 5 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
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.
broken avatar :(
×
broken avatar :(
Location: rueurope
Date Registered: 2 January 2012
Last active: 2 months ago
Posts
303
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
ville88's Groups
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;
}
}
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
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
broken avatar :(
×
broken avatar :(
Location: rueurope
Date Registered: 2 January 2012
Last active: 2 months ago
Posts
303
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
ville88's Groups
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

broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 3 June 2015
Last active: 2 months ago
Posts
45
Respect
Forum Rank
Legless Crawler
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
IZaRTaX's Groups
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
IZaRTaX's Contact & Social LinksIZaRTaX
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,,
Last Edit: June 28, 2018, 07:17:14 pm by IZaRTaX

 
Loading ...