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

Location:
JBPLAY  \  Meteor 2  \  Editing  \  Freezes on door that requires a certain amount of credits :(

Back to Threads

Viewing Thread: Freezes on door that requires a certain amount of credits :(

 

Armageddon1212

Joined: 10 July 2004
Posts: 142
10 August 2005 18:28 (UK time)

If you dont have enough credits then the game freezes if you walk into it. Is it because theres no message like "REd Key Card required"? Just wonder if you can fix it possibly so my RPG wont be ruined :(

You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
11 August 2005 03:45 (UK time)

In your SC file just use "else". For example, if you must have at least 25 shotgun shells to open door with ID of 6:

<i>export OnMapStart;
export door;


void OnMapStart()
{

}


void door()
{
if( SC_GetItemCount("Shotgun Shell";) < 25)
{
SC_OpenDoor(6);
}
else
{
SC_MessageBoX("You don't have enough shotgun shells.";);
}
}</i>

for the door, you'll need to put a sector under it that will be displayed when the door is opened. Also, under the sector's script command, you'll need "run door".

For your SC file:


<i>export OnMapStart;
export door;


void OnMapStart()
{

}


void door()
{
if( SC_GetItemCount("<name of item>";) <greater or less than sign, or equal sign> <amount of item>;)
{
SC_OpenDoor(<door's id>;);
}
else
{
SC_MessageBoX("You don't have enough <item>.";);
}
}</i>


Edited: 11 August 2005 03:48


You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
11 August 2005 04:33 (UK time)

Actually, i think SC_OpenDoor(); places an opened door sprite underneath it by default anyways, so the extra sector underneath isnt required.

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
11 August 2005 05:48 (UK time)

Hey, if it costs, should it lose the credit amount, like:

<i> export OnMapStart;
export Door;

void OnMapStart()
{
SC_GameMessage("Opening the door costs 25 credits.";);
}

void Door()
{
if( SC_GetItemCount("credit";) < 25)
{
SC_OpenDoor(6);
SC_GiveItem("credit",-25)
}
else
{
SC_MessageBoX("You don't have enough credits.";);
}
}</i>


You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
11 August 2005 13:04 (UK time)

SC_OpenDoor does exactly this...

1. Plays a eeeeooooorrrrr sound
2. Changes the current solid door sector's passble type to land
3. Changes the bevel to flat
4. Changes the texture to the door track

So you don't need anything else. In fact it uses the same code as the regular open door system.

In this case (as it could be a bug) you can email me your map and script for investigation.

James

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
11 August 2005 14:31 (UK time)

Eh, I just wrote it here. I copied it form mike but I haven't tested it yet, I really must.

You need to login to create posts in this thread.

Flammable Maniac

Joined: 30 June 2004
Posts: 209
11 August 2005 14:54 (UK time)

Confused...

EDIT: This is a real good example of the need of cut 'n paste maneouvers!

Edited: 11 August 2005 14:55


You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
11 August 2005 17:03 (UK time)

BUT

Yes there is one other thing about SC_OpenDoor (I did think about that) is that the target sector has to be a door. I suppose you could lock it (set a pass, etc.) but it would be more flexible script-wise if the target sector wasn't bound into M2's internal commands.

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
11 August 2005 17:36 (UK time)

eeeeooooorrrrr

You need to login to create posts in this thread.

Flammable Maniac

Joined: 30 June 2004
Posts: 209
11 August 2005 18:58 (UK time)

Seriously, I'M LOST!

Waypoints: I've finally got those to work.

All scripting, which isn't in the ingame help button: Huh...? :S

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
11 August 2005 20:02 (UK time)

Well, copy the examples and then modify that it should work.

(POST 150)


Edited: 11 August 2005 20:03


You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
11 August 2005 21:43 (UK time)

Well, Flammible, wait because I'm about to release a tutorial about scripting. I'll link here once its done.

You need to login to create posts in this thread.

Armageddon1212

Joined: 10 July 2004
Posts: 142
12 August 2005 02:13 (UK time)

I have no idea how to do all of taht >_<

You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
12 August 2005 05:54 (UK time)

ookie


Well then ur best bet is to wait until James releases a patch that fixes the problem.

Otherwise...start studying scripting man!

You need to login to create posts in this thread.

Flammable Maniac

Joined: 30 June 2004
Posts: 209
12 August 2005 06:06 (UK time)

"Well, copy the examples and then modify that it should work."

Apparently I can't cut 'n paste it into the game, I just get a "^" sign.

You need to login to create posts in this thread.

Armageddon1212

Joined: 10 July 2004
Posts: 142
12 August 2005 14:23 (UK time)

So doing al taht is the only way to fix it? :S

You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
12 August 2005 23:09 (UK time)

Im planning on making a Meteor 2 Documentation (on the game itself, as i can already see that the editing tools are being worked on ;) ) :D

Its going to have basic unit specifications (excluding "special" units/"unknown" units such as the mini-sub, RaySub, GNV Spaceship, ect)

Not to mention other fun stuff ;)

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
17 August 2005 05:54 (UK time)

I am also working on a docu, about of scripting.

You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
17 August 2005 07:08 (UK time)

I thought mike was doing one :)


Well, im not sure how long it'll take to get started on it though, as right now i have an addiction to the Code Red mod for Red Alert 2, and I am supposidly going to enter in my review for this one game for Gamehippo (im not a reviewer yet, this is supposed to be a sample one so i can become one. If it is good enough i will use it as my first reviewed game)...

Well, i already know what i am going to do for it (sorta), ive been thinking about it now and then.

Oh darn! I just remebered i need (ok... WANT) to get going on making my one map for RA2 too... not to mention get re-used to Meteor2's editors and all the new stuff... gosh i really shouldnt vouch for so many things to do at a time :D

You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
17 August 2005 20:48 (UK time)

Well I am doing one, so I guess we'll have two tutorials.

You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
17 August 2005 21:28 (UK time)

Anything new i should put in the documentation apart from the old one?

You need to login to create posts in this thread.



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

Terms of Use