Quantcast

Jump to content

» «
Photo

Peds thread

44 replies to this topic
random_download
  • random_download

    :o

  • Members
  • Joined: 07 Mar 2004

#31

Posted 05 June 2005 - 01:16 PM

Whoa didn't realise that this topic had changed until now.
Yes, you can use F1, F2 etc. and also combinations eg. Shift + Ctrl + F1 or whatever. Once you have the scm that you are going to use to film, compile it and send it me along with the source and I should be able to find the variables used for the actors. UIf you change the scm after this, it is possible that the vars will change around, and so will need to be updated the hotkey dll.

ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • None

#32

Posted 06 June 2005 - 05:46 AM Edited by ceedj, 06 June 2005 - 06:13 AM.

QUOTE (random_download @ Jun 5 2005, 13:16)
Whoa didn't realise that this topic had changed until now.
Yes, you can use F1, F2 etc. and also combinations eg. Shift + Ctrl + F1 or whatever. Once you have the scm that you are going to use to film, compile it and send it me along with the source and I should be able to find the variables used for the actors. UIf you change the scm after this, it is possible that the vars will change around, and so will need to be updated the hotkey dll.

The actors are easy; I already have them defined:

1 Actor Animation Keys (A-Z, others) ($Grp1Ped1)

2 Actors
Two Peds
Ped 1 = SHIFT + Animation Key ($Grp2Ped1)
Ped 2 = CTRL LF + Animation Key($Grp2Ped2)

Three Peds
Ped 1 = ATL LF + Animation Key($Grp3Ped1)
Ped 2 = ALT RT + Animation Key($Grp3Ped2)
Ped 3 = CTRL RT + Animation Key($Grp3Ped3)

Four Peds (F keys, ect, need to find out which ones are NOT modifiable in-game)
($Grp4Ped1)
($Grp4Ped2)
($Grp4Ped3)
($Grp4Ped4)

What I need to know is if you can do this: (This is only an example; the keys will be changed when I am finished)

K (Set ped run away) =
009C: set_actor $Grp1Ped1 wander_path_to 0
0319: actor $Grp1Ped1 wander_state_to 1


L (Set ped stop) =
001C: actor $Grp1Ped1 clear_objective
020F: actor $Grp1Ped1 look_at_player $PLAYER_CHAR
(other actor, if I feel the need - not sure yet)

This will give your peds a walk/run setup, useful for getting them from one place to another. Most of the other animations will be one line wait states, but I thought this would be nice for putting a little "action" into a shot.

