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...
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 + "]"); }
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?
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
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?
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.
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.
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.
** 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.
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??
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..
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