Get Object Name?

Discuss thaw modding, post your own, share your ideas, ask questions.
sMo0g™
Posts: 108
Joined: Fri Nov 20, 2009 1:20 pm
Location: Ukraine
Contact:

Get Object Name?

Postby sMo0g™ » Fri Dec 09, 2011 7:50 pm

Well, i have an idea.
It is possible to get model name(id) with some params?
Something like:

Code: Select all

:i call $GetName$ arguments
         $RGB_Color$ = *here vector of rgb*

Than just something like

Code: Select all

:i call $SendChatMessage$ arguments
         $string$ = %GLOBAL%$Name$

? It's possible? Or something like that?
Lezzer
Posts: 48
Joined: Tue Jan 04, 2011 10:50 am
Contact:

Re: Get Object Name?

Postby Lezzer » Sat Dec 10, 2011 11:22 am

This is hard.
Good idea sMoOg.
Maybe spawn new prefs in qb and set model names?
sMo0g™
Posts: 108
Joined: Fri Nov 20, 2009 1:20 pm
Location: Ukraine
Contact:

Re: Get Object Name?

Postby sMo0g™ » Sat Dec 10, 2011 2:22 pm

I just want to now, possible it or no.
And is exist cmnd like "GetName"...
Anteara
Posts: 268
Joined: Thu Oct 14, 2010 2:55 am
Contact:

Re: Get Object Name?

Postby Anteara » Sun Dec 11, 2011 3:33 am

Go to this thread.
http://thps-mods.com/forum/viewtopic.php?f=22&t=806

