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 Triggers? Wont work at all?

broken avatar :(
Created 12 years ago
by epicduck97
0 Members and 1 Guest are viewing this topic.
2,586 views
broken avatar :(
×
broken avatar :(
Location: usSD
Date Registered: 30 May 2013
Last active: 4 years ago
Posts
44
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
epicduck97's Groups
epicduck97's Contact & Social Links
Well, whenever I follow any tutorial to use (use triggers) to work with functions in code it never works... After every code and tutorial failed,I found code on the ugx forum to work with triggers for turrets, so i converted that to see if it would even access my ingame trigger...

This To initiate:
Code Snippet
Plaintext
	thread testtrigger();

And this is the function :
Code Snippet
Plaintext
testtrigger(){
//Set the cost for the trigger
cost = 250;
turret_trigs = getentarray("test", "targetname");
for(trig=0;trig < turret_trigs.size; trig++){
turret_trigs[trig] setCursorHint("HINT_NOICON");
turret_trigs[trig] UseTriggerRequireLookAt();
turret_trigs[trig] SetHintString("Press &&1 to buy turret [Cost: " + cost + "]");
}
}

And I create a use trigger with the targetname test and nothing, it doent work in game.

And I converted is just to see if It will give me the hint string nothing else...


The Trigger
http://prntscr.com/42ewr3

And in game
http://prntscr.com/42ey97

It doent work =(

Thanks for the help - teddi
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Your script is the problem. Or at least part of it depending on if your map has the trigger in it and has been recompiled.

You don't need to use getEntArray() unless there is more than one ent with the targetname of "test" in your map. Lets keep things simple and make sure we can get that single trig with this:

Code Snippet
Plaintext
testtrigger(){
//Set the cost for the trigger
cost = 250;
trig = getent("test", "targetname");
trig setCursorHint("HINT_NOICON");
trig UseTriggerRequireLookAt();
trig SetHintString("Press &&1 to buy turret [Cost: " + cost + "]");
}
broken avatar :(
×
broken avatar :(
Location: usSD
Date Registered: 30 May 2013
Last active: 4 years ago
Posts
44
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
epicduck97's Groups
epicduck97's Contact & Social Links
Your script is the problem. Or at least part of it depending on if your map has the trigger in it and has been recompiled.

You don't need to use getEntArray() unless there is more than one ent with the targetname of "test" in your map. Lets keep things simple and make sure we can get that single trig with this:

Code Snippet
Plaintext
testtrigger(){
//Set the cost for the trigger
cost = 250;
trig = getent("test", "targetname");
trig setCursorHint("HINT_NOICON");
trig UseTriggerRequireLookAt();
trig SetHintString("Press &&1 to buy turret [Cost: " + cost + "]");
}

Thanks for the quick reply, but sadly that didnt work... So first thing The map compiling is fine, and the second thing is the launcher will still compile them if they are still in the .iwd files right?

http://prntscr.com/42f393

And the reason I know the map is compiling is is because
I moved the trigger and put a extra block under it to make sure it compiled the map fine, and I compiled the mods too
http://prntscr.com/42f4fg

btw the trigger is right above the block and I still get the same thing as before with the sign thing...
Last Edit: July 14, 2014, 12:51:12 am by epicduck97
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Thanks for the quick reply, but sadly that didnt work... So first thing The map compiling is fine, and the second thing is the launcher will still compile them if they are still in the .iwd files right?

http://prntscr.com/42f393

And the reason I know the map is compiling is is because
I moved the trigger and put a extra block under it to make sure it compiled the map fine, and I compiled the mods too
http://prntscr.com/42f4fg
If you're sure the map has compiled then you probably aren't calling your test function correctly. Where have you put your

Code Snippet
Plaintext
thread testtrigger();
?

And what happens if you purposely make a syntax error in your function (like leaving out a ; on the end of the line)? If you can make a syntax error without the game giving an error about it then you arent getting your script changes into the IWD that the game is loading.
broken avatar :(
×
broken avatar :(
Location: usSD
Date Registered: 30 May 2013
Last active: 4 years ago
Posts
44
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
epicduck97's Groups
epicduck97's Contact & Social Links
If you're sure the map has compiled then you probably aren't calling your test function correctly. Where have you put your

Code Snippet
Plaintext
thread testtrigger();
?

And what happens if you purposely make a syntax error in your function (like leaving out a ; on the end of the line)? If you can make a syntax error without the game giving an error about it then you arent getting your script changes into the IWD that the game is loading.

This is the full file....
http://pastebin.com/XBZ0d9NR

And im calling it here:

http://prntscr.com/42f6ns

Ill try the error also

** I left out a semi colon somewhere in the code, the game started fine launched the level and everything**

^^ Did i have to do that in developer mode 1 or would it work fine not in developer mode..

I know at least the ugxm_guns.iwd file is being compiled fine, because changing the loadout works fine..

But mymapname.iwd idk about.
Last Edit: July 14, 2014, 01:00:55 am by epicduck97
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
This is the full file....
http://pastebin.com/XBZ0d9NR

And im calling it here:

http://prntscr.com/42f6ns

Ill try the error also

** I left out a semi colon somewhere in the code, the game started fine launched the level and everything**

^^ Did i have to do that in developer mode 1 or would it work fine not in developer mode..
You should always put your threads after this line:
Code Snippet
Plaintext
 maps\_zombiemode::main();
The only calls that go before this line are precache calls which are not threaded. However that is not related to your problem.

As far as the game not picking up the missing semicolon, it means you did not get the script updated in the IWD. You do not need to be in developer mode for it to give a syntax error.
broken avatar :(
×
broken avatar :(
Location: usSD
Date Registered: 30 May 2013
Last active: 4 years ago
Posts
44
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
epicduck97's Groups
epicduck97's Contact & Social Links
You should always put your threads after this line:
Code Snippet
Plaintext
 maps\_zombiemode::main();
The only calls that go before this line are precache calls which are not threaded. However that is not related to your problem.

As far as the game not picking up the missing semicolon, it means you did not get the script updated in the IWD. You do not need to be in developer mode for it to give a syntax error.

Launcher is overwriting the file, all changes get erased.. - That should be the issue

And I noticed that the mymapname.gsc is not in the compile list, should it be??

http://prntscr.com/42fa3y

 
Marked as best answer by epicduck97 12 years ago
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
if you put it in your maps folder, itll work with build mod, otherwise, u have to compile the patch every time you alter the mapname.gsc
broken avatar :(
×
broken avatar :(
Location: usSD
Date Registered: 30 May 2013
Last active: 4 years ago
Posts
44
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
epicduck97's Groups
epicduck97's Contact & Social Links
if you put it in your maps folder, itll work with build mod, otherwise, u have to compile the patch every time you alter the mapname.gsc

Thanks for the help guys, I completely forgot there was one in my maps folder...

Post Merge: July 14, 2014, 01:28:45 am
You should always put your threads after this line:
Code Snippet
Plaintext
 maps\_zombiemode::main();
The only calls that go before this line are precache calls which are not threaded. However that is not related to your problem.

As far as the game not picking up the missing semicolon, it means you did not get the script updated in the IWD. You do not need to be in developer mode for it to give a syntax error.

I got it to work with the help of the other guy, and I just wanted to say really nice job on how ugx has progressed over the year, I've been here from the start of different accounts and really really nice job on how its worked out..

-Teddi

Post Merge: July 14, 2014, 01:34:35 am
You should always put your threads after this line:
Code Snippet
Plaintext
 maps\_zombiemode::main();
The only calls that go before this line are precache calls which are not threaded. However that is not related to your problem.

As far as the game not picking up the missing semicolon, it means you did not get the script updated in the IWD. You do not need to be in developer mode for it to give a syntax error.

And one last thing..
http://prntscr.com/42fgkr
can I extract the other folders, -Like what the other guy said to do for this fix- basically i'm asking this because, I've posted a couple threads on creating weapons -tecnically editing them- I followed tuts and ansers and they never seem to work.. If you don't mind looking at the weapon thread that would be great..


So whats the difference between keeping the files in the .iwd instead of just having them in folders in the mod folder?
Thanks alot - Teddi
Last Edit: July 14, 2014, 01:34:35 am by epicduck97
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
i think i understand what your asking, the iwd and the folder are the exact same. you are able to extract them, but they are ment to help be organized

 
Loading ...