Jump to content

Some questions


Recommended Posts

Vicolaships

Hi, thanks for answering my questions before.

 

I would like to make some "measure". When the measure is full, jump to a know label and when it's empty, jump to an other. I don't found some opcodes that will help me.

 

I would like to make a plane fly to kown coords. I only founded this opcode :

0724: flying_vehicle $plane follow_and_attack_player $PLAYER_CHAR radius X

It's not a good opcode because I've got to move the player and it's not easy to manage. There are some opcodes to make fly helicopters but I don't think it will work with a plane

04A2: heli $heli fly_to X Y Z speed A B

 

Have a nice day, waiting for answers smile.gif

Link to comment
https://gtaforums.com/topic/276932-some-questions/
Share on other sites

Vicolaships

Thanks for the plane opcode and the answer.

 

What i'm calling "measure" is for example your life.

When you're "empty life" (life = 0) your player will be dead. You 've got a noise "measure" in the mission "Home Invasion", you don't have to make noises, and if you make too much, the old man will wake up.

 

I hope I will be clear, sorry for my English, "measure" should not be the right word notify.gif

Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4217529
Share on other sites

you need that bar, ok. use opcodes to display a bar 03C4 or 04F7, then just change value of variable you assigned in opcodes 03C4 or 04F7 and bar will adjust lenght automatically. mind that:

 

04F7: status_text $BAR type 1 line 1 GXT_reference 'DUMMY'  

 

will display a bar and variable $BAR should be in range 0 (empty) to 100 (full). you can divide it or something to get your range back to 0...100

Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4217853
Share on other sites

  • 1 month later...
Vicolaships

Thanks for the last answer. But I have an other problem, I'm creating a menu. I'm coding with Sanny Builder 2.99e. I made my own code, so it's a bit difficult notify.gif

 

:Menu_ouvrirwait  100if00E1: key pressed 0 11 (yes)jf @Menu_ouvrirwait 1000004: $etat_menu = 0 (open)01B4: set player $PLAYER_CHAR frozen_state 0 (frozen):Menu_param0001: wait  100 ms0581: toggle_radar  0  (off)08D4: create_panel $id_menu title 'TITRE' position  29.0  145.0 width  350.0 columns 2 interactive  1 background  2 align  1 (left align)08DB: set_panel $menu  column  0 header 'DUMMY' data 'RALENT' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'08DB: set_panel $menu1 column  1 header 'DUMMY' data s$etat_ralent 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'09DB: set_panel $menu  column  0 width  25009DB: set_panel $menu1 column  1 width  100wait 100create_thread @Menu_quittecreate_thread @Menu_1:Menu_108D8: $ligne = panel $menu selected rowwait 100if 200E1: key pressed 0 16 (entrer)0038: $ligne == 0 0038: $etat_menu = 0 (open)jf @Menu_1wait 100s$etat_ralent = 'ON'create_thread @Suppr_menuwait 100015D: set gamespeed 0.5jump @Menu1_1:Menu1_108D8: $ligne = panel $menu selected rowwait 100if 200E1: key pressed 0 16 (entrer)0038: $ligne == 00038: $etat_menu = 0 (open)jf @Menu1_1wait 100s$etat_ralent = 'OFF'wait 800015D: set gamespeed 1.0create_thread @Suppr_menujump @Menu_1:Menu_quittewait  100if  000E1: key_pressed 0 14 (sauter)jf @Menu_quittewait  1000004: $etat_menu = 1 (closed):Suppr_menu08DA: remove_panel $menu08DA: remove_panel $menu108DA: remove_panel $id_menu0581: toggle_radar 1 (on)wait 10001B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)jump @Menu_ouvrir

 

 

:Menu_ouvrir > Label to open the menu

:Menu_param > Label to set the parameters of the menu

:Menu_1 > The first time you choose the row 1. Games goes slower and text change to "ON"

:Menu1_1 > The second time you choose the row 1. Games goes normal and text change to "OFF"

:Menu_quitte > Close menu

:Suppr_menu > Delete menu

 

I open my menu (no problem) :IMAGE

I active slowmotion (works) and reopen menu (no problem) :IMAGE

I disactive slowmotion (works) and reopen menu :IMAGE

I try to quit menu :IMAGE

 

 

I need some help, please colgate.gif

Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4295392
Share on other sites

That code has 13 waits. That code only needs four waits. The ones at the start of loops. This code has four create_threads. It needs zero. In fact, at one point, you have

create_thread @Menu_1:Menu_1

