Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
1 Active | 14 Guests
Online:

LATEST FORUM THREADS

»
Single Player Loadout
CoDWW SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Scripting to Change Targetname?
jelvischan
General Member
Since: Jun 21, 2012
Posts: 45
Last: Mar 14, 2013
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Tuesday, Jul. 3, 2012 10:57 am
Hi all,

What I'm trying to do with my map is have a button so that when you press it, the wall that the button is connected to changes from a script_brushmodel to a trigger_multiple. Then, the targetname changes to enter so that it can teleport you.

Basically, I want a button so when you press it, you get teleported.

Is this possible?
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Tuesday, Jul. 3, 2012 11:06 am
yes and you dont need a new trigger to do that. you can use the button you pressed to be the trigger that makes you teleport so no need to spawn a new trigger multiple. make a script_origin with a targetname where you want to teleport then you change your players origin to the script_origins origin. so lets say you made your script_origins targetname name "newplace" so in your script lets say you made it

newplace = getent("newplace", "targetname");

so then you would do.

self.origin = newplace; // not sure if you would put self.origin = newplace.origin; try those both.

anyways that will make you move from where you were to your new origin making you "teleport"
Share |
jelvischan
General Member
Since: Jun 21, 2012
Posts: 45
Last: Mar 14, 2013
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Tuesday, Jul. 3, 2012 11:09 am
Okay Ill test it thanks! Please stay updated with this thread just in case it doesnt work :D

Thanks!
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Tuesday, Jul. 3, 2012 11:11 am
if that dosnt work i think you actually might need to put

self setOrigin(newplace); // instead of self.origin = newplace;

forgot about that function for a sec.
Share |
jelvischan
General Member
Since: Jun 21, 2012
Posts: 45
Last: Mar 14, 2013
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Tuesday, Jul. 3, 2012 11:28 am
So I make a trigger_use and make the targetname whatever I want. Then in the gsc file I say like self.origin = the targetname of the script_origin that I made?

Then When I click the button I will be teleported to wherever I put the script_origin?
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Tuesday, Jul. 3, 2012 12:05 pm
exactly.
Share |
jelvischan
General Member
Since: Jun 21, 2012
Posts: 45
Last: Mar 14, 2013
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Tuesday, Jul. 3, 2012 12:41 pm
liltc64 writes...
Quote:
exactly.


Can you check my other thread about bad syntax. I didn't add this script, but there are errors and I am confused.
Share |
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 MP Mapping

Latest Syndicated News

»
Why console gaming is dying
Quote:Consider this: Dedicated gaming sales — including living-room consoles...
Devs: Games are being dumb...
Click 'read more' to view the contents of this post.
Loadout
Gun Crafting to the Max. edited on Sep. 25, 2012 06:57 pm by Morp...
Introducing the Source Fil...
Surprised this wasn't made a long time ago. Sounds like a nice little feature.
Introducing the Source Fil...
The Source Filmmaker (SFM) is the movie-making tool built and used by us he...

Partners & Friends

»