(BTW, I've often seen this: 0319: actor $Grp1Ped wander_state_to 1 (off), but I found out that 0 is walk and 1 is run. Nice for me, anyway, having two codes in one. biggrin.gif )

A couple of more general questions (after much friutless searching) :

As seen above, 009C sets the path. Does anyone have any idea where these paths are called from? -1 and 1 seem be the same; walk/run after turning. 0 sometimes makes the ped walk in the direction he/she is facing. Is anyone aware of a way to get the actor to ALWAYS walk without turning first?

I almost had all the ped skins AND actor skins available, but ran into the 800lb gorilla known as default.ide. My research tells me that the game only looks for objs 0-299 in default.ide. Is there anyway to get past this limitaion? I can add three additional peds (Sonny, or Lance, or whoever) at the bottom (using ID 9001, 9002, 9003) and they will show up, but as soon as I add another one (9004), the game stalls at the loading progress bar. I also tried playing with Steve-M's VCLimitAdjust, but no love there. Am I stuck with this? Not a huge deal though...

Weather control and clock-lock are finished though (and are AWESOME!) Should hopefully help me avoid things like that awful lighting shift in the middle of Take3 of my trailer. blink.gif

EDIT: DISTRIBUTION QUESTION

If other people want to use this, they need to set up their keys to match mine, all in the top row numbers. I do this so that you NEVER press a number to call an amination key. This also helps in moving the player around, (arrow keys stay the same, but action, sprint, etc use 1-9) since if you press an animation key without a ped created, the game will crash to the desktop. I'm not worried so much about that; it's in real big letters in the Read Me. If you're dumb enough to spawn an animation for an actor that doesn't exsist, you deserve to be dumped to your desktop. biggrin.gif I also have a custom setup for the CamHack, using only the number keys.

Anyway, the problem is this: remapping the player control keys in Vice is a royal pain in the ass. Would it be advisable to advise people to back up their gtavc.set file and give them mine with the mod? Does this even work?

random_download
  • random_download

    :o

  • Members
  • Joined: 07 Mar 2004

#33

Posted 06 June 2005 - 03:58 PM

Yes, the gtavc.set file contains all your controls etc.
To make a ped walk forward without turning you could try:
CODE
04C4: create_coordinate 0@ 1@ 2@ from_actor $actor offset  0.0  5.0  0.0
0211: walk_actor $actor to_point @0 @1

Running that in a loop should work.
Yeah, I can execute those lines (009C: set_actor $Grp1Ped1 wander_path_to 0) etc.
For the vvars I will need to read it from a compiled scm, it should look like this in a hex editor:
CODE
009C: set_actor $Grp1Ped1 wander_path_to 0
9C 00 02 <var> 04 00

And I will need to know what <var> is (which should be 2 bytes long btw).
Yeah, so if you can e-mail, or send over msn or whatever the compiled scm that you are using and the source so I can find where I am in it, then I can give you the keypress tool.

ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • None

#34

Posted 06 June 2005 - 05:53 PM Edited by ceedj, 06 June 2005 - 06:31 PM.

QUOTE (random_download @ Jun 6 2005, 15:58)
And I will need to know what <var> is (which should be 2 bytes long btw).

ACK! How do I figure that out? Or will the compiler do that for me?

These are the ONLY vars that the keymapper will need. Everything else is controlled by the main.scm and combo presses on the player keys. The scm is actually done; here it is: (zip file below code)

CODE

Toss this in your "Create Threads" section:

; ViceStudioThreads
004F: create_thread ££Create1PedWait
004F: create_thread ££SetWeather
004F: create_thread ££FreezeOn

Toss this after all the labels but before "Mission 0"

:FreezeOn
0001: wait 250 ms
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 8
004D: jump_if_false ££FreezeOn
00BF: 1@ = current_time_hours, 2@ = current_time_minutes

:FreezeOff
0001: wait 900 ms
00C0: set_current_time 1@ 2@
01B5: force_weather $WeatherSelect
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 9
004D: jump_if_false ££FreezeOff
0002: jump ££FreezeOn

:SetWeather
0001: wait 0 ms
0004: $WeatherSelect = 0

:SetWeatherWait
0001: wait 0 ms
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 13
004D: jump_if_false ££SetWeatherWait
0001: wsit 250 ms
0008: $WeatherSelect += 1
00D6: if 0
0038: $WeatherSelect == 6
004D: jump_if_false ££ChooseWeather
0038: $WeatherSelect == 0

:ChooseWeather
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false ££ChooseWeather
0169: set_fade_color 5 5 5
016A: fade 0 () 500 ms
0001: wait 1500 ms
01B6: set_weather $WeatherSelect
016A: fade 1 (back) 500 ms
0002: jump ££SetWeatherWait

:Create1PedWait
0001: wait 0 ms
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 16
004D: jump_if_false ££Delete1PedWait
0050: gosub ££Old1PedCleanup
0050: gosub ££Pick1Ped

:Delete1PedWait
00D6: if 1
00E1: key_pressed 0 5
00E1: key_pressed 0 16
004D: jump_if_false ££Create2PedsWait
0050: gosub ££Old1PedCleanup

:Create2PedsWait
0001: wait 0 ms
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 19
004D: jump_if_false ££Delete2PedsWait
0050: gosub ££Old2PedsCleanup
0050: gosub ££Pick2Peds

:Delete2PedsWait
00D6: if 1
00E1: key_pressed 0 5
00E1: key_pressed 0 19
004D: jump_if_false ££Create3PedsWait
0050: gosub ££Old2PedsCleanup

:Create3PedsWait
0001: wait 0 ms
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 15
004D: jump_if_false ££Delete3PedsWait
0050: gosub ££Old3PedsCleanup
0050: gosub ££Pick3Peds

:Delete3PedsWait
00D6: if 1
00E1: key_pressed 0 5
00E1: key_pressed 0 15
004D: jump_if_false ££Create4PedsWait
0050: gosub ££Old3PedsCleanup

:Create4PedsWait
0001: wait 0 ms
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 6
004D: jump_if_false ££Delete4PedsWait
0050: gosub ££Old4PedsCleanup
0050: gosub ££Pick4Peds

:Delete4PedsWait
00D6: if 1
00E1: key_pressed 0 5
00E1: key_pressed 0 6
004D: jump_if_false ££CreateCarWait
0050: gosub ££Old4PedsCleanup

:CreateCarWait
0001: wait 0 ms
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 18
004D: jump_if_false ££DeleteCarWait
0050: gosub ££OldCarCleanup
0050: gosub ££PickCar

:DeleteCarWait
00D6: if 1
00E1: key_pressed 0 5
00E1: key_pressed 0 18
004D: jump_if_false ££CreateCar2Wait
0050: gosub ££OldCarCleanup

:CreateCar2Wait
0001: wait 0 ms
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 17
004D: jump_if_false ££DeleteCar2Wait
0050: gosub ££OldCar2Cleanup
0001: wait 0 ms
0050: gosub ££PickCar2

:DeleteCar2Wait
00D6: if 1
00E1: key_pressed 0 5
00E1: key_pressed 0 17
004D: jump_if_false ££ChangeSkinWait
0050: gosub ££OldCar2Cleanup

:ChangeSkinWait
00D6: if 1
00E1: key_pressed 0 7
00E1: key_pressed 0 14
004D: jump_if_false ££KillAllWait
0050: gosub ££PickSkin

:KillAllWait
0001: wait 0 ms
00D6: if 1
00E1: key_pressed 0 5
00E1: key_pressed 0 4
004D: jump_if_false ££Create1PedWait
0050: gosub ££KillAllCleanup
0002: jump ££Create1PedWait

:Old1PedCleanup
034F: destroy_actor_with_fade $Grp1Ped1
0051: return

:Old2PedsCleanup
034F: destroy_actor_with_fade $Grp2Ped1
034F: destroy_actor_with_fade $Grp2Ped2
0051: return

:Old3PedsCleanup
034F: destroy_actor_with_fade $Grp3Ped1
034F: destroy_actor_with_fade $Grp3Ped2
034F: destroy_actor_with_fade $Grp3Ped3
0051: return

:Old4PedsCleanup
034F: destroy_actor_with_fade $Grp4Ped1
034F: destroy_actor_with_fade $Grp4Ped2
034F: destroy_actor_with_fade $Grp4Ped3
034F: destroy_actor_with_fade $Grp4Ped4
0051: return

:OldCarCleanup
00A6: destroy_car 4@
0051: return

:OldCar2Cleanup
00A6: destroy_car 5@
0051: return

:KillAllCleanup
034F: destroy_actor_with_fade $Grp1Ped1
034F: destroy_actor_with_fade $Grp2Ped1
034F: destroy_actor_with_fade $Grp2Ped2
034F: destroy_actor_with_fade $Grp3Ped1
034F: destroy_actor_with_fade $Grp3Ped2
034F: destroy_actor_with_fade $Grp3Ped3
034F: destroy_actor_with_fade $Grp4Ped1
034F: destroy_actor_with_fade $Grp4Ped2
034F: destroy_actor_with_fade $Grp4Ped3
034F: destroy_actor_with_fade $Grp4Ped4
00A6: destroy_car 4@
00A6: destroy_car 5@
0051: return

:Pick1Ped
0001: wait 250 ms
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp1Ped1 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp1Ped1 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0051: return

:Pick2Peds
0001: wait 250 ms
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp2Ped1 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp2Ped1 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp2Ped2 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp2Ped2 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0051: return

:Pick3Peds
0001: wait 250 ms
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp3Ped1 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp3Ped1 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp3Ped2 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp3Ped2 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp3Ped3 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp3Ped3 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0051: return

:Pick4Peds
0001: wait 250 ms
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp4Ped1 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp4Ped1 look_at_player $PLAYER_CHAR
0001: wait 0 ms
0249: release_model $PedSelect
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp4Ped2 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp4Ped2 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp4Ped3 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp4Ped3 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0050: gosub ££ThePeds
0050: gosub ££CreateCoordPed
009A: $Grp4Ped4 = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Grp4Ped4 look_at_player $PLAYER_CHAR
0249: release_model $PedSelect
0051: return

:PickCar
0050: gosub ££TheCars
0050: gosub ££CreateCoordCar
00A5:  4@ = create_car $CarSelect at  1@  2@  3@
0175: set_car  4@ z_angle_to 315
0249: release_model $CarSelect
01C3: remove_references_to_car  4@;; Like turning a car into any random car
0001: wait  400 ms
0051: return  

:PickCar2
0050: gosub ££TheCars
0050: gosub ££CreateCoordCar
00A5:  5@ = create_car $CarSelect at  1@  2@  3@
0175: set_car  5@ z_angle_to 315
0249: release_model $CarSelect
01C3: remove_references_to_car  5@;; Like turning a car into any random car
0001: wait  400 ms
0051: return

:PickSkin
0001: wait 250 ms

:SkinCheck
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false ££SkinCheck
0169: set_fade_color 5 5 5
016A: fade 0 () 500 ms
0001: wait 500 ms
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1 (true)
01B4: set_player $PLAYER_CHAR frozen_state 0 (frozen)
0352: set_actor $PLAYER_ACTOR skin_to "1@"
038B: load_requested_models
0353: refresh_actor $PLAYER_ACTOR
016A: fade 1 (back) 500 ms
0001: wait 500 ms
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0 (false)
01B4: set_player $PLAYER_CHAR frozen_state 1 (unfrozen)
0249: release_model $PedSelect
0051: return

:ThePeds
0004: $PedSelect = 1
0002: jump ££ShowPed

:PedSelectForward
0001: wait 0 ms
00D6: if 0
00E1: key_pressed 0 5
004D: jump_if_false ££PedSelectBack
0002: jump ££NSevenCheck

:PedSelectBack
0001: wait 0 ms
00D6: if 0
00E1: key_pressed 0 7
004D: jump_if_false ££PedSelect
0002: jump ££PSevenCheck

:PedSelect
0001: wait 0 ms
00D6: if 0
00E1: key_pressed 0 4
004D: jump_if_false ££PedSelectForward
009b: destroy_actor $Tmp1Ped
0051: return

:NSevenCheck
00D6: if 0
0038: $PedSelect == 6
004D: jump_if_false ££NPed
0008: $PedSelect += 2
0002: jump ££ShowPed

:NPed
0008: $PedSelect += 1
00D6: if 0
0038: $PedSelect == 107
004D: jump_if_false ££ShowPed
0004: $PedSelect = 1
0002: jump ££ShowPed

:PSevenCheck
00D6: if 0
0038: $PedSelect == 9
004D: jump_if_false ££PPed
000C: $PedSelect -= 2
0002: jump ££ShowPed

:PPed
000C: $PedSelect -= 1
00D6: if 0
0038: $PedSelect == 0
004D: jump_if_false ££ShowPed
0004: $PedSelect = 106

:ShowPed
0001: wait 250 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false ££ShowPed
04C4: create_coordinate $Fish $Sock $CatFood from_actor $PLAYER_ACTOR offset 0.0 1.5 0.0
0247: request_model $PedSelect
038B: load_requested_models

:ShowPed2
00D6: if 0
0248: model  $PedSelect available
004D: jump_if_false ££ShowPed2
009b: destroy_actor $Tmp1Ped
009A: $Tmp1Ped = create_actor 4 $PedSelect at $Fish $Sock $CatFood
020F: set_actor $Tmp1Ped look_at_player $PLAYER_CHAR
0001: wait 250 ms
0249: release_model $PedSelect
0002: jump ££PedSelectForward

:CreateCoordPed
0001: wait 250 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false ££CreateCoordPed
04C4: create_coordinate $Fish $Sock $CatFood from_actor $PLAYER_ACTOR offset 0.0 1.5 0.0
0247: request_model $PedSelect
038B: load_requested_models

:CreatePed
00D6: if 0
0248: model  $PedSelect available
004D: jump_if_false ££CreatePed
0051: return

:TheCars
0004: $CarSelect = 130
0002: jump ££ShakeItUp

:CarSelectForward
0001: wait 0 ms
00D6: if 0
00E1: key_pressed 0 5
004D: jump_if_false ££CarSelectBack
0002: jump ££N180Check

:CarSelectBack
0001: wait 0 ms
00D6: if 0
00E1: key_pressed 0 7
004D: jump_if_false ££CarSelect
0002: jump ££P180Check

:CarSelect
0001: wait 0 ms
00D6: if 0
00E1: key_pressed 0 4
004D: jump_if_false ££CarSelectForward
00A6: destroy_car 4@
0051: return

:N180Check
00D6: if 0
0038: $CarSelect == 179
004D: jump_if_false ££NCar
0008: $CarSelect += 5

:NCar
0008: $CarSelect += 1
00D6: if 0
0038: $CarSelect == 237
004D: jump_if_false ££ShakeItUp
0004: $CarSelect = 130
0002: jump ££ShakeItUp

:P180Check
00D6: if 0
0038: $CarSelect == 185
004D: jump_if_false ££PCar
000C: $CarSelect -= 5

:PCar
000C: $CarSelect -= 1
00D6: if 0
0038: $CarSelect == 129
004D: jump_if_false ££ShakeItUp
0004: $CarSelect = 236

:ShakeItUp
0001: wait  250 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false ££ShakeItUp
00D6: if  0
80E0:   NOT   player $PLAYER_CHAR driving
004D: jump_if_false ££ShakeItUp
0172:  0@ = actor $PLAYER_ACTOR z_angle
04C4: create_coordinate  1@  2@  3@ from_actor $PLAYER_ACTOR offset  0.0  4.0  0.0
0247: request_model $CarSelect
038B: load_requested_models

:JustWhatINeeded
0001: wait  250 ms
00D6: if  0
0248:   model $CarSelect available
004D: jump_if_false ££JustWhatINeeded
00A6: destroy_car 4@
00A5:  4@ = create_car $CarSelect at  1@  2@  3@
0175: set_car  4@ z_angle_to 315
0249: release_model $CarSelect
01C3: remove_references_to_car  4@;; Like turning a car into any random car
0001: wait  400 ms
0002: jump ££CarSelectForward

:CreateCoordCar
0001: wait  250 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false ££CreateCoordCar              
00D6: if  0
80E0:   NOT   player $PLAYER_CHAR driving
004D: jump_if_false ££CreateCoordCar
0172:  0@ = actor $PLAYER_ACTOR z_angle
04C4: create_coordinate  1@  2@  3@ from_actor $PLAYER_ACTOR offset  0.0  4.0  0.0
0247: request_model $CarSelect
038B: load_requested_models

:CreateCar
00D6: if 0
0248: model  $CarSelect available
004D: jump_if_false ££CreateCar
0051: return


Also, here is the main.scm file and the gtavs.set file:

http://www.cj-ambros...eStudios0_4.zip

Not totally sure (my notebook is at home) but I think the keys are like this:

Insert=PreWeap
Delete=Next Weap
Enter=Action
Spint=1
Look Behind=2
Enter/Exit=3
Aim/Target=4
Crouch=5
Fire=6
Jump=7
Camera=0
----------------------------------------------------------
UNUSED: (but have to be defined anyway)
PreTarget=8 (not used)
NexTarget=9 (not used)
Zoom In = +
Zoom Out = -
Look Left = PgUp
Look Right = PgDn
Look Up = Home
Look Down = End
Center Camera = ~ (although Enter (Action) seems to do this as well)
-----------------------------------------------------------

Arrow keys move player around. Use INSERT + 1 -4 to generate peds, +5, +6 for cars, +7 Change Player Skin
+ 0 to change weather (repress to cycle). Press INSERT + UP ARROW to freeze the game clock; press INSERT + DOWN ARROW to unfreeze. When choosing peds/cars, use INSERT to browse previous, DELETE to browse forward and ENTER to choose.

The peds don't DO anything yet, but this is the basic framework. Please let me know if there are any problems. I'll be finishing up the animation setting tonight, but all I know is Barton's VB syntax, so I hope that's ok.

Thanks again!

EDIT: Removed a gosub from :PickSkin, since I haven't quite decided if I'm going to keep this or not...

random_download
  • random_download

    :o

  • Members
  • Joined: 07 Mar 2004

#35

Posted 06 June 2005 - 06:36 PM

OK, that is enough information, I now have the hex data for these vars:
$Grp1Ped1, $Grp2Ped1, $Grp2Ped2, $Grp3Ped1, $Grp3Ped2, $Grp3Ped3, $Grp4Ped1, $Grp4Ped2, $Grp4Ped3, $Grp4Ped4
Now, what code do you want to happen, and on what keypresses?

ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • None

#36

Posted 06 June 2005 - 06:56 PM

QUOTE (random_download @ Jun 6 2005, 18:36)
OK, that is enough information, I now have the hex data for these vars:
$Grp1Ped1, $Grp2Ped1, $Grp2Ped2, $Grp3Ped1, $Grp3Ped2, $Grp3Ped3, $Grp4Ped1, $Grp4Ped2, $Grp4Ped3, $Grp4Ped4
Now, what code do you want to happen, and on what keypresses?

See, I knew THAT part would be easy. tounge.gif

I'm finishing up the aminations tonight (still have a few I want to check first)

Again, A-Z and some others will be $Grp1Ped1

SHIFT A-Z and some others will be $Grp2Ped1,
CTRL LF A-Z and some others will be $Grp2Ped2, etc.

There's only one MAJOR set of animations (I think it's around 30 something - a group of four peds will have much less), but they all have to be copied to the extended keys. 5 Times. So that this:

