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

Fx and model not spawning through a script

broken avatar :(
Created 8 years ago
by ihmiskeho
0 Members and 1 Guest are viewing this topic.
2,475 views
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 2 January 2015
Last active: 3 years ago
Posts
125
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Signature
Beginner mapper trying to make something for the community to enjoy
×
ihmiskeho's Groups
ihmiskeho's Contact & Social Linksihmiskeho
So this is the issue I'm having in my map atm

I have this script for a new ee step. It's supposed to spawn 3 models around the map with a glow fx:
Code Snippet
Plaintext
tesla_coils()
{
level.teslas_picked = 0;
coil1_trig = getEnt("tesla_coil1","targetname");
coil2_trig = getEnt("tesla_coil2","targetname");
coil3_trig = getEnt("tesla_coil3","targetname");
thread item_pickup(coil1_trig);
thread item_pickup(coil2_trig);
thread item_pickup(coil3_trig);
}

item_pickup(trigger)
{
user = undefined;
trigger _setHintString("");
trigger SetCursorHint( "HINT_NOICON" );
flag_wait("upgraded_magic");

trigger _setHintString("Press and Hold &&1 to Pick Up Item");
trigger SetCursorHint( "HINT_NOICON" );
model = Spawn( "script_model", trigger.origin );
model setmodel( "zombie_zapper_tesla_coil" );
playfxontag (level._effect["powerup_on"], model, "tag_origin");

trigger waittill("trigger", user);
trigger delete();
user playsound("powerup_grabbed");
model delete();
level.teslas_picked = level.teslas_picked + 1;
thread upgrade_ready();
}

The problem is that the model and fx doesn't spawn. The hintstrings work great and it let's me hit the trigger with no problem. Is there something I'm missing from this script?

Thanks in advance!
Marked as best answer by ihmiskeho 8 years ago
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
You need to precache models prior to zombiemode::main

And need to load the fx and check its in mod.csv or some other csv used in your map/mod

Use serous script reference, and treyarchs zombiemode_perks.gsc for examples
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 2 January 2015
Last active: 3 years ago
Posts
125
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
ihmiskeho's Groups
ihmiskeho's Contact & Social Linksihmiskeho
You need to precache models prior to zombiemode::main

And need to load the fx and check its in mod.csv or some other csv used in your map/mod

Use serous script reference, and treyarchs zombiemode_perks.gsc for examples

It was the model not being precached. Tested with a precached model and worked great!

Thanks for your help!
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
×
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
It was the model not being precached. Tested with a precached model and worked great!

Thanks for your help!
need to load the fx in the same place - unless it's already working which means it's already being loaded some where ( prob in dlc3_code.gsc )
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 2 January 2015
Last active: 3 years ago
Posts
125
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
ihmiskeho's Groups
ihmiskeho's Contact & Social Linksihmiskeho
need to load the fx in the same place - unless it's already working which means it's already being loaded some where ( prob in dlc3_code.gsc )
Fx is working as well. It's just the basic powerup fx which is already loaded in Treyarch base scripts
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
×
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
Cool

That's loaded in one of the other gscs

Just for reference

Variable = loadfx( "path_to_fx/fxname" );

Just incase you ever use a fx that isn't already loaded
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 2 January 2015
Last active: 3 years ago
Posts
125
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
ihmiskeho's Groups
ihmiskeho's Contact & Social Linksihmiskeho
Cool

That's loaded in one of the other gscs

Just for reference

Variable = loadfx( "path_to_fx/fxname" );

Just incase you ever use a fx that isn't already loaded
Yeah, always had issues when trying to add fx in to the map (other than constantly looping fx). Usually the reason being that fx weren't loaded correctly or at all.

Now I know that needs to be done to models as well.

 
Loading ...