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

Members Online

»
0 Active | 8 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 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: Array & Script noteworthy
BlindSniper
General Member
Since: Aug 22, 2008
Posts: 45
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Sunday, May. 19, 2013 02:26 pm
attachment: image(209.2Kb)
Basically what I'm trying to do is create a bar that will spin around an origin, i've attached image of what I mean.
I've achieved it with an inefficient code but I want to do it with arrays, though I don't fully understand how they work. This is what I've got so far

Code:
main()
{
 self.arm = getent("arm","targetname");
 spin_trigger = getentarray("spin","targetname");
 for(i=0;i<spin_trigger.size;i++)
 {
 //spin_trigger[i] EnableLinkto(); 
 //spin_trigger[i] Linkto( self.arm );
  while(1)
  {
  spin_trigger[i] waittill ("damage",dmg);
  self.dmg = dmg;
  thread spin();
  }
 }
}
spin()
{
speed = 300 + (self.dmg*4.5);
time = 1+(self.dmg/45);
direction = getent (self.target,"script_noteworthy"); //Here I want find out whether it's clockwise or anticlockwise trigger
if ( self.direction == "clockwise" )
	velocity = speed*-1;
else 
	velocity = speed;
self.arm rotatevelocity((0,velocity,0),time,0,time - 0.1 );
}


1. Could this be done with a singular trigger and the script works out which direction the impact was from so as to spin the right way?
2. How do you do link to for arrays?
3. How would I get script noteworthy for the individual trigger that was hit?
4. Could I get the distance from the spin centre to the point of impact?

edited on May. 19, 2013 07:26 am by BlindSniper
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

»