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

Members Online

»
0 Active | 9 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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: World at War
Category: CoDWW Scripting
Scripting and coding with Call of Duty: World at War.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: teleporting
*UWS*ThisGuy
General Member
Since: Jul 31, 2008
Posts: 215
Last: Jan 8, 2012
[view latest posts]
Level 4
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 12:48 am
Getting a 'bad syntax error' when trying out the tut.

it points to:

for(lp=0;lp
entTransporter[lp] thread Transporter();

as the error.

I copied the .gsc right from the tut so not sure whats going on.
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 02:58 am
Could you post the full code
Share |
*UWS*ThisGuy
General Member
Since: Jul 31, 2008
Posts: 215
Last: Jan 8, 2012
[view latest posts]
Level 4
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 03:48 am
here is the code from the tut:

main()
{

entTransporter = getentarray("enter","targetname");
if(isdefined(entTransporter))
{
for(lp=0;lp
entTransporter[lp] thread Transporter();
}


}
Transporter()
{
while(true)
{
self waittill("trigger",other);
entTarget = getent(self.target, "targetname");

wait(0.10);
other setorigin(entTarget.origin);
other setplayerangles(entTarget.angles);
//iprintlnbold ("You have been teleported !!!");
wait(0.10);
}
}

here is the code that worked for me:

Quote:
main()
{

entTransporter = getentarray("enter","targetname");
if(isdefined(entTransporter))
{
for(lp=0;lp entTransporter[lp] thread Transporter();
}


}


Transporter()
{
while(true)
{
self waittill("trigger",other);
entTarget = getent(self.target, "targetname");

wait(0.10);
other setorigin(entTarget.origin);
other setplayerangles(entTarget.angles);
//iprintlnbold ("You have been teleported !!!");
wait(0.10);
}
}


For what ever reason it isn't posting the correct code, even on here. its right when I'm replying but not when the actuall post comes up. found the code that worked for me here.

http://codmapping.com/forum/index.php?topic=616.0
Share |
*UWS*ThisGuy
General Member
Since: Jul 31, 2008
Posts: 215
Last: Jan 8, 2012
[view latest posts]
Level 4
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 03:49 am
triedt to get rid of double post lol

[crazy]

edited on Feb. 4, 2009 10:50 pm by *UWS*ThisGuy
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 04:44 am
Yeah, these forums are wierd... I believe if you don't put a space in the "For" Loop... then it will delete a chunk of your code when you post it on here. I think thats the problem?

I don't have a problem as i always put spaces in my for loop anyway

Code:
For(i = 0; i < 20; i++)


Instead of being all bunched up:
Code:
For(i=0;i<20;i++)



I'm confused as to whether you have the code working or not. If not, try this:

Code:
main()
{
	entTransporter = getentarray("enter","targetname");
	if(isdefined(entTransporter))
	{
		for(lp = 0; lp < entTransporter.size; lp++)
			entTransporter[lp] thread Transporter();
	}
}


Transporter()
{
	while(true)
	{
		self waittill("trigger",other);
		entTarget = getent(self.target, "targetname");

		wait(0.10);
		other setorigin(entTarget.origin);
		other setplayerangles(entTarget.angles);
		//iprintlnbold ("You have been teleported !!!");
	}

}


edited on Feb. 4, 2009 11:44 pm by INSANE{H|S}
Share |
*UWS*ThisGuy
General Member
Since: Jul 31, 2008
Posts: 215
Last: Jan 8, 2012
[view latest posts]
Level 4
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 11:02 am
Yep I got it to work.

I could be wrong but think maybe the tut on here is missing this line:

For(i = 0; i < 20; i++)

I, in no way shape or form, know anything about how to script. Lucky for me there are those that do. And that's appriecated!!!!

Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 11:20 am
Oh lol... That was just an example i was using..
Ignore that. :P

That is a "For loop"
To help you understand...
Code:
for(i = 0; i < 20; i++) 
i = 0 says that i equals 0 ...
the middle part is WHILE.... soooo... while "i is less than 20" ..
and the last part, "i++" ... is what to do after every loop. ++ Increases the number .. " i " by 1 ...


So if you have this....

Code:
for(i = 0; i < 20; i++)
{
	iprintlnbold( i + " seconds and counting up");
	wait 1;
}


the 'wait 1' will make the loop wait 1 second before looping again.

at first i is 0 .... then it will loop... and the i++ will increase i by 1 .... so then... i equals 1 ....then i equals 2.. and so on...

K.
And its stated " i < 20 "
Meaning... While its less than 20 .... so once i = 19... it will run.. then the loop will break automatically....

Confusing? Or do you kind of understand?

edited on Feb. 5, 2009 06:23 am by INSANE{H|S}
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 12:22 pm
The tut had a bit missing - it suffered the same problem as the forum did.

I've updated it - just waiting for it to be approved.
Share |
foyleman
Preferred PLUS Member
Since: Nov 7, 2001
Posts: 95762
Last: Apr 13, 2021
[view latest posts]
Level 10
Admin
Forum Moderator
Im a fan of MODSonair
Im a HOST of MODSonair
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 12:44 pm
[thumbs_up]approved.
Go ahead... You Play I Mod : Support Modsonline by becoming a PREFERRED MEMBER today!
Have you heard the MODSonair Podcast?:
MODSonair is a weekly podcast bringing you the news from a modders perspective.
Tune in every Sunday at 12pm EST to listen LIVE.
Quake 4 Mods for Dummies - Half-Life 2 Mods for Dummies
Share |
foyleman
Preferred PLUS Member
Since: Nov 7, 2001
Posts: 95762
Last: Apr 13, 2021
[view latest posts]
Level 10
Admin
Forum Moderator
Im a fan of MODSonair
Im a HOST of MODSonair
Category: CoDWW Scripting
Posted: Thursday, Feb. 5, 2009 12:47 pm
INSANE{H|S} writes...
Quote:
Yeah, these forums are wierd... I believe if you don't put a space in the "For" Loop... then it will delete a chunk of your code when you post it on here. I think thats the problem?
Well huh. It thinks that less than sign is the start of some html code and cuts off the rest. That's the problem.
I'll have to look into a fix for that. Thanks
Go ahead... You Play I Mod : Support Modsonline by becoming a PREFERRED MEMBER today!
Have you heard the MODSonair Podcast?:
MODSonair is a weekly podcast bringing you the news from a modders perspective.
Tune in every Sunday at 12pm EST to listen LIVE.
Quake 4 Mods for Dummies - Half-Life 2 Mods for Dummies
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty: World at War : CoDWW Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»