Read ''Accessing Array data, (Structure index's):''.
This shows you how to do what you want to do...

you could create the function $GetName$ which would do what it says in the topic i linked above, and you could make the argument the array name and index.
sMo0g™
Posts: 108
Joined: Fri Nov 20, 2009 1:20 pm
Location: Ukraine
Contact:

Re: Get Object Name?

Postby sMo0g™ » Sun Dec 11, 2011 12:41 pm

Ah, rly. Thanks. I'll try.
sMo0g™
Posts: 108
Joined: Fri Nov 20, 2009 1:20 pm
Location: Ukraine
Contact:

Re: Get Object Name?

Postby sMo0g™ » Tue Dec 13, 2011 8:57 pm

Oh :D Someone know script like "SetCustomRestart" ?
Just when you Set Restart, all things restarting too. Skater, special, score, camera. I just need alternative script WITHOUT setting restart.
Anteara
Posts: 268
Joined: Thu Oct 14, 2010 2:55 am
Contact:

Re: Get Object Name?

Postby Anteara » Tue Dec 13, 2011 10:02 pm

You could have figured this out if you tried...

Code: Select all

:i call $MakeSkaterGoto$ arguments
      $SkaterInit$
sMo0g™
Posts: 108
Joined: Fri Nov 20, 2009 1:20 pm
Location: Ukraine
Contact:

Re: Get Object Name?

Postby sMo0g™ » Tue Dec 13, 2011 10:13 pm

Sorry, i just didn't knew functions like that, and didn't search it :D
sMo0g™
Posts: 108
Joined: Fri Nov 20, 2009 1:20 pm
Location: Ukraine
Contact:

Re: Get Object Name?

Postby sMo0g™ » Tue Jan 24, 2012 8:12 pm

Ohh. I have one more question please :/
I can do FormatText with name and then i can paste that text into name in mmm... for example spawn models.
Like this:

Code: Select all

:i $NameInteger$ = %i(0,000000000)
:i call $FormatText$ arguments
        $TextName$ = $ModelName$%s(0,"model_%n")$n$ = %GLOBAL%$NameInteger$
*** CREATECOMPOSITEOBJECT ETC, NAME = %GLOBAL%$ModelName$

#########

Now i "created" model with name model_0. I can use :i %GLOBAL%$ModelName$.$Something$.... ($ModelName$ = $model_0$)

#########

But, if i'll do few integers in QB and call it as "Int1, Int2, Int3"...

Then i'll do
:i call $FormatText$ arguments
        $TextName$ = $MyInteger$%s(0,"Int%n")$n$ = $CurrentEditingInteger$ #/ $CurrentEditingInteger$ it's just some integer that i using for myself... with numbers 1,2,3...
i can't change %GLOBAL%'s as
:i call $Change$ arguments
        %GLOBAL%$MyInteger$ = %i(3487,00000000)
... This is doesn't work.

I need to change Int1 or Int2 etc depending on the number of CurrentEditingInteger..
With if's for me too long.

!#!#!#! This "scripts" only just for example :D For real i need it really #!#!#!#!

The specific question is: How to use $change$ with %GLOBAL% :DD
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: Get Object Name?

Postby WhoElseButMe » Tue Jan 24, 2012 8:51 pm

I don't fully understand your question or what you're trying to accomplish so its hard to come up with a working example.
I believe your best bet here is to use a while loop, looping the number of nameintegers, creating a string copy of the formatted text each iteration to allow you to append to the text .
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
sMo0g™
Posts: 108
Joined: Fri Nov 20, 2009 1:20 pm
Location: Ukraine
Contact:

Re: Get Object Name?

Postby sMo0g™ » Sat Jan 28, 2012 8:17 pm

Ehh
I mean:
If i'll do format text like this:

Code: Select all

:i $number_for_integer_name$ = %i(1,00000001)
:i call $formattext$ arguments
        $TextName$ = $lolname$%s(0,"int_%n")$n$ = %GLOBAL%$number_for_integer_name$

%GLOBAL%$lolname$ will be = int_1.
Then i can do anything with %GLOBAL%$lolname$.. and it is will be mean that i doing something with int_1...
BUT i can't change it. As

Code: Select all

:i call $change$ arguments
       %GLOBAL%$lolname$ = %i(2,00000002)

becausee... i don't know.. Maybe $change$ can't use just with %GLOBAL%. So can i do change something with global in $change$ :D
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: Get Object Name?

Postby WhoElseButMe » Sat Jan 28, 2012 9:50 pm

lolname is a string NOT an integer value so doing

Code: Select all

:i call $change$ arguments
       %GLOBAL%$lolname$ = %i(2,00000002)

Will not change anything.

Your best bet would simply be to setup an integer item outside of a script, we'll say lolname,
then instead of formatting text you perform the change argument to set its value.
That is if you're after changing the value only. You're still not clear on what you're trying to achieve and in most cases a string is not the answer.
You could, however, format a checksum, but keep in mind to change the value you would still need to reformat the checksum.

Code: Select all

:i call $formattext$ arguments
   $checksumname$ = $lolname$%s(6,"int_%n")$n$ = %GLOBAL%$number_for_integer_name$

Then say lolname was to be the name of a script to call you could do

Code: Select all

:i if $ScriptExists$%GLOBAL%$lolname$
   :i %GLOBAL%$lolname$
:i endif
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
sMo0g™
Posts: 108
Joined: Fri Nov 20, 2009 1:20 pm
Location: Ukraine
Contact:

Re: Get Object Name?

Postby sMo0g™ » Sun Jan 29, 2012 1:14 am

Mhhh dude ._.
I don't really understood you :<
And i don't need to change only the value.. Maybe i want to make a string or array. Then doing something in $change$ with it..

Could you show me the full script of that? My english is not very well to fully understand you.
It's for thaw. So, integer is automatically was setup in queen bee(outside of a script).

How can i perform the change argument to set its value? xD

Look, for what integer with name lolname outside of a script? I want to change int_1(if some integer is 1) int_1 can be string. Whatever is this, i just want to change with $change$ xD
Anteara
Posts: 268
Joined: Thu Oct 14, 2010 2:55 am
Contact:

Re: Get Object Name?

Postby Anteara » Sun Jan 29, 2012 4:24 am

:i $number_for_integer_name$ = %i(1,00000001)
:i call $formattext$ arguments
$TextName$ = $lolname$%s(0,"int_%n")$n$ = %GLOBAL%$number_for_integer_name$


$lolname$ is a string as shown by %s. %s stands for string.
$number_for_integer_name$ is an int, as shown by %i.

this means that if you try to do this:

:i call $change$ arguments
%GLOBAL%$lolname$ = %i(2,00000002)


it won't work because you're trying to change a string value with an int value.
as whoelsebutme said, you can convert it to a checksum, and then change the checksum and have the checksum checked.
You can find out how to do this here: http://thps-mods.com/forum/viewtopic.php?f=22&t=657 - look for the checksum parts.
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: Get Object Name?

Postby WhoElseButMe » Sun Jan 29, 2012 8:54 am

If you're trying to use the text name for use as an object name, unfortunately you're going to have to reformat your string every time you want to change its name.

Example:
outside of a script

Code: Select all

SectionIntegerItem | QbKey: SomeIntegerFu | Value: 2 |
SectingStringA | QbKey: SomeStringBar | Value:

Inside a script function

Code: Select all

#/ Formats a string appending an integer to the string
:i call $formattext$ arguments
     $TextName$ = $mystring$%s(6,"int_%n")$n$ = $SomeIntegerFu$

#/ Sets our string value for SomeStringBar to the string we just created
#/ After this call, SomeStringBar = %s(5,"int_2")
:i call $Change$ arguments
     $SomeStringBar$ = %GLOBAL%$mystring$

#/ Sets our integer value for SomeIntegerFu to be plus 1
#/ After this call, SomeIntegerFu = %i(3,00000003)
:i call $Change$ arguments
     $SomeIntegerFu$ = ($SomeIntegerFu$ + %i(1,00000001))

#/ Format a string to change SomeStringBar to reflect SomeIntegerFu's value increase
:i call $formattext$ arguments
     $TextName$ = $mystring$%s(6,"int_%n")$n$ = $SomeIntegerFu$

#/ Sets our string value for SomeStringBar to the string we just created
#/ After this call, SomeStringBar = %s(5,"int_3")
:i call $Change$ arguments
     $SomeStringBar$ = %GLOBAL%$mystring$
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.

Return to “THAW modding”

Who is online

Users browsing this forum: No registered users and 22 guests