A = 0000: animation $Grp1Ped1 wait state 30 2000 ms

Has to work as well as this:

SHIFT A = 0000: animation $Grp2Ped1 wait state 30 2000 ms

This way, the same animation is used, but different key presses will assign the animation to different peds. (I'm sorry if I'm painfully restating the obvious - but it's for my own benefit as well, since I have to juggle three differnent key setups (player, camera, animations), and I want to make sure I've covered all the bases.)

Anyway, I'm sure you get that part now - if it's too much (we're setting almost 200 key presses here) let me know, otherwise I should have the rest done this evening.

Thanks again! rah.gif

random_download
  • random_download

    :o

  • Members
  • Joined: 07 Mar 2004

#37

Posted 06 June 2005 - 07:18 PM

So you want the hotkeys to be like:

CTRL + A = animation $Grp1Ped1 wait state 0 2000 ms
CTRL + B = animation $Grp1Ped1 wait state 1 2000 ms
CTRL + C = animation $Grp1Ped1 wait state 2 2000 ms

and then:

SHIFT + A = animation $Grp2Ped1 wait state 0 2000 ms
animation $Grp2Ped2 wait state 0 2000 ms

SHIFT + B = animation $Grp2Ped1 wait state 1 2000 ms
animation $Grp2Ped2 wait state 1 2000 ms
etc.?

Then, what are the shift, ctrl etc. for each group? Eg.
NONE = $Grp1Pedx
SHIFT = $Grp2Pedx
CTRL = $Grp3Pedx
ALT = $Grp4Pedx

ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • None

#38

Posted 06 June 2005 - 07:34 PM

QUOTE (random_download @ Jun 6 2005, 19:18)
So you want the hotkeys to be like:

CTRL + A = animation $Grp1Ped1 wait state 0 2000 ms
CTRL + B = animation $Grp1Ped1 wait state 1 2000 ms
CTRL + C = animation $Grp1Ped1 wait state 2 2000 ms

and then:

SHIFT + A = animation $Grp2Ped1 wait state 0 2000 ms
animation $Grp2Ped2 wait state 0 2000 ms

SHIFT + B = animation $Grp2Ped1 wait state 1 2000 ms
animation $Grp2Ped2 wait state 1 2000 ms
etc.?

Then, what are the shift, ctrl etc. for each group? Eg.
NONE = $Grp1Pedx
SHIFT = $Grp2Pedx
CTRL = $Grp3Pedx
ALT = $Grp4Pedx

Close, but not quite. Here's what we know:

All peds have their own ID ($Grp1Ped1, $Grp2Ped1, etc). What I want to be able to do is assign ANY ped the same animations that are available for everyone. Here are a few examples:

Keys for one ped (just an example - these values will change once I finalize them tonight)
Q= wait state one (0000: set actor $Grp1Ped1 to wait state 01 2000 ms)
W= wait state two (0000: set actor $Grp1Ped1 to wait state 02 2000 ms)
R= wait state three(0000: set actor $Grp1Ped1 to wait state 03 2000 ms)
T= wait state four (0000: set actor $Grp1Ped1 to wait state 04 2000 ms)
Y= wait state five (0000: set actor $Grp1Ped1 to wait state 05 2000 ms)
U= wait state six (0000: set actor $Grp1Ped1 to wait state 06 2000 ms)
I= wait state seven (0000: set actor $Grp1Ped1 to wait state 07 2000 ms)
O= wait state eight (0000: set actor $Grp1Ped1 to wait state 08 2000 ms)
P= wait state nine (0000: set actor $Grp1Ped1 to wait state 09 2000 ms)
(would continue on for the next two rows of keys)

So for a group of two peds, we need this:
For $Grp2Ped1 (first ped in Group 2)
SHIFT + Q= wait state one (0000: set actor $Grp2Ped1 to wait state 01 2000 ms)
SHIFT +W= wait state two (0000: set actor $Grp2Ped1 to wait state 02 2000 ms)
SHIFT +R= wait state three(0000: set actor $Grp2Ped1 to wait state 03 2000 ms)
SHIFT +T= wait state four (0000: set actor $Grp2Ped1 to wait state 04 2000 ms)
SHIFT +Y= wait state five (0000: set actor $Grp2Ped1 to wait state 05 2000 ms)
SHIFT +U= wait state six (0000: set actor $Grp2Ped1 to wait state 06 2000 ms)
SHIFT +I= wait state seven (0000: set actor $Grp2Ped1 to wait state 07 2000 ms)
SHIFT +O= wait state eight (0000: set actor $Grp2Ped1 to wait state 08 2000 ms)
SHIFT +P= wait state nine (0000: set actor $Grp2Ped1 to wait state 09 2000 ms)
(would continue on for the next two rows of keys)

and for $Grp2Ped2 (second ped in group two)
CRTL LF + Q= wait state one (0000: set actor $Grp2Ped2 to wait state 01 2000 ms)
CRTL LF +W= wait state two (0000: set actor $Grp2Ped2 to wait state 02 2000 ms)
CRTL LF +R= wait state three(0000: set actor $Grp2Ped2 to wait state 03 2000 ms)
CRTL LF +T= wait state four (0000: set actor $Grp2Ped2 to wait state 04 2000 ms)
CRTL LF +Y= wait state five (0000: set actor $Grp2Ped2to wait state 05 2000 ms)
CRTL LF +U= wait state six (0000: set actor $Grp2Ped2 to wait state 06 2000 ms)
CRTL LF +I= wait state seven (0000: set actor $Grp2Ped2 to wait state 07 2000 ms)
CRTL LF +O= wait state eight (0000: set actor $Grp2Ped2 to wait state 08 2000 ms)
CRTL LF +P= wait state nine (0000: set actor $Grp2Ped2 to wait state 09 2000 ms)

Three peds would work the same way, except change the modifier for $Grp3Ped1 from SHIFT to ALT LF,
change for $Grp3Ped2 from CRTL LF to ALT RT and use CRTL RT for $Grp3Ped3. The Grp4 peds would use the FKeys.

I know it seems like a ton of work, but it's really just copy/paste/change some value to reflect the proper peds. This way there is one animation key; just the PedModifier changes (so I'll always know that "K" will make a ped run; if I know what the modifier is for Grp3Ped3, I just press CRTL RT K to make Grp3Ped3 run.)

