BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup

Join the forum, it's quick and easy

BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks
Would you like to react to this message? Create an account in a few clicks or log in to continue.
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Latest topics
» Dropped Out of College to Pursue Web Dev and Life Pursuits in General
Execute String Value (VSTR) Empty4/7/2024, 2:34 pm by SnB@BWH

» Bully Made It Into a BIG Video 400K Views
Execute String Value (VSTR) Empty4/7/2024, 6:58 am by Bully@WiiPlaza

» Wii Play Tanks
Execute String Value (VSTR) Empty3/24/2024, 2:46 pm by helpmeout

» [Bypass Paywalls] (Global) @magnolia1234 - GitLab
Execute String Value (VSTR) Empty3/18/2024, 3:55 am by Seth@WiiPlaza

» [Download] Mary Shelley's Frankenhole
Execute String Value (VSTR) Empty3/16/2024, 8:29 am by Seth@WiiPlaza

» Completely Custom Modded Controllers (Undetectable)
Execute String Value (VSTR) Empty3/5/2024, 1:55 pm by Shadow@BWH

» (Zombies) Drink perks code?
Execute String Value (VSTR) Empty3/5/2024, 1:24 pm by Shadow@BWH

» Die Rückkehr zu STEAM und WARFACE
Execute String Value (VSTR) Empty3/2/2024, 3:54 am by Seth@WiiPlaza

» First person hand model change?
Execute String Value (VSTR) Empty2/28/2024, 4:53 am by Ad3lamac611

» {RELEASE} Field Raider Firefox v1.72 by Seth@WiiPlaza
Execute String Value (VSTR) Empty2/21/2024, 8:52 am by naxil

Search
 
 

Display results as :
 


Rechercher Advanced Search

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Country Statistics
Free counters!

You are not connected. Please login or register

Execute String Value (VSTR)

Go down  Message [Page 1 of 1]

1Execute String Value (VSTR) Empty Execute String Value (VSTR) 10/30/2014, 11:01 am

Bully@WiiPlaza

Bully@WiiPlaza
 
 

The
Code:
vstr
command executes the String value of a dvar as a command. If the dvar already exists, its value will be overwritten otherwise a new dvar will be created.

Code:
twistbind WII_C "vstr toggleInfiniteAmmo"
set toggleInfiniteAmmo "toggle player_sustainammo"

This twistbinds the Nunchuk Nunchuk C button to executing the String value of "toggleInfiniteAmmo" which is "toggle player_sustainammo".

Note that the following does the same thing:

Code:
twistbind WII_C "toggle player_sustainammo"

So why do we even need vstr?
It can be used to store and reuse certain commands or for toggling controls.

A "complex" example:
Code:
twistbind WII_A "vstr aButton"
twistbind WII_MINUS "vstr minusButton"
twistbind WII_PLUS "vstr toggleControls"

set aButton "noclip"
set minusButton "god"

set toggleControls "vstr controlsTwo"
set controlsTwo "set aButton notarget;set minusButton toggle timescale 1 2 0.2;set toggleControls vstr controlsOne"
set controlsOne "set aButton noclip;set minusButton god;set toggleControls vstr controlsTwo"

By default, twisting the Wii Remote and pressing Wii Remote A toggles noclip. Twisting and pressing Wii Remote MINUS toggles god mode. Why? The new dvars aButton and minusButton are set to the "noclip" and "god" commands.

What happens though if we twist the Wii Remote and press Wii Remote PLUS? The value of "toggleControls" is executed. That again executes "controlsTwo" which sets the "aButton" dvar to "notarget", "minusButton" dvar to "toggle timescale 1 2 0.2" and  the "toggleControls" dvar to execute "controlsOne".

Now if we twist the Wii Remote again and press Wii Remote A  it will toggle notarget. Wii Remote MINUS will toggle the game speed through 3 different values.

When we twist the Wii Remote and press Wii Remote PLUS  a 2nd time it will now execute the value of "controlsOne" which is sets the "aButton", "minusButton" and "toggleControls" dvar to their original values again.

Therefore, what this construct using vstr allowed us to do was making toggleable controls instead of being fixed to a certain command or sequence of commands. Cool

I hope you learned something. Post if you have any questions about this.

Sources:
http://www.cfgmodding.com/tutorials/introtovstr.php
http://www.cfgmodding.com/tutorials/advancedvstr.php



Last edited by Bully@WiiPlaza on 10/31/2014, 12:27 am; edited 1 time in total


_________________
Execute String Value (VSTR) YBjg74I

2Execute String Value (VSTR) Empty Re: Execute String Value (VSTR) 10/31/2014, 12:26 am

Bully@WiiPlaza

Bully@WiiPlaza
 
 

Bump, tutorial now written


_________________
Execute String Value (VSTR) YBjg74I

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum