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

Members Online

»
0 Active | 80 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 General
General game questions, comments, and chat.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
Author Topic: Is it possible to terminate/kill a thread()
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 10:26 am
I dont have radiant so I cant check the .map

What are the "guys" exactly? And how will they react to a bullet?
Share |
s6robi
General Member
Since: Jun 12, 2006
Posts: 85
Last: Feb 18, 2021
[view latest posts]
Level 3
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 10:59 am
So, the "guys" are three German Soldiers and "OBJ2" is just one German Soldier. Once I shoot the three German Soldiers before going to OBJ1 they just die and no mission failure happens...even when I go to OBJ1 and then kill the three German Soldiers "guys" the map continues to keep going (which is correct, I am supposed to go to OBJ1 and then kill the three Germans to continue the map..if I don't go to OBJ1 and kill the three Germans my mission is suppose to fail).
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 11:42 am
Yeah but where is the part where they react to getting a bullet? I dont see it in the script. You can shoot at them, but nothing will happen, because there is no script about shooting them. What you might do is link a trigger_damage to the "guys" and then you can add a waittill(trigger_damage) get activated, Then you know you shoot at them. Now the game cant tell you if you shoot at them
Share |
s6robi
General Member
Since: Jun 12, 2006
Posts: 85
Last: Feb 18, 2021
[view latest posts]
Level 3
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 11:44 am
oh wow, I had no idea i would need to put something like that in my script, but it makes total sense. Do you have a line of code that would work for that? or do you want me using the method you just described?
Share |
s6robi
General Member
Since: Jun 12, 2006
Posts: 85
Last: Feb 18, 2021
[view latest posts]
Level 3
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 12:41 pm
Ni3ls,

So I just implemented a trigger_damage around all three German Soldiers, however, I am now lost as all can be with the code and how it'll look in my script to get this to hopefully work heh.

Your Thoughts?

V/r,
Luke.
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 12:44 pm
I dont make sp maps, so i know nothing about actors and stuff. And im not after all if you could link a trigger to a player, but always worth a try.

This is to link
Code:
brushmodel = getEntArray("guy","targetname");
trigger_damage1 = getEnt("damage1","targetname");

trigger_damage1 EnableLinkTo();
trigger_damage1 LinkTo("brushmodel[1]");

Or something :P

This is about same prob i think :
http://modsonline.com/Forums-top-86801-0.html
Share |
s6robi
General Member
Since: Jun 12, 2006
Posts: 85
Last: Feb 18, 2021
[view latest posts]
Level 3
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 12:56 pm
I implemented that code into my mission_failure thread but no luck :(

#include maps\_utility;
#include maps\_anim;
#using_animtree("generic_human");


main()
{
maps\_load::main();
level.allies_accuracy = 10;
level.axis_accuracy = 100;
thread setupplayer();
thread enemy();
thread obj1();
}

setupplayer()
{
level.player takeallweapons();
level.player giveWeapon("mp40");
level.player giveWeapon("luger");
level.player switchToWeapon("mp40");
level.player setViewmodel("xmodel/viewmodel_hands_german" );
}

enemy()
{
if(isdefined(level.ending) && level.ending == 1)
return;
guys = getentarray("guy", "targetname");
for(i = 0; i < guys.size; i++)
guys
thread mission_failure();
}

obj1()
{
obj1 = getent("obj1", "targetname");
objective_add(1, "active", &"TESTING_OBJECTIVE_1",getent("obj1marker", "targetname").origin);
objective_current(1);

obj1 waittill("trigger");

objective_state(1, "done");
obj1 delete();

thread obj2();
}


obj2()
{
level.ending = 1;

obj2 = getent("obj2", "targetname");
objective_add(2, "active", &"TESTING_OBJECTIVE_2",getent("obj2", "targetname").origin);
objective_current(2);

obj2 waittill("death");
objective_state(2, "done");
}

mission_failure()
{
brushmodel = getEntArray("guys","targetname");
trigger_damage1 = getEnt("dtrig","targetname");

trigger_damage1 EnableLinkTo();
trigger_damage1 LinkTo("brushmodel[1]");
setCvar("ui_deadquote", "@SCRIPT_MISSION_FAILURE_ALERTED_ENEMY");
maps\_utility::missionFailedWrapper();
}


I think i may just give up on this one :(
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11672
Last: Apr 20, 2024
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 01:18 pm
I haven't read this whole thread, but a quick look at your code and it seems you are using GetEntArray without building the array:

s6robi writes...
Quote:

mission_failure()
{
brushmodel = getEntArray("guys","targetname");
trigger_damage1 = getEnt("dtrig","targetname");

trigger_damage1 EnableLinkTo();
trigger_damage1 LinkTo("brushmodel[1]");
setCvar("ui_deadquote", "@SCRIPT_MISSION_FAILURE_ALERTED_ENEMY");
maps\_utility::missionFailedWrapper();
}


[angryalien]
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 01:53 pm
Dude what? Dont just add that code hahah. Its an example. Check the other link.

@Stryder what do you mean?
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11672
Last: Apr 20, 2024
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD2 General
Posted: Thursday, Jan. 28, 2016 02:22 pm
GetEnt gets a single entity
GetEntArray gets multiple entities

Code:
brushmodel = getEntArray("guys","targetname");


The GetEntArray requires the array to be built afterwards:

and example would be:

Code:
brushmodel = getentarray("guys","targetname"); 	for(i=0; i<guys.size; i++)


i would also suggest not using naming conventions of common scripting entities (ie - do not use the header "brushmodel" as it is already something hardcoded into the engine)

[angryalien]
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 General

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

»