If this is still too confusing (it can be for me, and I came up with it!), let me know and I'll try again...

Thanks!

rah.gif

random_download
  • random_download

    :o

  • Members
  • Joined: 07 Mar 2004

#39

Posted 06 June 2005 - 07:53 PM

Is it OK if the keys are like A = wait_state 1, B = 2, C = 3 etc.? Only that way I could use a loop to set them up instead of copy+paste it all.

ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • None

#40

Posted 06 June 2005 - 08:09 PM

QUOTE (random_download @ Jun 6 2005, 19:53)
Is it OK if the keys are like A = wait_state 1, B = 2, C = 3 etc.? Only that way I could use a loop to set them up instead of copy+paste it all.

So from my non C++ coding background, would this mean that you would set A = wait_state 1, and then just add the var (Ped) to determine where it goes?

What you're saying is this:

A = Ani1
B = Ami2
C= Ami3

And peds

SHIFT LF = Grp1Ped1
CTRL LF = Grp2Ped1
ALT LF = Grp2Ped2
ALT RT = Grp3Ped1
CTRL RT = Grp3Ped2
SHIFT RT = Grp3Ped3
F1, F2, etc = Special Four Ped Keys

So you would call SHIFT LF + A = grp1ped1 + ani1
and CRTL LF + A = grp2ped1 + ani1

If that works and it's eaiser, then by all means, yes!

How about better crash protection; can you make it so that if you just press a letter key, nothing happens? (Kinda like I do in the main.scm). So it would REQUIRE a modifier plus the animation key to work? Then we'd only have crashes from trying to play an animation on a ped that doesn't exsist (see above three or so posts). This also may eliminate the need to have people swap out the gtavc.set file...

Thoughts?

random_download
  • random_download

    :o

  • Members
  • Joined: 07 Mar 2004

#41

Posted 06 June 2005 - 08:18 PM

Yes, I can run a loop as letters are next to each other in ASCII code. Yeah, I can make it so that a modifier is required, just need there to be enough of them.

ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • None

#42

Posted 06 June 2005 - 08:27 PM

Ok, I'll set up the keys when I get home, and leave out the ped vars. Let's go with what I put on the other page for peds:

SHIFT LF = Grp1Ped1
CTRL LF = Grp2Ped1
ALT LF = Grp2Ped2
ALT RT = Grp3Ped1
CTRL RT = Grp3Ped2
SHIFT RT = Grp3Ped3

I like this, because it almost goes "around" the keyboard. I'm trying to keep this as easy to use as possible. :-)

You should have the finished definitions tonight (and thanks for the create_coord idea; I tried that, but not with the walk_actor_to opcode. I shall mess around.)

