Project X Forums



It is currently Thu Mar 28, 2024 9:40 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Sample script for new engine
PostPosted: Mon Aug 17, 2009 12:39 pm 
Offline
PX Developer

Joined: Mon Aug 17, 2009 12:01 pm
Posts: 91
Here is sample script of new oildrum for new scripting engine :

Code:

require default;

CNewDrum : COilDrum;      //this line declares CNewDrum class from COilDrum (explosive oil drum thingies)

CNewDrum::CNewDrum(CObject* parent, fixed x, fixed y)    //constructor of CNewDrum
{
  super(parent->Store->GetObject(25, 0), x, y, false);        //GetObject(25, 0) returns parent object for all environment objects (mines, oil drums...)
  fds = new CFireDesc;                                                  //will be used later in the script
};

void CNewDrum::Explosion()
{
   DoExplosion(1, PosX, PosY, 100, 88, 0, OwnerTeam);              //triple explosion
   DoExplosion(1, PosX, PosY - 55, 100, 80, 0, OwnerTeam); 
   DoExplosion(1, PosX, PosY - 88, 100, 75, 0, OwnerTeam); 

  fds->X = PosX;                                //flame parameters
  fds->Y = PosY;
  fds->Count = 24;
  fds->UnkB = 1;
  fds->Duration = 5000;
  fds->UpPower = 100;
  fds->Damage = 15;
  fds->OwnerTeam = OwnerTeam;
  fds->SpY = -3;
  fds->SpX = -3;
 
  local fire = new CFire(fs, fds, 0);
};

void CNewDrum::Render()           //replaces original drum render function
{
  local sn = (4 * Dmg) / 50;        //sn is the sprite index
  if (sn > 3) sn = 3;
  AddSpriteEx(16, PosX, PosY, sn + 110, GS->Tick / 50.0, 0, 1.2);  //1.2 is scale
};

void newdrum::Init()                  //newdrum is the script's name
{
  local nd = new CNewDrum(Env->Objs.Objs[0], 100, 0);               //put CNewDrum in point 100, 0
};
 


no "idk" anymore :D


Top
 Profile  
Reply with quote  
 Post subject: Re: Sample script for new engine
PostPosted: Fri Oct 09, 2009 5:50 pm 
Offline
Site Admin
User avatar

Joined: Mon Aug 17, 2009 12:29 pm
Posts: 91
Entuser, I don't think "idk" would compile. :D


Top
 Profile  
Reply with quote  
 Post subject: Re: Sample script for new engine
PostPosted: Sun Oct 11, 2009 3:15 pm 
Offline

Joined: Fri Oct 09, 2009 1:54 am
Posts: 14
Why are you showing us the script without showing us a video? Hehe.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sample script for new engine
PostPosted: Mon Oct 12, 2009 9:59 am 
Offline
Site Admin
User avatar

Joined: Mon Aug 17, 2009 12:29 pm
Posts: 91
Video coming soon. It will be footage of Realtime Worms, but scripting dosen't work there yet.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sample script for new engine
PostPosted: Mon Oct 12, 2009 8:29 pm 
Offline

Joined: Fri Oct 09, 2009 1:54 am
Posts: 14
OK do key artichoke!


Top
 Profile  
Reply with quote  
 Post subject: Re: Sample script for new engine
PostPosted: Sat Jan 23, 2010 4:47 pm 
Offline
Betatester

Joined: Sat Jan 23, 2010 11:12 am
Posts: 7
Nice! I'm glad to see the new script engine is c++ based.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Skin by Lucas Kane