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

Tornado fx help

broken avatar :(
Created 10 years ago
by javipotter
0 Members and 1 Guest are viewing this topic.
2,143 views
broken avatar :(
×
broken avatar :(
Location: escastellon
Date Registered: 14 February 2013
Last active: 4 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
javipotter's Groups
javipotter's Contact & Social LinksZombieModdingJavipotterJAVI-POTTERjavi potter
Im going to put same as in zm;
A long time ago i started with that, yaph1l made a custom script for my map, and what it does is make an fx move randomly, after misterhoff started a tornado fx, but in codwaw doesnt show, thats the script:

Code Snippet
Plaintext
// Coded by YaPh1l
// Date: 09. October 2013

#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;

// Call after _zombiemode::main()
init()
{
    level._effect["tornado"] = LoadFx("tornado_fx");
    level.fx_move_speed = 10; // units per second
    level thread fx_move_think();
}

fx_move_think()
{
    locations = GetStructArray("tornado_location", "targetname");
    iPrintLn("Tornado locations found: " + locations.size);
   
    last_location = Random(locations);
    fx = Spawn("script_model", last_location.origin);
    fx SetModel("tag_origin");
    PlayFxOnTag(level._effect["tornado"], fx, "tag_origin");
   
    while(true)
    {
        while(true)
        {
            locations = array_randomize(locations);
            if(locations[0] != last_location) break;
        }
       
        for(i = 0; i < locations.size; i++)
        {
            iPrintLn("Moving to: (" + locations.origin[0] + "|" + locations.origin[1] + "|" + locations.origin[2] + ")");
            dist = Distance(locations.origin, fx.origin);
            time = (dist / level.fx_move_speed);
            fx MoveTo(locations.origin, time);
            wait(time);
        }
       
        last_location = locations[locations.size - 1];
    }
}

the script should be right but dunno why it doesnt appear ingame, i included fx in mod csv and I put it in mymap/fx also.
Last Edit: January 26, 2014, 07:01:59 pm by SajeOne
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 5 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
Signature

(Click to enter portfolio)
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Are you calling the init function before zombiemode? All LoadFx calls have to happen before the game starts or else the FX will not appear.
Marked as best answer by javipotter 10 years ago
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
The init() function needs to be called after _zombiemode::main(), so just remove that line in the script:
Code Snippet
Plaintext
level._effect["tornado"] = LoadFx("tornado_fx");
and put it before _zombiemode::main() in your mapname.gsc.
EDIT: By the way, you could have asked before posting my script on public forums...

- Phil.
Last Edit: January 26, 2014, 07:31:37 pm by YaPh1l
broken avatar :(
×
broken avatar :(
Location: escastellon
Date Registered: 14 February 2013
Last active: 4 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
javipotter's Groups
javipotter's Contact & Social LinksZombieModdingJavipotterJAVI-POTTERjavi potter
Thx it works, could someone update that script to make the tornado kill u if u touch it? if it is possible. Thx ;D
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 5 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
If your issue is solved please mark a best answer so the topic gets a "Solved" status.

 
Loading ...