Many, super, duper, froopy thanks for all this! biggrin.gif

Y_Less
  • Y_Less

    629

  • Members
  • Joined: 14 Mar 2004

#43

Posted 07 June 2005 - 02:13 PM Edited by Y_Less, 07 June 2005 - 02:36 PM.

Random, if you're doing this, could you get it so when you press a certain key, it stores a value (e.g. use binary values so a=1, b=2, ab=3, c=4 etc) in a memory location (reduce sizes by storing half the alphabet in one adress, the other in another) within the SCM variables area of memory so you could directly access them with a DMA SCM editor so you could use any keypress within the SCM e.g:

Store keypress value at SCM memory location 4?? and 6?? (2 bytes per half).

CODE
0084: $keypressed1 = 4??
0084: $keypressed2 = 6??
0004: $keysearch1 = 1? \\ Search for letter 'a' from first half
0004: $keysearch2 = 0? \\ Search for nothing from second half
0050: gosub ££lettersearch0

00D6: if 0?
0038: $keypressreturn = 1? \\ Was your letter pressed?
004D: jump_if_false ££whereever



\\\\\\\\\\\\\\\\\\\\\ Letter search function \\\\\\\\\\\\\\\\\\\\\\\

:lettersearch0
\\ Check for binary values - not nice code - may be simplifiable
0004: $keypressreturn = 0?
0004: $secondhalfdone = 0?

00D6: if 0?
0018: $keysearch1 > 0?
004D: jump_if_false ££lettersearchpart2
0084: $keytesting = $keypressed1
0084: $keytofind = $keysearch1

:lettersearchpart1
0004: $letteron = 4096&& \\ 4096 = m, 2048 = l, 1024 = k etc

:testletter
00D6: if 0?
001C: $keytesting > $letteron
004D: jump_if_false ££letterdivide

00D6: if 0?
003A: $letteron = $keytofind \\ If true your letter has been pressed
004D: jump_if_false ££lettertakeaway
0008: $keypressreturn += 1?

:lettertakeaway
0060: $keytesting -= $letteron

:letterdivide
00D6: if 0?
0038: $letteron = 1? \\ Is it on the last letter?
004D: jump_if_false ££lettersearchpart2

0014: $letteron /= 2? \\ Go to next letter
0002: jump ££testletter

:lettersearchpart2
00D6: if 21?
0038: $keypressreturn = 1? \\ Was the first half successful?
0038: $secondhalfdone = 1? \\ Or has this bit been done?
004D: jump_if_false ££lettersearchend \\ If first half sucessful, no need to check!

00D6: if 0?
0018: $keysearch2 > 0? \\ Any letter from the second half needed?
004D: jump_if_false ££lettersearchend \\ Not needed to check at all

