Cacodemon
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > How to use ACS?
 
Author
All times are GMT. The time now is 16:14. Post New Thread    Post A Reply
1337CyberdemonxX
Loser


Posts: 51
Registered: 05-11


Hi I'm making a WAD and I want a script to execute when the player dies to enable chasecam. How do I do this?

__________________
-left on the night train
Take this quiz!

Old Post 12-25-11 23:10 #
1337CyberdemonxX is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
GreyGhost
a ghost... only grey


Posts: 5700
Registered: 01-08


Try this - it's a hack of the third person camera script on the ZDoom Wiki and probably overkill for what you want.
code:
//Third person death camera simulation. //A quick hack of solarsnowfall's script by GreyGhost #include "zcommon.acs" #define C_TID 1000 //Default camera tid #define MAX_R 128 //Maximum radius (or distance from the player) #define ADJUST_R 8 //Amount to adjust the camera by #define VIEW_HEIGHT 41.0 //The approximate height of the player's view bool cam_mode[8]; //Variable for turning the camera on or off. Script 1 DEATH { cam_mode[PlayerNumber ()] = ON; ACS_ExecuteAlways (2, 0, PlayerNumber ()); } Script 2 (int p_num) { int r = MAX_R; while (cam_mode[p_num] == ON) { int a = GetActorAngle (0); int p = GetActorPitch (0); int x = GetActorX (0); int y = GetActorY (0); int z = GetActorZ (0) + VIEW_HEIGHT; int xyr = r * cos (p) >> 16; if (!ThingCountName ("ChaseCam", C_TID+p_num)) { while (!Spawn ("ChaseCam", x-cos(a)*xyr, y-sin(a)*xyr, z+sin(p)*r, C_TID+p_num, a >> 8) && r > 0) { r -= ADJUST_R; xyr = cos (p) * r >> 16; } if (ThingCountName ("ChaseCam", C_TID + p_num)) ChangeCamera (C_TID + p_num, 0, 0); else { cam_mode[p_num] = OFF; print (s:"Camera script failed to initialize."); } } else { while (!SetActorPosition (C_TID+p_num, x-cos(a)*xyr, y-sin(a)*xyr, z+sin(p)*r, 0) && r > 0) { r -= ADJUST_R; xyr = cos (p) * r >> 16; } SetActorAngle (C_TID + p_num, a); SetActorPitch (C_TID + p_num, p); if (r < MAX_R) r += ADJUST_R; } delay (1); } } Script 3 RESPAWN { cam_mode[PlayerNumber ()] = OFF; Thing_Remove (C_TID + PlayerNumber ()); }

You'll also need the ChaseCam actor from that page in your DECORATE script.

ACS scripts can also be edited and compiled from within Doom Builder, should you encounter problems with XWE.

Old Post 12-26-11 01:59 #
GreyGhost is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
1337CyberdemonxX
Loser


Posts: 51
Registered: 05-11


thanks alot but can't you just edit the player DECORATE to execute a script when you die. and the script would be this:
#include "zcommon.acs"

script int (VOID) NET
{
Consolecommand("chase");
]

script int RESPAWN
{
acs_suspend(int);
}

Old Post 12-31-11 03:30 #
1337CyberdemonxX is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
esselfortium
Cumulonimbus Antagonistic Posting


Posts: 5268
Registered: 01-02


The XWE forum isn't really the place for general editing questions like this. It'd be more appropriate in Doom Editing.

Old Post 12-31-11 03:49 #
esselfortium is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
1337CyberdemonxX
Loser


Posts: 51
Registered: 05-11


well i just posted it here cause i was using XWE to compile it so yeah. but you're right i should of put it there

Old Post 12-31-11 21:55 #
1337CyberdemonxX is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 16:14. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > How to use ACS?

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory