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

Anyone feel like helping me script a teleport system?

broken avatar :(
Created 9 years ago
by Harry Bo21
0 Members and 1 Guest are viewing this topic.
1,938 views
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
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 ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
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.

But thats it, im stuck lol.

I thought :

Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

main()
{
moon0 = getEnt("moongate_0_area", "targetname");

while( 1 )
{
self isTouching(moon0, player);

iprintlnbold("Near door");

}
}

this would show a message when you were on the area, but nope. Someone help me out? :)
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
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.

Code Snippet
Plaintext
 player isTouching(moon0);
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
I tried that and got "uninitialized variable "player" "
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
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.

But thats it, im stuck lol.

I thought :

Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

main()
{
moon0 = getEnt("moongate_0_area", "targetname");

while( 1 )
{
self isTouching(moon0, player);

iprintlnbold("Near door");

}
}

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.

As far as scripting, there are some basics on this site:
http://codscript.net/tutorials/

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
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
ill check that out thanks

Quote
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 out the link, thanks :)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
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
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
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 ;)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
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.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Quote
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 :)
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
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

 
Loading ...