0084: $keytesting = $keypressed2
0084: $keytofind = $keysearch2
0004: $secondhalfdone = 1?
0002: jump ££testletter

:lettersearchend
0051: return


Note: this code has NOT been tested and is written for 0.22 so the DMA will work.




Edit: how it (supposedly) works (if you're bothered):

It starts from the highest letter in half the alphabet (M or Z), if the binary value of this letter is greater then the binary value of the letters pressed (which if that bit is not on it will be) nothing happens. If its less, that bit MUST be on in than number (because of the way binary numbers work), so you take that number away, eliminating one bit.

After either of these results, the number of the bit you are testing is halfed (next binary bit is selected) and the number is retested. As you have already taken away any higher bits, the bit you are testing will be the largest existant bit, so if the number is larger, that bit again MUST be on.

If the bit you are testing matches the bit of the letter you want to find, and it returns true, the marker is set. The test currently continues anyway though. You can only currently check for one letter at a time (to search for multiple letters you would need to run the check multiple times). It only checks helf the alphabet though to speed up searches a bit.


random_download
  • random_download

    :o

  • Members
  • Joined: 07 Mar 2004

#44

Posted 08 June 2005 - 05:15 PM

My Vice City has screwed up and is refusing to detect my audio hardware, which also means that .asi files are not loaded sad.gif progress on the keypress dll will halt until I can fix this.

ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • None

#45

Posted 09 June 2005 - 05:57 PM

Bah, freaking Winblows.

I swear if I had the money, I'd go with a Mac. Or maybe I should dig out the old TRS-80 CoCo3? Or even the Timex Sinclair!?!?

Take your time man; no huge rush. If you need any troubleshooting help, let me know. I'm REAL good at offering useless suggestions.

BTW, my friend Robyn (who is also a fantastic singer to work with) has one of the lead roles in our upcoming production of PEDS. She asked me to pass this along:

CODE

"HURRY UP YOU F*** WANKER! THERE IS NO WAY YOU ARE GOING TO SCREW UP MY BIG ACTING DEBUT! COME ON, MOVE IT!"

Love, Robyn.

PS - I'm just kidding, please take your time, and thank you for all of your help!

Love, Robyn.

PPS - WHAT THE F*** ARE YOU WAITING FOR?!?!

Love, Robyn.


Gotta love them rich chicks!

Anyway, thanks for the help and good luck on the solving the problem. Think I may have to go pick up GTA:SA today for fun... rah.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users