home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


gravity

by $k!llz on 07/30/2008 02:15, 12 messages, last message: 08/06/2008 01:49, 1330 views, last view: 04/25/2024 16:41

ya um i was experementing with the gravity and i thought it would be kool if you coullg have a variable so u cna change it without recomoiling the wouldl be like /gravity 10 or 4890 -34234 or something. if any1 knowd some code on how to make a gravity variable pleze share it with me

   Board Index   

#1: ..

by Hirato Kirata on 07/30/2008 02:27

the answers lie in physics.cpp, that's all I'll say on the matter

reply to this message

#2: Re: ..

by $k!llz on 07/30/2008 02:50, refers to #1

i know that but can u tell me how to make a variable

reply to this message

#3: Re: ..

by Hirato Kirata on 07/30/2008 02:57, refers to #2

considering what you're trying to do, you should really just look through the code, and see how other variables are created and follow from there.

besides if I told you, you wouldn't learn anything, specially considering just how simple this is

reply to this message

#4: Re: ..

by $k!llz on 07/30/2008 03:03, refers to #3

i looked but i couldnt find any. plese tell me

reply to this message

#5: Re: ..

by JadeMatrix on 07/30/2008 04:39, refers to #4

I hear BF has a gravity variable. Look it up there, may be what you're looking for.

reply to this message

#6: ..

by Mr.Piddly 00000001 on 07/30/2008 04:42

A simple gravity control command should be in an official release. The combination of a low/high gravity environment combined with some of the current game modes and news maps could create some very interesting gameplay.

reply to this message

#7: Re: ..

by noerrorsfoun348327 on 07/30/2008 15:12, refers to #4

Buy a beginners\' book about C++ or learn from tutorials online.

http://www.learncpp.com/
http://cprogramming.com/
http://www.cplusplus.com/

Nobody wants to walk you through everything step by step, especially when it\'s as simple as declaring and defining a variable.

reply to this message

#8: ..

by scanf on 07/30/2008 19:07

There are several different templates for creating a new variable. It all depends on what you want to do with it. The simplest is VAR(name, min, cur, max)

name - name of your variable
min - minimum value for this variable
cur - current value
max - max value for this variable

You should really look over the tut's noerrorsfoun348327 linked. Cube code is very complex in places and hard to follow for even an experienced c++ programmer.

reply to this message

#9: Re: ..

by $k!llz on 07/30/2008 22:31, refers to #8

well i knew how to make the variable i just dont know do ame make it so ui go like /gravity 50 or something

reply to this message

#10: ..

by R0b0t1 on 08/03/2008 00:19

You people have obviously not realized that telling people actually does help them, as they know what to do next time.

reply to this message

#11: solution

by ØØØØØØØØØØØØ on 08/05/2008 21:52

physics.cpp
+----CUT------+
/*const float GRAVITY = 200.0f;*/
/* Line 398 */
float GRAVITY=200.0f;
void gravity(int *cl_gravity)
{
GRAVITY=(float)*cl_gravity;
}
COMMAND(gravity,"i");

+----CUT------+
Not tested but should work

reply to this message

#12: Re: solution

by Quin on 08/06/2008 01:49, refers to #11

=== src/engine/physics.cpp ===
- const float GRAVITY = 200.0f;
+ FVARF(gravity, 200.f);

Then s/GRAVITY/gravity/ ...

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53872961 visitors requested 71648166 pages
page created in 0.019 seconds using 10 queries
hosted by Boost Digital