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

Members Online

»
0 Active | 55 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: problem with MP script
BrockCZE
General Member
Since: Aug 8, 2009
Posts: 26
Last: Dec 8, 2009
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, Aug. 8, 2009 06:31 pm
Hi, i have problem with following MP script. [banghead] Pls can you someone tell me what is wrong? When map is loading CoD2 gets bugged and i must turn it of by ctrl+alt+del or restart my PC.
Code:
main() 
{
thread lattice_close();
thread lattice_lock();
thread lattice_destroy();
}



lattice_close()
{
lattice = getent("1_lattice", "targetname");
trig_lattice = getent("1_lattice_close", "targetname");
while (1)
{
trig_lattice waittill("trigger");
lattice playsound("latticeclose");
lattice rotateyaw(-90, 1.5, 0.7, 0.7);
lattice waittill("rotatedone");

trig_lattice waittill("trigger");
lattice playsound("latticeopen");
lattice rotateyaw(90, 1.5, 0.7, 0.7);
lattice waittill("rotatedone");
wait (2);
}
}


lattice_lock()
{
trig_lattice_lock = getent("1_lattice_lock", "targetname");
trig_lattice_close = getent("1_lattice_close", "targetname");
while (1)
{
trig_lattice_lock waittill("trigger");
trig_lattice_lock delete();
trig_lattice_close delete();
}
}


lattice_destroy()
{
lattice = getent("1_lattice", "targetname");
lattice_destroyed = getent("1_lattice_destroyed", "targetname");
lattice_destroyed hide();
trig_lattice_destroy = getent("1_lattice_break", "targetname");
while (1)
{
trig_lattice_destroy waittill("trigger");
trig_lattice_destroy delete();
lattice delete();
lattice_destroyed show();
}
}
Share |
DadofAzz
General Member
Since: May 24, 2005
Posts: 1233
Last: Oct 17, 2009
[view latest posts]
Level 8
MODSCON
Category: CoD2 Scripting
Posted: Saturday, Aug. 8, 2009 07:18 pm
Does it show you the error on screen?
Have you tried running the map in developer mode?

Start game, bring down the console by pressing the tilde ¬ key
Type developer 1 [enter]
type devmap [yourmapname] (thats the name of your map) then [enter]

You may now get an error report about the script giving you some idea as to what is wrong. To show a fuller view of the console press shift + tab or is it Ctrl + tab sorry cant quite remember

edited on Aug. 8, 2009 03:19 pm by DadofAzz
Share |
BrockCZE
General Member
Since: Aug 8, 2009
Posts: 26
Last: Dec 8, 2009
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, Aug. 8, 2009 08:37 pm
OK, thx... it says: Getent used with more then one entity. and when i open console, there is problem in part of destroy of lattice. exactly in line trig_lattice_destroy = ..... but i didnt find somethink wrong. [confused]
Share |
DadofAzz
General Member
Since: May 24, 2005
Posts: 1233
Last: Oct 17, 2009
[view latest posts]
Level 8
MODSCON
Category: CoD2 Scripting
Posted: Sunday, Aug. 9, 2009 04:37 am
I am sorry I am a tad "rusty" on scripting

If you have more than one entity you may have to use gettentarray rather than getent.

If you want to remove the trigger you may try hide rather than destroy. Sorry I am only guessing

To get some more idea's you could open some of the stock pk3's and study some of the sp scripts

I'm sure someone on here will have the correct answer for you. just be patient. dont give up

doa

edited on Aug. 9, 2009 12:39 am by DadofAzz
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Aug. 9, 2009 04:46 am
More than one entity use

example:

Code:
lattice_destroy()
{
lattice = getent("1_lattice", "targetname");

lattice_destroyed = getentarray("1_lattice_destroyed", "targetname");
for( i = 0 ; i < lattice.size ; i++ )
lattice_destroyed[i] hide(); //i represents more than one
trig_lattice_destroy = getent("1_lattice_break", "targetname");
while (1)
{
trig_lattice_destroy waittill("trigger");
trig_lattice_destroy delete();
lattice delete();
lattice_destroyed show();
}
}

lattice playsound("latticeopen");
lattice rotateyaw(90, 1.5, 0.7, 0.7);
lattice waittill("rotatedone");
wait (2);
}
}


Everytime you are using more than one entity use getentarray and use

Code:
for( i = 0 ; i < whateveryoudefined.size ; i++ )


Then
Code:
whateveryoudefined[i].whateverfunction


You can use delete(); rather than destroy(); maybe it will work.



edited on Aug. 9, 2009 12:51 am by sam_fisher3000

edited on Aug. 10, 2009 07:17 am by foyleman
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Aug. 9, 2009 04:48 am
Something screw up in the post. [ohwell]

for(i=0;i < 3;i++)

something like that just replace the i<3 with wut you named.



edited on Aug. 9, 2009 12:56 am by sam_fisher3000
** I put spaces around the less then.

edited on Aug. 10, 2009 07:16 am by foyleman
Share |
BrockCZE
General Member
Since: Aug 8, 2009
Posts: 26
Last: Dec 8, 2009
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Monday, Aug. 10, 2009 08:37 pm
THX. /developer 1 helped me a lot. Problem was in radiant-not in script. Esactly two triggers had same targetname. [duh]

edited on Aug. 10, 2009 04:38 pm by BrockCZE
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»