Basic Cubescript: Variables
#31
You are right, do you move around when you are typing in game? ;)

Also, I'll check to see if it is in the tutorials that I posted :>
Thanks given by:
#32
Quote:do you move around when you are typing in game? ;)
That's what I was thinking. Also I forgot to say that the script doesn't appear to echo $slow for some reason. Your version. :/

Edit: Is there a native alias that returns your own cn? Or name? It'd be really useful :)
Thanks given by:
#33
http://assault.cubers.net/docs/reference...ier_findcn
http://assault.cubers.net/docs/reference...ier_findpn

:)
Those should help you on your way.
Thanks given by:
#34
I knew both of those... but you can't get one without knowing the other :/
Since your cn is never the same on a server and your name is subject to change... I don't see how this can help me. :( I'm looking for a native my_name or my_cn I thought me was it at first, but it's not. I want to be able to do something like /kick me for example.

Edit: I was also hoping for the sensitivity variable alias itself, so I could store it temporarily to scale the sensitivity while in "bullet time", but alas, there appears to be only the function that assigns it. And /scalesensitivity appears to be a work in progress. (Though I didn't actually see if it works)

Oh and is there an alias for when to play the sounds slower (like when you're bombed, for example, without the tinitus sound) Not sure if I want to use it or not for my script but I'd like to try it. I didn't see it in the reference under sound.

Sorry for asking all these questions :/
Thanks given by:
#35
Ah, sorry. You will also want curname as well.

You can just make a different alias to store it temporarily.

So:
tempsens = $sensitivity

No alias, however feel free to code that in C++, I can help provide a go around the engine if you want :> However, my C skills are lacking.

If you feel bad for asking, join the CubeScript IRC channel that was previously mentioned :) I frequently idle there, and the others that are there could help you too. Its how I got started in cubescript. IRC is basically a chatroom. http://wiki.cubers.net/action/view/IRC
Thanks given by:
#36
/kick (findcn $curname)

(01 Dec 11, 03:17PM)tempest Wrote:
(01 Dec 11, 03:50AM)V-Man Wrote: haha, that's useful for when you're entering a scripting contest that has a limit on the number of lines. :-P

Or when we start the International Obfuscated CubeScript Code Contest. Oh boy, that would be fun :D

O_O
* V-Man starts working
Thanks given by:
#37
I couldn't find curname in the docs... but that is what I am looking for. Is there a list of all the game-defined aliases (that aren't in the docs?)

I've been on IRC a lot. Maybe it's coincidence, but the people I asked my CS questions didn't seem... very knowledgeable on the subject. I'll try them again, though :P Maybe it was just every time I asked so far ;)

Also, I thought sensitivity was just a function -- so I see it has a value as well? Well that is what I am looking for then :) (untested) Alright. So it's overloaded to take arguments as well as having a value itself.
Thanks given by:
#38
Quote:No alias, however feel free to code that in C++, I can help provide a go around the engine if you want :> However, my C skills are lacking.

Are you referring to the scalesensitivity (it says TODO in the docs) If I edit my client I won't be able to play online, right? I haven't even looked at the source yet :P Maybe I should.

edit: Sorry for the double post -- I tried to delete it but it said I don't have permission to :x
Thanks given by:
#39
Sorry, the coding in C++ was referring to:

"Oh and is there an alias for when to play the sounds slower (like when you're bombed, for example, without the tinitus sound) Not sure if I want to use it or not for my script but I'd like to try it. I didn't see it in the reference under sound."

Sorry, I am not on when I work :>

Maybe you can force V-Man to be on there, he has erratic enough hours :|
Thanks given by:
#40
Oh. :/
Well somehow the game does it. I mean what is currently being used to play the sounds slower and lower pitch?

Also, I'm using SVN -- I realize that's causing some different views on some things, e.g. V-Man saying I need the execdir scripts when apparently SVN does it automatically:
Quote:// All .cfg files placed in this /scripts/ directory, will be automatically
// executed when you start AC.

I got some really cool scripts going well. I only realized that I'm using commands only available in the new version of AC :/ (Speaking of which, I never see anyone on SVN servers, ever :/ )

V-Man if you're reading this thank you for the help regarding CS syntax :)
It's gone farther than you probably think ;)
Thanks given by:
#41
(02 Dec 11, 02:33PM)Felix-The-Ghost Wrote: I couldn't find curname in the docs... but that is what I am looking for. Is there a list of all the game-defined aliases (that aren't in the docs?)
It's a default alias, but, sadly, there isn't a comprehensive list of those. I have custom docs for many of them sitting around somewhere (and apparently SVN is chock-full of new ones)...

Quote:Also, I thought sensitivity was just a function -- so I see it has a value as well? Well that is what I am looking for then :) (untested) Alright. So it's overloaded to take arguments as well as having a value itself.
Actually, most of the "settings" variables behave that way. With an argument, the game attempts to store that argument as its value if feasible. With no argument, the game defaults to echoing the current value.
This means you can probe them with the "value of" sign ($), while other commands don't allow this.

(03 Dec 11, 04:18AM)Felix-The-Ghost Wrote: Oh. :/
Well somehow the game does it. I mean what is currently being used to play the sounds slower and lower pitch?
It's hard-code sound stuff, which I have not read deeply. It has to do with the sound file's iostream slowing down, I'd imagine.

Quote:Also, I'm using SVN -- I realize that's causing some different views on some things, e.g. V-Man saying I need the execdir scripts when apparently SVN does it automatically:
Quote:// All .cfg files placed in this /scripts/ directory, will be automatically
// executed when you start AC.

I got some really cool scripts going well. I only realized that I'm using commands only available in the new version of AC :/ (Speaking of which, I never see anyone on SVN servers, ever :/ )
(huge smile)
Each new version of AC brings huge improvements to CubeScript's abilities. The SVN is a brilliant example of this.
Yes, I assumed you were using the latest release, not the subversion. PM me if you plan to set aside a significant amount of time idling in an SVN server. We can test stuff and 1v1. :D

Quote:V-Man if you're reading this thank you for the help regarding CS syntax :)
It's gone farther than you probably think ;)
Ah!
Appreciation is what I eat for dinner. What a feast! ^_^
Thanks given by:
#42
Glad to see others taking interest in CS honestly. Felix, if you ever need assistance, drop by #CubeScript on gamesurge IRC, or even #assaultcube on quakenet, and I'm sure you can find a guru's help. :)
Thanks given by:
#43
The docs that you have been reading and that we have been referring you to are current (somewhat) with the SVN. Meaning not everything will be in 1104. These are the old docs: http://actiongame.svn.sourceforge.net/vi...ision=5882
Thanks given by:
#44
Quote:The current dimensions of the selection (either created by the user or this command) are in the variables selx, sely, selxs and selys and can also be read/modified.

