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

Members Online

»
0 Active | 91 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Multiple doors problem
tharaz
General Member
Since: Jan 7, 2009
Posts: 12
Last: Oct 15, 2011
[view latest posts]
Level 1
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Sunday, Mar. 21, 2010 11:01 pm
Can anyone tell me how to get multiple scripts for different doors, I had it before but I reformatted and lost all my scripts, and I decided to change my map some and had to remake all the doors and now I can't get more than one script to work. I need multiple because I have doors that need to move on a different axis. I used http://modsonline.com/Tutorials-read-658.html before but now I can't get it to work. I get this error
******* script runtime error *******
cannot cast undefined to string: (file 'maps/mp/_door2.gsc', line 18)
self.doormodel = getent(self.target, "targetname");
I don't claim to be more than anyone who just has fun building cod4 maps so I might need a good explanation lol. Also sorry ahead of time for the poor grammar but I am kind of annoyed right now and just want to get this fixed quickly.
Share |
Samuel033
General Member
Since: Dec 10, 2009
Posts: 484
Last: Dec 25, 2015
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Sunday, Mar. 21, 2010 11:40 pm
The error is telling you there is no self.target.

I dont know mapping but the one thing that stands out is
Key: targetname
Value: door_trig

'self' in this case is the door entity. I dont know if this helps at all but something to check out.
Share |
tharaz
General Member
Since: Jan 7, 2009
Posts: 12
Last: Oct 15, 2011
[view latest posts]
Level 1
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Monday, Mar. 22, 2010 12:09 am
well kind of confusing but I did some testing the door.gsc works fine but the other 3 don't, so it is something to do with
Key: targetname
Value: door_trig2
and the other ones, they are all the same but different numbers.
Also since I forgot how I did it last time I tried doing it the way i thought I did last time wich was changing the targetname and changing the line "door_trig" in
doors = getentarray("door_trig","targetname");
in the script to the correct trigger name depending on the door.

edited on Mar. 21, 2010 08:19 pm by electabledork
Share |
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 1293
Last: Jul 9, 2016
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Monday, Mar. 22, 2010 03:35 am
The doors work as an array, meaning, any door with the targetname in script works for as many doors as you want to make. You don't need to rename or duplicate the script or add some numeric targetnames. The same targetname works for all the doors, hence the array.

You problems stem because you are Not setting them up correctly in radiant. Self.target, the script is looking for what the trigger is linked to, and apparently it can't find anything.


Also:
Setting up a "count" allows each door to open in whatever direction you define in radiant. Means, one script, multiple doors, and any direction.

Quote:
You can have 50+ doors, all with the targetname "door_trig" and each door opens in a different direction because of the use of "count" implemented into the setup of the door.


Read the tutorial clearly. [duh]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»