You are not logged in.    Login    New User    Forum Home    Search

Location:
JBPLAY  \  Meteor 2  \  Editing  \  Changing On Hit

Back to Threads

Viewing Thread: Changing On Hit

 

IGotVista
Joined: 29 November 2007
Posts: 6
30 November 2007 22:56 (UK time)

Is there a script to change a object into another object (randomly out of a list perferably) when hit with a specific weapon?

Edited: 30 November 2007 23:04


You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
01 December 2007 18:30 (UK time)

Don't think so. (Off the top of my head, which hasn't played Meteor 2 in awhile, so I wouldn't swear to it)

You need to login to create posts in this thread.

Canuck

Joined: 31 August 2007
Posts: 419
01 December 2007 23:26 (UK time)

You could use the OnObjectHurt function, and then hide the original object and add another different one, but then it would happen if it was hit with any weapon.

You need to login to create posts in this thread.

Canuck

Joined: 31 August 2007
Posts: 419
02 December 2007 17:15 (UK time)

It would look something like this:

void OnObjectHurt_0()
{
SC_SetObjectHidden(0,1);
SC_GetObjectCoords(0,&PosX,&PosY);
SC_AddObject("WhateverObjectYou Want.ob",PosX,PosY,-1,AI_ROAMING,0,"Name",1,0);
}

This would replace object 0 with the new one. You could also do it like this:

void OnObjectHurt_0()
{
SC_SetObjectHidden(0,1);
SC_GetObjectCoords(0,&PosX,&PosY);
SC_SetObjectCoords(1,PosX,PosY);
SC_SetObjectHidden(1,0);
}

This would replace object 0 with object 1, where object 1 is one you have hidden at the start of the map, or just put somewhere where no one will see it. This might be better, because you will know the Id of the "new" object, so you can run scripts on it. Still, though, these will work when the object is hit with anything, not just a specific projectile.

You need to login to create posts in this thread.

IGotVista
Joined: 29 November 2007
Posts: 6
03 December 2007 17:35 (UK time)

Ok, thanks. I could still probably use that, even though it's not for a specific weapon.

You need to login to create posts in this thread.



Forums system (C) 1999-2023 by James Bunting.

Terms of Use