These don't work at all in the SVN :'(
The things I could do...
Thanks given by:
#45
In the SVN, those return lists to support the new multiple selection feature.
Make a selection, hold CTRL, and make another selection.
You can examine the lists of selections using
[cubescript]
/echo (selx) (sely) (selxs) (selys)
[/cubescript]

The tradeoff is that they aren't as easily modifiable in this manner anymore. Look at the current maptools.cfg (SVN of course) for some examples of how to mess around with them. :D

To address the theme: These variables now store and manipulate lists rather than single items. In that way, they are a lot more like commands...
Thanks given by:
#46
You have a great collection of scripts, but there are so many, with so few comments, I don't know where to begin, or how to differentiate between what is a default alias or an alias defined in your tools.cfg.

I couldn't figure out what to do with the selection lists. I'll have to keep looking.

I did see this:
[cubescript]
alias crate [
editheight 0 $arg1
settex $arg2 0
settex $arg2 1]
// crate (crate height) (texture to use)
[/cubescript]
Might I suggest overloading it to allow a different texture for the wall and floor? Not all crates use the same textures (Even though the crate is one unit) Just check numargs and act accordingly.

Also, is/are these tools a group collaboration or your own work? Kudos to you if it's all yours -- that's quite an effort. Since I and I assume others will be making their own tools/map tools, might I ask if you are open to an assimilation of quality tools/scripts?
Thanks given by:
#47
(04 Dec 11, 10:56PM)Felix-The-Ghost Wrote: there are so many, with so few comments, I don't know where to begin, or how to differentiate between what is a default alias or an alias defined in your tools.cfg.
:/ Good point, I should focus on documenting my own stuff...

Quote:Might I suggest overloading [the crate script] to allow a different texture for the wall and floor? Not all crates use the same textures (Even though the crate is one unit) Just check numargs and act accordingly.
When I see more people using it, I may be more motivated to expand its functionality. It uses a few proto-scripts to get it started, though, which would make the process easier.

Quote:Also, is/are these tools a group collaboration or your own work? Kudos to you if it's all yours -- that's quite an effort.
Haha, it's something I started, but basically everyone is pitching in. Bukz, Yarukinasu, macm, Kirin, Gibstick, and Ronald_Reagan (apologies for not naming everyone) have all contributed to make it what it is today -- not to mention all the people who test it for us and provide feedback.

Quote:might I ask if you are open to an assimilation of quality tools/scripts?
I will be more than happy to include pertinent scripts in future releases of tools and maptools. :D
Thanks given by:
#48
[cubescript]
alias manual_crate [

equalize 0 //level the floor first
loop i $arg1 [ editheight 0 1 ] //raise cubes $arg1 times

if ( > $numargs 2 ) [ //at least three arguments
settex $arg2 0 //assign floor texture
settex $arg3 1 //assign wall texture

][ //less than three arguments
settex $arg2 0 //assign floor texture
settex $arg2 1 //assign wall texture
]
]

// manual_crate (crate height increase) (texture to use for floor, and/or wall if third argument is not provided) ( optional: texture to use for wall )
[/cubescript]

That's an example of what I meant. I tested it, too. Works well. The name's weird but I didn't want to overwrite your function cause I wasn't sure exactly how it was supposed to be used as in:
Quote:It uses a few proto-scripts to get it started, though, which would make the process easier.
I'm guessing you call it in some automatic fashion. I just did it a little different so you could call the function yourself directly.

Also, great work on tools.cfg nonetheless. I have a pretty good idea, though it looks like your work is already quite extensive o_O

edit:
I typed /echo (selx) (sely) (selxs) (selys) and it outputs 0^some_number four times. The last two appear to be the selxs and selys but I couldn't find out the relation of the first two numbers and the x/y I had selected on the map.

append:I don't know what those numbers mean :P
Thanks given by:
#49
(05 Dec 11, 12:17AM)Felix-The-Ghost Wrote: I typed /echo (selx) (sely) (selxs) (selys) and it outputs 0^some_number four times. The last two appear to be the selxs and selys but I couldn't find out the relation of the first two numbers and the x/y I had selected on the map.

append:I don't know what those numbers mean :P

:o
You need to compile the ac_client.exe for yourself in these later SVN revisions.
If you use Windows, the one I compiled might work:
http://forum.cubers.net/thread-3991-post...l#pid70676

(quote inserted for context)
Thanks given by:
#50
I'm not totally sure what your post is a response too, but yeah maybe thats why I never see anyone on SVN servers (or that I only see three)
Thanks given by:
#51
There is only three :>
Rarely players on them. To get games going, the best way it to ask on IRC for matches.
Thanks given by:
#52
There doesn't appear to be a native alias for when a grenade is actually thrown. There is onAttack[], (curweapon), and onrelease[], but since the grenade key/button is not always the same (e.g. MOUSE1, MOUSE2, G, custom binds) I'm not sure what to do here. onAttack[] triggers when you pull the pin, not when you throw it :(

needz moar onThrow[] :DDD
Thanks given by:
#53
Until such a native alias is made, you can use findbind and add2bind to add an "onrelease" script.
[cubescript]
add2bind (findbind quicknadethrow) [onrelease [echo Nade thrown!]]
// and/or
add2bind (findbind attack) [if (= (curweapon) 8) [onrelease [echo Nade thrown!]] []]
[/cubescript]
(findbind is in tools.cfg)

Just realized, quicknadethrow is going to be in default script "altaction..."
[cubescript]
loop i 10 [ if (!= $i 5) [
add2alias (concatword altaction_ $i) [onrelease [echo Nade thrown!]]] [] ]
[/cubescript]
Thanks given by: