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 causes unhandled exception

broken avatar :(
Created 10 years ago
by jjbradman
0 Members and 1 Guest are viewing this topic.
3,013 views
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
942
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
EDIT: ok i found that it was the
Code Snippet
Plaintext
trig thread timeout(15);
which caused the crash but i cant understand why D: can someone tell me then how am i supposed to delete the trig in 15 seconds?

can someone tell me what might be causing the crash? :C it was fine some days ago and after adding some stuff and jei's bo zipline it started to give problems :(
Code Snippet
Plaintext
touch_ammo()
{
num = 1;
org = self.origin;
trig = Spawn("trigger_radius", org, 0, 30, 100);
trig thread timeout(15);
    while(num == 1)
    {
trig waittill("trigger",player);
        if( player HasPerk( "specialty_leadfoot" ) )
    {
//player thread fill_ammo(org);
trig delete();
self delete();
num = num + 1;
}
else
{
wait 0.1;
}
wait 0.1;
    }
}

timeout(time)
{
wait time;
self delete();
}

Post Merge: April 24, 2014, 01:41:54 am
nevermind for some reason my timeout function caused my map to crash
Last Edit: April 24, 2014, 01:41:54 am by jjbradman
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
You could use:

Code Snippet
Plaintext
wait(15);
trig disable_trigger();

or

Code Snippet
Plaintext
wait(15);
trig delete();

Post Merge: April 24, 2014, 02:04:13 am
Never mind that...
Last Edit: April 24, 2014, 02:04:13 am by nabaro
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
you deleted trig in your timeout function, and then deleted it again later in the script. Perhaps thats why?
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
942
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
You could use:

Code Snippet
Plaintext
wait(15);
trig disable_trigger();

or

Code Snippet
Plaintext
wait(15);
trig delete();

Post Merge: April 24, 2014, 02:04:13 am
Never mind that...
i needed to delete it, not disable cause i want to prevent my map crashing cause of entity limit lol

Post Merge: April 24, 2014, 02:23:27 am
you deleted trig in your timeout function, and then deleted it again later in the script. Perhaps thats why?
like we talked it must be that theres already a funtion called ike that somewhere else xD
Last Edit: April 24, 2014, 02:23:27 am by jjbradman
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
Perhaps rather than use a separate function, add a wait at the end of the loop, like so:

Code Snippet
Plaintext
wait(0.05);
trigger_deleting = trigger_deleting + 1;

and check if it has reached 15 seconds each time at the beginning of the loop:

Code Snippet
Plaintext
if(trigger_deleting == 300)
trig delete();

make sure to initialize "trigger_deleting" at the beginning of the script.

Code Snippet
Plaintext
trigger_deleting = 0;

Post Merge: April 24, 2014, 02:33:38 am
Also, as a side note, the perk "specialty_leadfoot" is already being used by Treyarch for bowie knife melee damage or something, so you may want to change your perk name.
Last Edit: April 24, 2014, 02:33:38 am by nabaro
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
942
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
Perhaps rather than use a separate function, add a wait at the end of the loop, like so:

Code Snippet
Plaintext
wait(0.05);
trigger_deleting = trigger_deleting + 1;

and check if it has reached 15 seconds each time at the beginning of the loop:

Code Snippet
Plaintext
if(trigger_deleting == 300)
trig delete();

make sure to initialize "trigger_deleting" at the beginning of the script.

Code Snippet
Plaintext
trigger_deleting = 0;

Post Merge: April 24, 2014, 02:33:38 am
Also, as a side note, the perk "specialty_leadfoot" is already being used by Treyarch for bowie knife melee damage or something, so you may want to change your perk name.
i thought in that but as the trigger being used by the player with perk and one with no perk would cause changes in the code it was better to use the threaded delete
i just changed the name of timeout and done :)

Post Merge: April 24, 2014, 02:47:19 am
for fucks sake xc damn you treyarch, then which are other perk names aviable? ;n;
Last Edit: April 24, 2014, 02:47:19 am by jjbradman
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
I suggest using "specialty_recon", but here is a full list (note that all might not be available): http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_Perks_Icons .
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
942
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
I suggest using "specialty_recon", but here is a full list (note that all might not be available): http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_Perks_Icons .
it was recon but i never got it to work :L so i used leadfoot
thanks for the link! :D
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
No problem :)
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
Also, as a side note, the perk "specialty_leadfoot" is already being used by Treyarch for bowie knife melee damage or something, so you may want to change your perk name.
It's not. The bowie knife is specialty_altmelee.

- Phil.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
Never mind, I'm drawing a blank. I was thinking of specialty_recon as something that had already been used. My bad!

 
Loading ...