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

Location:
James' Games Site  \  Meteor 2  \  Editing  \  Script

Back to Threads

Viewing Thread: Script

 

Knasp

Joined: 18 June 2004
Posts: 158
27 September 2004 17:05 (UK time)

Will it be possible with script to change an object into another object?

You need to login to create posts in this thread.

Flammable Maniac

Joined: 30 June 2004
Posts: 209
17 October 2004 19:27 (UK time)

Dunno ;P

You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1302
17 October 2004 23:29 (UK time)

I dunno either (perhaps) but you can fool it by showing and hiding objects.

You need to login to create posts in this thread.

Agent Nightfire

Joined: 21 August 2004
Posts: 223
30 October 2004 17:58 (UK time)

I have no clue either. My only answer is what James said.

You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1302
31 October 2004 11:19 (UK time)

You can hide an object and show another in the same block of code. This works well assuming that the object changes in the same place every time.

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
17 July 2005 08:53 (UK time)

I am making now, while the Civilwar is bombing out, a multiple-map-mission for M2. Now I got the Base Entrance ready, that when you get in there is a script "SC_RunMap("");" When I activate it, it runs a map VIA A MAP FINDER?!?!?!I mean that when you cross it, it likes lets YOU open the map YOU want. Is this valid (like is it supposed to happen)?

You need to login to create posts in this thread.

me_mantis

Joined: 26 September 2003
Posts: 1151
18 July 2005 20:38 (UK time)

Knasp: To do this, you need to create 2 objects. the first object(bob), and the second object(sheep).

Make the trigger get bobs coordinates, and make bob hidden. Set the sheeps coordinates to that of bob, and make the sheep un hidden. Blamo! Bob turns into a sheep, no matter where he is on the map.


q#2 you have to put a map filename in the (), not leave it blank.

Edited: 18 July 2005 20:51


You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1302
19 July 2005 01:20 (UK time)

Yes I suppose passing no map name would make the map dialog appear, after all it is just a wrapper that passes "map ????" to the console.

As for changing bob into a sheep...

Lets asssume that bob's ID is 10 and the sheep is 20

export OnMapStart;
export ChangeBobToSheep;

void OnMapStart()
{
// hide the sheep
SC_SetObjectHidden( 20, 1);
}

void ChangeBobToSheep()
{
int BobX, BobY; // declare 2 integer numbers to store bobs coords

// hide bob
SC_SetObjectHidden( 10, 1);

// set sheep to bob's coordinates
SC_GetObjectCoords( 10, &BobX, &BobY); // get bob's coords (it does not matter that he is hidden, he still exists underneath it all)
SC_SetObjectCoords( 20, BobX, BobY); // set coords to sheep

// show sheep
SC_SetObjectHidden( 20, 0);
}



In Meter 2 version 1.0 you will actually able to spawn a sheep out of thin air, in the mean time this method will work just as well for "isolated events".

You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1302
19 July 2005 01:22 (UK time)

Oh and an example of running a map

SC_RunMap( "01_01_SwallowLake");

Note that you cam ommit the ".map" file extension.

You need to login to create posts in this thread.

Knasp

Joined: 18 June 2004
Posts: 158
19 July 2005 18:46 (UK time)

Interesting script there JB, though i managed to pull it off with hiding and appearing.If you take a look me_mantis I started this thread september last year but thanks for answering non the less =).

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
23 July 2005 15:16 (UK time)

Hello, I'm back! Now, James, I knew that "SC_RunMap" thing, I've seen the docus and searched some "secrets" through the maps. The thing is that the map is in 2-3 pieces and it's a base. The first one finishes when you get inside base, there is the script Run Map. But I haven't made Base Upsilon the second part, so I had to let it like that, and when I was testing the Base Entrance, when I (easilly :p) got in it made a dialog appear. Did you, James, make this or did it come out accidentally?

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
23 July 2005 15:18 (UK time)

Oh, and maybe I should make the Base entrance a bit more difficult, huh?

You need to login to create posts in this thread.



Forums system (C) 1999, 2017 by James Bunting.

Terms of Use