Home   Help Search Login Register  

Author Topic: String, String! Lalala! E'rybody now sing it!  (Read 2865 times)

0 Members and 1 Guest are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
String, String! Lalala! E'rybody now sing it!
« on: 13 Nov 2004, 21:32:55 »
Sing it!

dmakatra went for a bit o' scripting and other marbles
He used the format command to make some variables
He made about a hundred or so
And he ran into problems, oh no!


Chorus:
String String String!
I Think I'll Faint
String String String!
I Just Wanna Die


He turned and thought "what's this thing?"
Format returns a bleeding string!
How can he turn the string so without qoutes?
Please help me and I'll show you a guy that votes


Chorus

For those with no humour: I have a string, how can I turn it "unqouted"?

:beat: *Gets Singed* :beat:
« Last Edit: 13 Nov 2004, 21:34:02 by dmakatra »

DBR_ONIX

  • Guest
Re:String, String! Lalala! E'rybody now sing it!
« Reply #1 on: 13 Nov 2004, 21:39:11 »
No. 1 : You have waay to much free time..
No 2 : Ain't there a funtion in the function list thingy that does this
No 3 : The FORMAT command?
- Ben

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:String, String! Lalala! E'rybody now sing it!
« Reply #2 on: 13 Nov 2004, 21:41:30 »
1) I was just so bored of all the n00bies asking so boring. Besides it was quite funny to write it as well. ;D
2) I could only find a String2Number function, and that doesn't work, as it's a variable.
3) yea, like hint format ["%1", WHAHAHAHHAHAHAHA]. You must have used it?

:beat: *Gets Shot* :beat:

DBR_ONIX

  • Guest
Re:String, String! Lalala! E'rybody now sing it!
« Reply #3 on: 13 Nov 2004, 21:44:50 »
1 : Touche..
2 : Look at the funtion.. Maybe you could change it about a bit
3 : Maybe
newshineyvarible = FOMRAT [%1,oldcrappyvariblenoonelikes]

- Ben

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:String, String! Lalala! E'rybody now sing it!
« Reply #4 on: 13 Nov 2004, 21:49:30 »
I'm not really good with funcies. I tried, but just turned up all error messaged.

:beat: *Gets Errored* :beat:

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:String, String! Lalala! E'rybody now sing it!
« Reply #5 on: 13 Nov 2004, 22:58:25 »
I don't get your question... normally strings aren't displayed with quotes. Only time I can think that they would be, is if you used the format command to look at an array containing strings...

For example, if I wrote:

_string = "Hello"
hint _string

A hint box would appear that says:

Hello

Without any quotes.... Perhaps some more info would be helpful.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:String, String! Lalala! E'rybody now sing it!
« Reply #6 on: 13 Nov 2004, 23:01:59 »
he wants to turn a string into something that is not a string
_string = "hello" vs. _string = hello

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:String, String! Lalala! E'rybody now sing it!
« Reply #7 on: 13 Nov 2004, 23:19:07 »
Yea, that's what I want.

:beat: *Gets Shot* :beat:

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:String, String! Lalala! E'rybody now sing it!
« Reply #8 on: 13 Nov 2004, 23:56:43 »
Okay, so let me get this straight... you want to turn a string into a variable name?

So instead of:
_string = "hello"

You want something like:

hello = "blah"
_string = hello

Only the variable name "hello" could be something different each time the script is run?
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:String, String! Lalala! E'rybody now sing it!
« Reply #9 on: 14 Nov 2004, 00:16:36 »
Yea kinda. Look. This is how it looks in the script:

Code: [Select]
Blah, blah, blah

_GAT = format ["%1%2", _id, _i2]
? id == gua : [_GAT] exec "ATTS.sqs"

Blah, blah, blah, blah, blah

Now, this will return _GAT as, for example "ind2", but instead I want ind2.

Any help appriciated.

:beat: *Gets Shot* :beat:

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:String, String! Lalala! E'rybody now sing it!
« Reply #10 on: 14 Nov 2004, 00:27:54 »
Um... okay, that code didn't really help at all, but it looks like you want to do what I'm taking about. I assume that you want _GAT to be assigned the value that is in the variable ind2, for example?

If so, you are on the right track. But you are just making a string out of _id and _i2, and putting that into _GAT. What you need to do looks like this:

call format ["_GAT = %1%2", _id, _i2]

That will make a string that would look like (for example):

"_GAT = ind2"

Then using the "call" command, you execute that string as though it were a line of script. HOWEVER, you must first create the variable _GAT, before you assign it a value in this way! So, depending on what value is supposed to go into _GAT, your first line could be something like:

_GAT = 0
_GAT = player
_GAT = ""
  or maybe just this would work in all cases:
_GAT = null
  Then you would do the rest:

call format ["_GAT = %1%2", _id, _i2]
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:String, String! Lalala! E'rybody now sing it!
« Reply #11 on: 14 Nov 2004, 00:47:21 »
OK, I will try that tomorrow when I wake up. Untill then, you'll have to do with a toothbrush!

http://i.cnn.net/cnn/2003/TECH/ptech/01/22/toothbrush.king/top.toothbrush.cnn.jpg

Thanks! :)

:beat: *Gets Shot* :beat:

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:String, String! Lalala! E'rybody now sing it!
« Reply #12 on: 14 Nov 2004, 19:27:22 »
 :-\

Returns Scalar-Bool-Array-Whatever-Error. :(

_GAT = player
call format ["_GAT = %1%2", _id, _i2]

Is what I used (I tried with global variable too) . And I used this to check what it returned:

titletext [ format ["%1 - %2 - %3", _GAT, _id, _i2], "PLAIN"]

_id and _i2 worked as it should, _GAT fucked up. :-\

:beat: *Gets Shot* :beat:

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:String, String! Lalala! E'rybody now sing it!
« Reply #13 on: 15 Nov 2004, 03:02:07 »
I'm still not sure if I even know what you are trying to do.

Quote
I assume that you want _GAT to be assigned the value that is in the variable ind2, for example?

Am I correct here, or are you trying to do something else?
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:String, String! Lalala! E'rybody now sing it!
« Reply #14 on: 15 Nov 2004, 15:10:53 »
I'm not entirley sure what you mean either.

I'll explain further. I'm using the createunit command to create some n00bies. what I want are some variable names for em, which I'm gonna use. So I make some variables up, which really aren't assigned to anything untill later. So the script will be something like:

_GAT = player
call format ["_GAT = %1%2", _id, _i2]

Blah, Blah, Blag

"blah" createUnit [blah-blah,blah,"this=_GAT", blahblah,blah]

:beat: *Gets Shot* :beat: