If you want scripts / features made for you, then contact me by PM or email / skype etc it will cost you tho so if you have no intention of reciprocating don't even waste my time
So Ive been wanting to get into scripting for ages, but already I have hit some barriers. Anyone mind clearing a few things up? Either on skype or here.
Im trying to first make this door raise out of the floor when the player is near it. So I have a sriptbrush for a door under the floor and I have a trigger multiple on the floor covering the area near it.
I believe instead of doing self istouching, you do player istouching. Because the way you got it now, self is referring to moon0, so that line is basically saying if moon0 is touching moon0 which doesnt make much sense.
So Ive been wanting to get into scripting for ages, but already I have hit some barriers. Anyone mind clearing a few things up? Either on skype or here.
Im trying to first make this door raise out of the floor when the player is near it. So I have a sriptbrush for a door under the floor and I have a trigger multiple on the floor covering the area near it.
this would show a message when you were on the area, but nope. Someone help me out?
You don't really want the door to shut only based on one trigger. That leaves potential for a player to get stuck in the door, or be on top of the door. One way to prevent that would be to not let it close if a player is touching a trigger_multiple on top of the door. Then you would have a trigger further away that initialized that if check and then shut the door.
I would look up the basics and then while loops and so on, if you are trying to learn. The reason I say this is I see two main issues to begin with. This appears to be its own gsc an yet the main function is not a thread to sub functions, depending on what you are trying to do, you usually make the init or main function a thread. Not a big deal as long as you thread it on the entity you want to check if player is touching then. The other thing is your while loop. There isn't a wait at all which will cause infinite loop error. The self istouching... isn't within an if statement and I don't see a trigger wait anywhere to get the variable player to even check if touching. Just a few things to look into.
Last Edit: December 24, 2014, 06:53:35 pm by MakeCents
You don't really want the door to shut only based on one trigger. That leaves potential for a player to get stuck in the door, or be on top of the door. One way to prevent that would be to not let it close if a player is touching a trigger_multiple on top of the door. Then you would have a trigger further away that initialized that if check and then shut the door.
Nah not that kind of door. This will be a teleporter, when you walk into it. And i want it to close about 30 seconds after the player leaves the area or teleports
ill check that out thanks Nah not that kind of door. This will be a teleporter, when you walk into it. And i want it to close about 30 seconds after the player leaves the area or teleports
Ill check out the link, thanks
Alright then. Just fyi, I was concerned for the other players as well, not just the player teleporting, but you'll work it out then I'm sure. Also, I forgot to mension, I put a scripting basics tut together too that may also help.
Last Edit: December 24, 2014, 07:00:32 pm by MakeCents
yeah I gotta watch for that. I want to also have it detect what zones are currently open and only target those.
Im reading up on threading, but the basics - I sorta get anyway. Ive done lots of code in Javascript, so I guess ill just keep reading
Oh good. Then you won't have too many issues with syntax in CodScript then. Do you have much experience with object oriented scripting? The use of self? I haven't done much javascript, mostly python, ruby, and vba. All with similarities. One of the interesting things about codscript, to me, is the way it can get the player. When you use a trigger waittill("trigger", player), it uses the player that triggered it as the player variable from that line on.
As far as the zones, I believe there may be a an multidimensional array used for this already, but it may just be easier to script yourself a new function to update a level array you can check when you check to see what zones have been opened or if the zone your teleporter goes to is open... as you know, so many different ways to do things.
Oh good. Then you won't have too many issues with syntax in CodScript then. Do you have much experience with object oriented scripting? The use of self?
Yeah I do, most of what I worked on was a basic 2d game engine though, so I had no need for things like "threading" and "precaching". This sorta thing is new to me.
Quote
One of the interesting things about codscript, to me, is the way it can get the player. When you use a trigger waittill("trigger", player)
lol, that helped - i was just looking for this
I think once I get started Ill be able to make some basic stuff at least. Just need to get a handle on it
Ok, I got my gat opening and closing when you walk near/away from it
Now, im trying to work out how to actually teleport the player, I placed a script_origin to teleport to for testing for now
But the nazi_zombie_factory_teleporter.gsc and someone around heres Kino script havent helped me figure out how to actually "move" something form one location to another.
Anyone feel like helping me out?
Nevermind, I got it
Last Edit: December 25, 2014, 09:12:04 pm by Harry Bo21