So now your code will continue on to Menu_1 and a second thread will be created starting at Menu_1. You also refer to the player a couple times without first checking is player defined.

 

What you should do is go over the basics of coding once again. I don't know what the readme for Sanny Builder looks like, but I know the readme's for Mission Builder have always had so much information that you'll read it five times and still learn something new every time. Also, look in the pinned directory topic and look for the thread by PatrickW on how to properly do menus. You'll notice that there are no create_threads amongst it. Do this, get rid of all the unnecessary waits, and check if player defined before addressing the player. Your code will be shorter, easier to read, and work.

Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4295780
Share on other sites

Vicolaships

Hi, thanks for the help, I made an other code but I don't find the mistake... I helped myslelf to make this with PatrickW's code

 

054C: use_GXT_table 'MENU':Menu_ouvrirwait  100if 100E1: key pressed 0 11 (yes)80DF: not $PLAYER_ACTOR drivingjf @Menu_ouvrir0581: toggle_radar 0 (off)01B4: set player $PLAYER_CHAR frozen state  0 (frozen)08D4: create_panel $mon_menu title 'TITRE' position  29.0  145.0 width  350.0 columns 2 interactive  1 background  2 align  1 (left align)  08DB: set_panel $mon_menu column 0 header 'DUMMY' data 'RALENT' 'WIDESCR' 'MOTO' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'  09DB: set panel $mon_menu column 0 widht 100:Quitterwait 100if00E1: key pressed 0 14 (sauter)jf @Choix    08DA: remove panel $mon_menu03E6: remove text box01B4: set player $PLAYER_CHAR frozen state 1 (unfrozen)jump @Menu_ouvrir         :Choixwait 100if00E1: key pressed 0 16 (sprint)jf @Quitter08DA: remove panel $mon_menu03E6: remove text box01B4: set player $PLAYER_CHAR frozen state 1 (unfrozen)wait 100  Actor.PutAt($PLAYER_ACTOR 0.0 0.0 5.0)

 

 

I can open/close the menu but the game bugs when I press key 0 16 (sprint). Where is the mistake ? For the moment I only want to teleport the Player whatever line is selected.

 

I don't untersdand what is the utility to check if the player is define ? Can you explain it to me I searched in vain...

 

POST EDITED : made a small mistake

Edited by Vicolaships
Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4297406
Share on other sites

This code is better. You still do not need the last wait. Also, you really don't need the wait in Choix either since it's part of a bigger loop which already has a wait. Also, you could still use a local var to address the menu instead of a global.

 

is player defined is opcode 256. Regard original code for its use.

 

Looking at your code, I have no idea why it's not working. Are you holding the key? Because if not, you technically have a wait 200 between checks and it's possible (though not likely) that you are just missing them.

Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4297620
Share on other sites

Vicolaships

Hum, thanks a lot for the answer !

Are you holding the key? Because if not, you technically have a wait 200 between checks and it's possible (though not likely) that you are just missing them.

I remplaced the wait by WAIT 10. I press SRPINT and the game bug, same when I hold SRPINT... I really don't understand where is the mistake ?! nervous.gif I used a local variable 1@ and the games bugs too

Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4297667
Share on other sites

Well I must confess that not having is player defined has never lead to a script bugging (that I know of). However, for as long as that check is not in your code, we can't be sure that it's not the culprit. Make sure player is defined before addressing player and see if that changes anything. Also, share with us if you are trying this in a stripped SCM. It would help rule out the possibility that something ELSE is causing the issue.

 

[EDIT]

I'm terribly sorry. I meant to mention the following in my last post! blush.gif At the end of your code, you've got no command telling it to jump back to the beginning. So THIS thread will begin to execute whatever code is below it after you press Sprint. If you don't have any code below it, THAT is why you are crashing. If you do, then it's going to be because the same code will now be being executed by two different threads, creating a conflict. My guess is that you're working in a stripped SCM, that is the end of your code, and it is crashing because it runs out of code. Put a jump back at the end and I bet it all clears up. You should still use if player defined's when appropriate though as a matter of good practice.

Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4297746
Share on other sites

  • 1 month later...
Vicolaships

Hi all, i made a gas mode with a plane and when the tank is empty the plane can't accelerate (but still move...)

I founded only this opcode to disactivate a key but it only disactvate the ENTER/EXIT key :

 

07CC: toggle_player $PLAYER_CHAR button_15 1

 

 

Is there opcode to disable any key ? Or an other way to prevent from accelerate ?

 

Bye, colgate.gif

Link to comment
https://gtaforums.com/topic/276932-some-questions/#findComment-4448418
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.