Location: JBPLAY \ Meteor 2 \ Help and Guidance \ Knasp's Scripting Question Back to Threads |
Canuck
![]() Joined: 31 August 2007 Posts: 419 |
26 November 2008 01:19 (UK time)
Knasp wrote: I wrote: You need to login to create posts in this thread. |
ParaSait
![]() Joined: 26 June 2007 Posts: 1478 |
26 November 2008 17:41 (UK time)
Yay, finally things start staying on-topic =D
You need to login to create posts in this thread. |
Knasp
![]() Joined: 18 June 2004 Posts: 158 |
26 November 2008 23:35 (UK time)
Thanks man, but how would it work in Co-op? Cause that will be important for me. You need to login to create posts in this thread. |
Canuck
![]() Joined: 31 August 2007 Posts: 419 |
27 November 2008 00:00 (UK time)
I really don't know. I guess the only way to find out would be to try it. You need to login to create posts in this thread. |
arezey
![]() Joined: 16 June 2005 Posts: 1599 |
27 November 2008 06:54 (UK time)
Nice to see somebody saw use for the stuff I wrote for Scoping. Maybe use StaticFlags[] in place for items? That would look less 'dirty' IMO. You need to login to create posts in this thread. |
Knasp
![]() Joined: 18 June 2004 Posts: 158 |
27 November 2008 14:05 (UK time)
I'm sorry, but to be more specific: Is it possible to create a variable for example: int x = 4 and each time anyone in the MP game buys/picks up one of these things from the toolbar the stock decreases by 1 until there's 0 left, when you can't buy anymore? You need to login to create posts in this thread. |
ParaSait
![]() Joined: 26 June 2007 Posts: 1478 |
27 November 2008 18:44 (UK time)
Sure, you can indeed declare your own variables, but keep in mind that variables (except StaticFlags) are only valid for the current map you're in. So if you declare an int x, and go to another map, the game suddenly doesn't know of any x anymore.
You need to login to create posts in this thread. |
Canuck
![]() Joined: 31 August 2007 Posts: 419 |
27 November 2008 22:02 (UK time)
Okay, it's been put to the test. If you use static flags, you can have buyable items with a limited stock. Here's a test map. I also managed to make the items cost the player money and made the stock replenishible. Edited: 27 November 2008 22:06 You need to login to create posts in this thread. |
Canuck
![]() Joined: 31 August 2007 Posts: 419 |
27 November 2008 22:05 (UK time)
And I suppose I should show how I did it: Here's the map's script file.
I'm afraid I didn't label the script very well, so if you have questions...ask. ![]() You need to login to create posts in this thread. |
Knasp
![]() Joined: 18 June 2004 Posts: 158 |
28 November 2008 09:43 (UK time)
Sweet! I'll try it out when I get home. You need to login to create posts in this thread. |
Knasp
![]() Joined: 18 June 2004 Posts: 158 |
28 November 2008 22:59 (UK time)
Works perfect Canuck! ![]() Thanks alot for your effort. Now I just have to figure out how to spawn something at random, or at least have the spawning loop in a random fashion. Edited: 28 November 2008 23:02 You need to login to create posts in this thread. |
Canuck
![]() Joined: 31 August 2007 Posts: 419 |
30 November 2008 03:13 (UK time)
You mean spawn something at a random time, or in a random place, or both? You need to login to create posts in this thread. |
me_mantis
![]() Joined: 26 September 2003 Posts: 1152 |
12 December 2008 17:02 (UK time)
check out the ravagers of time main map (barsor) it's got a guy on waypoints, and everytime he hits one, it calls a function. Then, waypoint function can be used to run a time based event... like randomly placing something! It's fun, but make sure that the guy on waypoints is invincible, and unsquishable, and unblockable. cheers! You need to login to create posts in this thread. |
Canuck
![]() Joined: 31 August 2007 Posts: 419 |
13 December 2008 04:44 (UK time)
Like this! You need to login to create posts in this thread. |
|
Forums system (C) 1999-2023 by James Bunting.
Terms of Use