(12-23-2013, 01:11 AM)Romulator Wrote: I went through the OP code and corrected most of your errors. Some of them you will have to fix on your own because I do not know exactly where they have to go, or why they are there. I commented any changes and notes you need to take care of. I also did some aligning so I could understand your coding a little better.
I also noticed DnALANGE beat me to it Though either of ours should suffice, unspoiler mine if you need to
void OnStart() //The AddCallbacks were not within a void. Placed within OnStart(). { AddUseItemCallback("", "Crowbar", "Door", "UseCrowbarOnDoor", true); AddEntityCollideCallback("Joint", "AreaBreak", "BreakDoor", true, 1); }
void UseMasterBedroomKey(string &in asItem, string &in asEntity) { SetMessage("message", "message1", 3.0f); //Changed from integer to float. Does not affect the way it is run however. }
AddTimer("", 1.1, "TimerDoorCanClose"); //AddTimer() can only be used within a routine (void). Collide with a scriptarea if necessary. Move it or give it a void as necessary. //Moved brace to under the below void.
//void TimerDoorCanClose(string &in asTimer) //This code has been used before. May cause errors when called again in code. //{ //It is easier to call a new timer and use that instead. //SetSwingDoorDisableAutoClose("Door", false); //And it is missing a closing brace :P //}
void touchdoor(string &in asEntity) //You cannot name two routines after the same void. Change this to touchdoor_2 or something. { //You will need to change any codes/messages as well which point to here. AddQuest("door", "touchdoor"); }
If you find you cannot read it well because of browser limitations, download it from here
Modified Rom's script here. You forgot to put in some f's to some of the numbers BECAUSE they're floats, not integers.
Muperdebump..
Looks like the REAL prof's taking over..
Sorry i haven't got a LOT of time here..
Didn't want to add a WRONG script offc.
Next time ill try to take a little more time or wait for other people here.
Thanks ROm and JAP
(This post was last modified: 12-23-2013, 01:24 AM by DnALANGE.)
Whether they are floats or integers, they would still pass correctly in most cases, unless it is a decimal value.
And in response, yes. There are one or two things you need to check:
1. Your AddTimer in the middle of the code. Place it somewhere in the code within a void. I don't know what is supposed to happen, so if you need to, make the player collide with a ScriptArea and make some appropriate code for that:
(12-23-2013, 01:41 AM)Romulator Wrote: Whether they are floats or integers, they would still pass correctly in most cases, unless it is a decimal value.
And in response, yes. There are one or two things you need to check:
1. Your AddTimer in the middle of the code. Place it somewhere in the code within a void. I don't know what is supposed to happen, so if you need to, make the player collide with a ScriptArea and make some appropriate code for that:
Just change the ScriptArea_Name to whatever in your Level Editor, and make it big enough for the player to walk through, similar to this:
And the second thing is right down the bottom, you have two touchdoor voids, which you cannot I said what to do about that though.
Dont worry DNaLANGE. It's all about assistance. You managed to get him from 4 errors to 1, so it's all about progress
OK, it's still getting me the same 1 error now! that is this
"main (63,2):ERR: A Function with the same name and parameters already exist"
I don't understand exactly of what i'm supposed to do, and I haven't seen a repeated code!
here is the updated code, do you see a repeated one, cause I don't!
Meaning you have a COPY of the same name somewhere
in YOUR case it´s THIS :
touchdoor
-
You can NOT use the same name twice in a script.
Just make it toutchdoor1 or whatever will work.
-
USE Notepad++, THEN you cans ee what is good and NOT good, It's free o use.
Try google it up.
(This post was last modified: 12-23-2013, 01:57 AM by DnALANGE.)
(12-23-2013, 01:56 AM)DnALANGE Wrote: Meaning you have a COPY of the same name somewhere
in YOUR case it´s THIS :
touchdoor
-
You can NOT use the same name twice in a script.
Just make it toutchdoor1 or whatever will work.
-
USE Notepad++, THEN you cans ee what is good and NOT good, It's free o use.
Try google it up.
actally that touchdoor is supposed to be there twice!
(12-23-2013, 02:04 AM)Romulator Wrote: Could you perhaps explain why it needs to be there twice? I don't see anything to assume it must...
my mistake, there isn't supposed to be touch door twice, well now I deleted that but it still gets me the same error message!
(12-23-2013, 01:56 AM)DnALANGE Wrote: Meaning you have a COPY of the same name somewhere
in YOUR case it´s THIS :
touchdoor
-
You can NOT use the same name twice in a script.
Just make it toutchdoor1 or whatever will work.
-
USE Notepad++, THEN you cans ee what is good and NOT good, It's free o use.
Try google it up.
I did touchdoor1 but it still gets me the same error message! I'm literally confused
(This post was last modified: 12-23-2013, 02:09 AM by Radical Batz.)